Skip to content

Commit 11f927f

Browse files
committed
invitations perimées
1 parent 67d642b commit 11f927f

File tree

6 files changed

+104
-13
lines changed

6 files changed

+104
-13
lines changed

src/components/2pan/index.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ q-splitter(
3333
template(v-for="(_, name) in $slots" v-slot:[name]="slotData")
3434
slot(:name="name" v-bind="slotData")
3535
template(v-slot:top-left)
36-
q-btn-group(v-if="leftBtnHidden" rounded flat)
36+
q-btn-group( rounded flat)
3737
slot(name="top-left-btn-grp" :selectedValues="selected")
3838
slot(name="top-left-btn-grp-content-before")
3939
slot(name="top-left-btn-grp-content-after")

src/components/identityForm/actions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
div
33
q-btn(color="positive" icon='mdi-content-save-plus' @click="create" v-show="isNew" v-if="crud.create")
44
q-tooltip.text-body2 Créer
5-
q-btn.q-mx-xs(@click="sendInit" color="primary" icon="mdi-mail" :disabled="props.identity.state != IdentityState.SYNCED")
6-
q-tooltip.text-body2(slot="trigger") Envoyer le mail d'initialisation
5+
q-btn.q-mx-xs(@click="sendInit" color="primary" icon="mdi-email-arrow-right" :disabled="props.identity.state != IdentityState.SYNCED")
6+
q-tooltip.text-body2(slot="trigger") Envoyer le mail d'invitation
77
q-btn.q-mx-xs(@click="submit" color="positive" icon="mdi-check" v-show="!isNew" v-if="crud.update")
88
q-tooltip.text-body2(slot="trigger") Enregistrer les modifications
99
q-btn.q-mx-xs(v-if="props.identity?._id" @click="sync" color="orange-8" :disabled="props.identity.state != IdentityState.TO_VALIDATE" icon="mdi-sync")

src/components/table/top-left.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
<template lang="pug">
22
q-btn-group(rounded flat)
3-
q-btn(flat icon="mdi-eye" color="primary" rounded @click="goToIdentity(selected[0])" size="md" :disable="selected.length === 0 || selected.length !== 1")
4-
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Afficher les identités sélectionnées
53
//- q-btn(flat icon="mdi-merge" color="primary" rounded @click="merge" size="md" :disable="true ||selected.length === 0 || selected.length === 1")
64
//- q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Fusionner les identités sélectionnées
75
//- q-btn(flat icon="mdi-check" color="primary" rounded @click="openUpdateModale(IdentityState.TO_VALIDATE)" size="md" :disable="selected.length === 0")
86
//- q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Valider les identités sélectionnées
97
q-btn(flat icon="mdi-sync" color="orange-8" rounded @click="openUpdateModale" size="md" :disable="selected.length === 0")
108
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Mettre à synchroniser les identités sélectionnées
11-
q-btn(flat icon="mdi-mail" color="orange-8" rounded @click="openInitModale" size="md" :disable="selected.length === 0")
12-
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Envoyer le mail d'initialisation
9+
q-btn(flat icon="mdi-email-arrow-right" color="primary" rounded @click="openInitModale" size="md" :disable="selected.length === 0")
10+
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Envoyer le mail d'invitation
1311
q-btn(flat icon="mdi-close" color="negative" rounded @click="clearSelection" size="md" :disable="selected.length === 0")
1412
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") Nettoyer la selection
1513
</template>

src/composables/useMenu.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ function useMenu(identityStateStore, identityAffectationStore) {
6464
},
6565
{
6666
icon: 'mdi-loading',
67-
label: 'En cours de synchronisation',
67+
label: 'En cours de synchro.',
6868
path: `/identities?sort[metadata.lastUpdatedAt]=desc&skip=0&filters[@state][]=${IdentityState.PROCESSING}`,
6969
color: 'primary',
7070
part: 'Etats',
@@ -89,14 +89,14 @@ function useMenu(identityStateStore, identityAffectationStore) {
8989
},
9090
{
9191
icon: 'mdi-email-alert',
92-
label: 'Emails non envoyés',
92+
label: 'Invitations non envoyés',
9393
path: '/identities?limit=10&skip=0&filters[&filters[%23initState]=0&sort[metadata.lastUpdatedAt]=desc',
9494
color: 'negative',
9595
part: 'Activation'
9696
},
9797
{
9898
icon: 'mdi-email-fast',
99-
label: 'Emails envoyés',
99+
label: 'Invitations envoyées',
100100
path: '/identities?limit=10&skip=0&filters[&filters[%23initState]=1&sort[metadata.lastUpdatedAt]=desc',
101101
color: 'warning',
102102
part: 'Activation'
@@ -105,7 +105,14 @@ function useMenu(identityStateStore, identityAffectationStore) {
105105
icon: 'mdi-email-open',
106106
label: 'Comptes activés',
107107
path: '/identities?limit=10&skip=0&filters[&filters[%23initState]=2&sort[metadata.lastUpdatedAt]=desc',
108-
color: 'secondary',
108+
color: 'positive',
109+
part: 'Activation'
110+
},
111+
{
112+
icon: 'mdi-email-remove',
113+
label: 'Invitations périmées',
114+
path: '/identities/outdated',
115+
color: 'accent',
109116
part: 'Activation'
110117
},
111118
{

src/pages/identities/outdated.vue

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<template>
2+
<q-table
3+
flat bordered
4+
title="Identités dons l'invitation n'est plus valide"
5+
dense
6+
:rows="rows1"
7+
:columns="fieldsName"
8+
selection="multiple"
9+
v-model:selected="selected"
10+
row-key="uid"
11+
:rows-per-page-options="[20,50,0]"
12+
rows-per-page-label="Lignes par page"
13+
no-data-label="Aucune donnée"
14+
loading-label="Chargement..."
15+
no-results-label="Aucun résultat"
16+
:pagination-label="(firstRowIndex, endRowIndex, totalRowsNumber) => `${firstRowIndex}-${endRowIndex} sur ${totalRowsNumber} lignes`"
17+
:selected-rows-label="(numberOfRows) => `${numberOfRows} entrée(s) sélectionnée(s)`"
18+
>
19+
<template v-slot:top-left>
20+
<q-btn color="primary" icon="mdi-email-sync" size="md" flat rounded @click="openInitModale" :disable="selected.length === 0">
21+
<q-tooltip class="text-body2" transition-show="scale" transition-hide="scale">Réenvoyer le mail d'invitation</q-tooltip>
22+
23+
</q-btn>
24+
</template>
25+
</q-table>
26+
</template>
27+
28+
<script setup>
29+
import {ref} from "vue";
30+
import updateInitModale from "../../components/updateInitModale.vue";
31+
import {useQuasar} from "quasar";
32+
33+
const selected=ref([])
34+
const $q=useQuasar()
35+
const { data: fieldsName, pending1, error1} = await useHttp('/management/identities/validation', {
36+
method: 'GET',
37+
transform: (result)=>{
38+
const allFields=result.data.flatMap((enr)=>{
39+
return Object.keys(enr[enr.name].properties)
40+
})
41+
42+
return allFields.map((enr)=>{
43+
return {name:enr,field:enr,label:enr,align: 'left'}
44+
})
45+
}
46+
});
47+
48+
const { data: rows1, pending, error, refresh } = await useHttp('/management/passwd/ioutdated', {
49+
method: 'GET',
50+
transform: (result)=>{
51+
const allFields=result.data.map((enr)=>{
52+
let addF={}
53+
for (const [key, value] of Object.entries(enr?.additionalFields?.attributes||{})) {
54+
addF = {...addF, ...value}
55+
}
56+
const step1={...enr.inetOrgPerson,...addF}
57+
return step1
58+
})
59+
return allFields
60+
}
61+
});
62+
63+
function openInitModale() {
64+
65+
66+
$q.dialog({
67+
component: updateInitModale,
68+
componentProps: {
69+
selectedIdentities: selected.value,
70+
identityTypesName: name,
71+
allIdentitiesCount: rows1.length,
72+
},
73+
})
74+
.onOk(async (data) => {
75+
console.log('initIdentities', data)
76+
data.syncAllIdentities ? await sendInitToAllIdentities(identityState) : await sendInitToIdentity(props.selected, identityState)
77+
})
78+
.onCancel(() => {
79+
console.log('cancelinit')
80+
})
81+
}
82+
</script>
83+
84+
<style scoped>
85+
86+
</style>

src/pages/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ q-page.container
77
div.row.q-gutter-md
88
q-btn(v-for="item in getMenuByPart(part)" :key="item.label"
99
tile :color="item.color"
10-
class="col-xs-12 col-sm-6 col-md-4 col-lg-3"
10+
class="col-xs-12 col-sm-6 col-md-6 col-lg-4"
1111
:label="item.label"
1212
@click="push(item.path)"
1313
:icon="item.icon"
14-
style="height: 60px; font-size: 18px;")
14+
style="height: 60px; font-size: 18px; width:20%;" )
1515
q-badge(v-if="item.badgeValue" :color="item.badge.color" floating) {{ item.badge.value }}
1616
//- span(v-for="item in getMenuByPart(part)" :key="item.label") {{ item }}
1717
</template>

0 commit comments

Comments
 (0)