Skip to content

Commit 4018cd5

Browse files
authored
Merge pull request #4 from Libertech-FR/gestion-mdp
Gestion mdp
2 parents eb054e5 + 95879d2 commit 4018cd5

File tree

20 files changed

+1386
-83
lines changed

20 files changed

+1386
-83
lines changed

src/components/2pan/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ q-splitter(
1919
:visible-columns="visibleColumnsInternal"
2020
:row-key="rowKey"
2121
@request="onRequest($event, props.total)"
22-
:rows-per-page-options="[12, 16, 20]"
22+
:rows-per-page-options="[12, 16, 20,50,0]"
2323
:columns="cols"
2424
:loading="pending"
2525
rows-per-page-label="Lignes par page"
@@ -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/appbar/RightButtons.vue

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
div
33
//q-btn(v-for="button in buttons" :key="button.icon" round flat :icon="button.icon" size="md").q-mx-sm
44
q-tooltip.text-body2(transition-show="scale" transition-hide="scale") {{ button.name }}
5+
56
q-btn(v-if="badgesValues.TO_SYNC > 0" icon="mdi-sync" square color="amber-9" size="md" :label="badgesValues.TO_SYNC +' items à Synchroniser'" @click="syncAll")
6-
q-btn(v-if="debug" @click="$q.dark.toggle()" flat size="md" icon="mdi-theme-light-dark")
7+
q-btn( icon="mdi-cog" size="md" flat @click="displaySettings")
8+
q-btn( @click="$q.dark.toggle()" flat size="md" icon="mdi-theme-light-dark")
79
q-btn-dropdown(icon="mdi-account-circle-outline" :label="auth?.user?.displayName" round flat size="md")
810
q-list
911
q-item.q-pa-none(v-for="button in buttons" :key="button.name")
@@ -16,11 +18,14 @@ div
1618
flat
1719
dense
1820
)
21+
q-dialog( v-model="settings" full-width persistent)
22+
sesame-settings
1923
</template>
2024

2125
<script lang="ts" setup>
2226
import { useIdentityStateStore } from "~/stores/identityState"
23-
27+
import {ref} from "vue";
28+
let settings=ref(false)
2429
2530
const identityStateStore = useIdentityStateStore()
2631
@@ -32,21 +37,7 @@ const auth = useAuth()
3237
const { debug } = useDebug()
3338
// console.log(auth)
3439
const buttons = [
35-
// {
36-
// icon: 'mdi-cog',
37-
// name: 'Paramètres',
38-
// to: '/settings',
39-
// },
40-
// {
41-
// icon: 'mdi-bell',
42-
// name: 'Notifications',
43-
// to: '#',
44-
// },
45-
// {
46-
// icon: 'mdi-help',
47-
// name: 'Aide',
48-
// to: '#',
49-
// },
40+
5041
{
5142
icon: 'mdi-logout',
5243
name: 'Déconnexion',
@@ -59,7 +50,9 @@ const buttons = [
5950
]
6051
6152
const emits = defineEmits(['syncing'])
62-
53+
function displaySettings(){
54+
settings.value=true
55+
}
6356
async function syncAll() {
6457
emits('syncing', { count: badgesValues.value.TO_SYNC })
6558
await useHttp('/core/backends/syncall', {
@@ -71,4 +64,5 @@ async function syncAll() {
7164
await identityStateStore.fetchToSyncCount()
7265
await identityStateStore.fetchSyncedCount()
7366
}
67+
7468
</script>

src/components/identityForm/actions.vue

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +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-email-arrow-right" :disabled="props.identity.state != IdentityState.SYNCED")
6+
q-tooltip.text-body2(slot="trigger") Envoyer le mail d'invitation
57
q-btn.q-mx-xs(@click="submit" color="positive" icon="mdi-check" v-show="!isNew" v-if="crud.update")
68
q-tooltip.text-body2(slot="trigger") Enregistrer les modifications
79
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")
@@ -21,9 +23,9 @@ import { useFetch } from 'nuxt/app'
2123
import { useIdentityStates } from '~/composables'
2224
import { useErrorHandling } from '#imports'
2325
26+
2427
type IdentityResponse = operations['IdentitiesController_search']['responses']['200']['content']['application/json']
2528
type Identity = components['schemas']['IdentitiesDto']
26-
2729
const props = defineProps({
2830
identity: {
2931
type: Object as PropType<Identity>,
@@ -69,6 +71,28 @@ async function sync() {
6971
emits('sync')
7072
}
7173
74+
async function sendInit(){
75+
//envoi le mail
76+
77+
const { data: result, pending, error, refresh } = await useHttp(`/management/passwd/init`, {
78+
method: 'POST',
79+
body: { uid: props.identity.inetOrgPerson.uid },
80+
});
81+
if (error.value) {
82+
handleError({
83+
error: error.value,
84+
message: 'Erreur lors de l\'envoi du mail'
85+
})
86+
} else {
87+
$q.notify({
88+
message: 'Le mail a été envoyé',
89+
color: 'positive',
90+
position: 'top-right',
91+
icon: 'mdi-check-circle-outline',
92+
})
93+
}
94+
}
95+
7296
function logs() {
7397
router.push(`/jobs?filters[:concernedTo.id]=${(props.identity as any)._id}`)
7498
}

0 commit comments

Comments
 (0)