Skip to content

Commit f1f7c4a

Browse files
committed
fix: correct button click handler and improve tooltip visibility in identities table
1 parent e768f60 commit f1f7c4a

File tree

3 files changed

+126
-19
lines changed

3 files changed

+126
-19
lines changed

apps/web/src/composables/useColumnsIdentities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function useColumnsIdentites(): useColumnsIdentitesReturnType {
5959
const columns = ref<QTableProps['columns']>([
6060
{
6161
name: 'states',
62-
label: 'Etats',
62+
label: 'États',
6363
field: 'states',
6464
align: 'left',
6565
},

apps/web/src/composables/useFiltersQuery.ts

Lines changed: 123 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,126 @@ export type ComparatorType = {
2929
}
3030

3131
const comparatorTypes = ref<ComparatorType[]>([
32-
{ label: 'Egal à', querySign: ':', value: ':', icon: 'mdi-equal', type: ['text'], multiplefields: false, prefix: '', suffix: '' },
33-
{ label: 'Entier à', querySign: '#', value: '#', icon: 'mdi-pound', type: ['number'], multiplefields: false, prefix: '', suffix: '' },
34-
{ label: 'Différent', querySign: '!:', value: '!:', icon: 'mdi-exclamation', type: ['number'], multiplefields: false, prefix: '', suffix: '' },
35-
{ label: 'Supérieur à', querySign: '>', value: '>', icon: 'mdi-greater-than', type: ['number', 'date'], multiplefields: false, prefix: '', suffix: '' },
36-
{ label: 'Supérieur ou égal à', querySign: '>=', value: '>=', icon: 'mdi-greater-than-or-equal', type: ['number', 'date'], multiplefields: false, prefix: '', suffix: '' },
37-
{ label: 'Inférieur à', querySign: '<', value: '<', icon: 'mdi-less-than', type: ['number', 'date'], multiplefields: false, prefix: '', suffix: '' },
38-
{ label: 'Inférieur ou égal à', querySign: '<=', value: '<=', icon: 'mdi-less-than-or-equal', type: ['number', 'date'], multiplefields: false, prefix: '', suffix: '' },
39-
{ label: 'entre', querySign: '<<', value: 'between', icon: 'mdi-arrow-expand-horizontal', type: ['number', 'date'], multiplefields: true, prefix: '', suffix: '' },
40-
{ label: 'Contient', querySign: '^', value: '^', icon: 'mdi-apple-keyboard-control', type: ['text'], multiplefields: false, prefix: '/', suffix: '/i' },
41-
{ label: 'Commence par', querySign: '^', value: '/^', icon: 'mdi-contain-start', type: ['text'], multiplefields: false, prefix: '/^', suffix: '/i' },
42-
{ label: 'Fini par', querySign: '^', value: '$/', icon: 'mdi-contain-end', type: ['text'], multiplefields: false, prefix: '/', suffix: '$/i' },
43-
{ label: 'Inclus', querySign: '@', value: '@', icon: 'mdi-format-letter-matches', type: [], multiplefields: true, prefix: '', suffix: '' },
32+
{
33+
label: 'Égal à',
34+
querySign: ':',
35+
value: ':',
36+
icon: 'mdi-equal',
37+
type: ['text'],
38+
multiplefields: false,
39+
prefix: '',
40+
suffix: '',
41+
},
42+
{
43+
label: 'Entier à',
44+
querySign: '#',
45+
value: '#',
46+
icon: 'mdi-pound',
47+
type: ['number'],
48+
multiplefields: false,
49+
prefix: '',
50+
suffix: '',
51+
},
52+
{
53+
label: 'Différent',
54+
querySign: '!:',
55+
value: '!:',
56+
icon: 'mdi-exclamation',
57+
type: ['number'],
58+
multiplefields: false,
59+
prefix: '',
60+
suffix: '',
61+
},
62+
{
63+
label: 'Supérieur à',
64+
querySign: '>',
65+
value: '>',
66+
icon: 'mdi-greater-than',
67+
type: ['number', 'date'],
68+
multiplefields: false,
69+
prefix: '',
70+
suffix: '',
71+
},
72+
{
73+
label: 'Supérieur ou égal à',
74+
querySign: '>=',
75+
value: '>=',
76+
icon: 'mdi-greater-than-or-equal',
77+
type: ['number', 'date'],
78+
multiplefields: false,
79+
prefix: '',
80+
suffix: '',
81+
},
82+
{
83+
label: 'Inférieur à',
84+
querySign: '<',
85+
value: '<',
86+
icon: 'mdi-less-than',
87+
type: ['number', 'date'],
88+
multiplefields: false,
89+
prefix: '',
90+
suffix: '',
91+
},
92+
{
93+
label: 'Inférieur ou égal à',
94+
querySign: '<=',
95+
value: '<=',
96+
icon: 'mdi-less-than-or-equal',
97+
type: ['number', 'date'],
98+
multiplefields: false,
99+
prefix: '',
100+
suffix: '',
101+
},
102+
{
103+
label: 'entre',
104+
querySign: '<<',
105+
value: 'between',
106+
icon: 'mdi-arrow-expand-horizontal',
107+
type: ['number', 'date'],
108+
multiplefields: true,
109+
prefix: '',
110+
suffix: '',
111+
},
112+
{
113+
label: 'Contient',
114+
querySign: '^',
115+
value: '^',
116+
icon: 'mdi-apple-keyboard-control',
117+
type: ['text'],
118+
multiplefields: false,
119+
prefix: '/',
120+
suffix: '/i',
121+
},
122+
{
123+
label: 'Commence par',
124+
querySign: '^',
125+
value: '/^',
126+
icon: 'mdi-contain-start',
127+
type: ['text'],
128+
multiplefields: false,
129+
prefix: '/^',
130+
suffix: '/i',
131+
},
132+
{
133+
label: 'Fini par',
134+
querySign: '^',
135+
value: '$/',
136+
icon: 'mdi-contain-end',
137+
type: ['text'],
138+
multiplefields: false,
139+
prefix: '/',
140+
suffix: '$/i',
141+
},
142+
{
143+
label: 'Inclus',
144+
querySign: '@',
145+
value: '@',
146+
icon: 'mdi-format-letter-matches',
147+
type: ['array'],
148+
multiplefields: true,
149+
prefix: '',
150+
suffix: '',
151+
},
44152
])
45153

46154
const getAllPrefixAndSuffixPattern = computed(() => {
@@ -62,7 +170,9 @@ const getLabelByName = (columns: Ref<QTableProps['columns'] & { type: string }[]
62170

63171
if (!field) return name.replace(FILTER_BRACES.join(''), '')
64172

65-
if (field.type !== 'multiple') return (field.label as string).replace(FILTER_BRACES.join(''), '')
173+
if (typeof (field as any).type === 'undefined' || (field as any).type !== 'multiple') {
174+
return (field.label as string).replace(FILTER_BRACES.join(''), '')
175+
}
66176

67177
return field.name.replace(FILTER_BRACES.join(''), '')
68178
}

apps/web/src/pages/identities/table/[_id]/index.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,23 +58,20 @@
5858
q-tooltip.text-body2(slot="trigger") Définir le mot de passe
5959
q-btn.q-px-sm(
6060
v-if="identity?._id"
61-
@click="sendInit"
61+
@click="sendInit()"
6262
:color="identity.state != IdentityState.SYNCED ? 'grey-7' : 'primary'"
6363
:disabled="identity.state != IdentityState.SYNCED"
6464
icon="mdi-email-arrow-right"
6565
flat dense
6666
)
6767
q-tooltip.text-body2(slot="trigger") Envoyer le mail d'invitation
6868
q-separator(v-if="identity?._id" v-for='_ in 2' :key='_' vertical)
69-
//- :disabled='!savable'
7069
q-btn.q-px-sm.text-positive(
7170
@click='save()'
7271
icon='mdi-content-save'
7372
dense
7473
)
75-
//- q-tooltip.text-body2(slot='trigger' :class='savable ? "bg-positive" : ""')
76-
//- span(v-if="savable") Enregistrer les modifications
77-
//- span(v-else) Aucune modification à enregistrer
74+
q-tooltip.text-body2.bg-positive(slot='trigger') Enregistrer les modifications
7875
q-btn.q-px-sm.text-orange-8(
7976
@click='sync()'
8077
v-if="identity?._id"

0 commit comments

Comments
 (0)