This commit is contained in:
Matthieu Bessat 2020-07-16 17:42:49 +02:00
parent b931d5c40b
commit b8d7b53308
7 changed files with 316 additions and 87 deletions

View file

@ -51,13 +51,16 @@
</v-card-title>
<v-card-text>
<p>
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.
</p>
<v-text-field
v-on:keydown.enter="submitForm()"
autofocus
label="Token"
v-model="token" />
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" />
</v-card-text>
<v-card-actions>
<v-spacer />
@ -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 !'
})
}
})

View file

@ -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.
</p>
<v-text-field
v-on:keydown.enter="submitForm()"
autofocus
label="Clée"
v-model="token" />
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" />
</v-card-text>
<v-card-actions>
<v-spacer />
@ -170,9 +173,16 @@
</v-alert>
</v-card-text>
<v-card-actions>
<v-btn color="primary" text @click="publishModal = false">Fermer</v-btn>
<v-btn text @click="publishModal = false">Fermer</v-btn>
<v-spacer />
<v-btn :disabled="!canPublish" text @click="askApproval()">Demander une vérification</v-btn>
<v-btn
color="primary"
text
:disabled="!canPublish"
:loading="askingApprovalLoading"
@click="askApproval()">
Demander une vérification
</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
@ -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"