From b8d7b53308c95f71a45c971ae614e412136c945c Mon Sep 17 00:00:00 2001 From: Matthieu Bessat Date: Thu, 16 Jul 2020 17:42:49 +0200 Subject: [PATCH] update --- src/components/Preview.vue | 89 +++++++++++++ src/layouts/Admin.vue | 20 ++- src/layouts/Delegate.vue | 28 ++-- src/store/index.ts | 2 +- src/views/Admin/OrganizationList.vue | 192 +++++++++++++++++++-------- src/views/Admin/Tags.vue | 11 +- src/views/Home.vue | 61 ++++++++- 7 files changed, 316 insertions(+), 87 deletions(-) create mode 100644 src/components/Preview.vue diff --git a/src/components/Preview.vue b/src/components/Preview.vue new file mode 100644 index 0000000..320a614 --- /dev/null +++ b/src/components/Preview.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/src/layouts/Admin.vue b/src/layouts/Admin.vue index 7fa653a..b8e40b1 100644 --- a/src/layouts/Admin.vue +++ b/src/layouts/Admin.vue @@ -51,13 +51,16 @@

- Vous n'êtes pas encore connecté à l'interface d'administration veuillez copier-coller le token dans la boîte ci-dessous. + Vous n'êtes pas encore connecté à l'interface d'administration veuillez copier-coller la clée administrateur dans la boîte ci-dessous.

+ label="Clée" + v-model="token" + :type="showPassword ? 'text' : 'password'" + :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" + v-on:keydown.enter="submitForm()" + @click:append="showPassword = !showPassword" />
@@ -80,7 +83,8 @@ export default { left: false, enabled: false, loading: true, - token: '' + token: '', + showPassword: false }), created () { this.init() @@ -107,12 +111,16 @@ export default { window.localStorage.setItem('adminToken', adminToken) this.loading = false this.enabled = true + // this.$store.commit('ADD_ALERT', { + // color: 'success', + // text: 'Vous voilà connecté !' + // }) }).catch(() => { this.loading = false if (this.token !== '') { this.$store.commit('ADD_ALERT', { color: 'error', - text: 'Token invalide !' + text: 'Clée administrateur invalide !' }) } }) diff --git a/src/layouts/Delegate.vue b/src/layouts/Delegate.vue index 3550005..d6075ef 100644 --- a/src/layouts/Delegate.vue +++ b/src/layouts/Delegate.vue @@ -128,10 +128,13 @@ Vous n'êtes pas encore connecté à l'interface de modification de votre association, veuillez copier-coller la clée qui vous a été envoyé par e-mail dans la boîte ci-dessous.

+ autofocus + v-model="token" + :type="showPassword ? 'text' : 'password'" + :append-icon="showPassword ? 'mdi-eye' : 'mdi-eye-off'" + v-on:keydown.enter="submitForm()" + @click:append="showPassword = !showPassword" /> @@ -170,9 +173,16 @@ - Fermer + Fermer - Demander une vérification + + Demander une vérification + @@ -211,7 +221,8 @@ export default { canPublish: false, publishModal: false, askingApprovalLoading: false, - rejectionDetailsModal: false + rejectionDetailsModal: false, + showPassword: false }), created () { this.init() @@ -375,8 +386,7 @@ export default { }, askApproval () { this.askingApprovalLoading = true - this.$apitator.post('/delegate/submit', {}, { withAuth: true }).then(res => { - console.log(res.data.data) + this.$apitator.post('/delegate/submit', {}, { withAuth: true }).then(() => { this.publishModal = false this.askingApprovalLoading = false this.$store.commit('SET_DELEGATE', { validationState: 'pending' }) @@ -386,7 +396,7 @@ export default { }) }).catch(err => { console.log(err.data) - this.isSaving = false + this.askingApprovalLoading = false this.$store.commit('ADD_ALERT', { color: 'error', text: "Impossible de soumettre l'association" diff --git a/src/store/index.ts b/src/store/index.ts index 796d46e..b06ac16 100644 --- a/src/store/index.ts +++ b/src/store/index.ts @@ -34,7 +34,7 @@ export default new Vuex.Store({ } }, delegate: { - validationState: 'none', + validationState: 'unaware', admiName: '', email: '', publicUrl: '' diff --git a/src/views/Admin/OrganizationList.vue b/src/views/Admin/OrganizationList.vue index ae5b600..c36b028 100644 --- a/src/views/Admin/OrganizationList.vue +++ b/src/views/Admin/OrganizationList.vue @@ -4,12 +4,14 @@ @@ -84,21 +86,28 @@ +