This commit is contained in:
Matthieu Bessat 2020-07-19 15:27:26 +02:00
commit 90cd5ec582
7 changed files with 89 additions and 26 deletions

View file

@ -209,6 +209,11 @@
<v-list-item-title>{{ toSeeItem.token }}</v-list-item-title>
<v-list-item-subtitle>Token/clé</v-list-item-subtitle>
</v-list-item-content>
<v-list-item-action>
<v-btn color="info" outlined @click="openPanel(toSeeItem)" small icon>
<v-icon small>launch</v-icon>
</v-btn>
</v-list-item-action>
</v-list-item>
<v-divider />
@ -233,7 +238,6 @@
</div>
<div v-if="toSeeItem.publishedAt !== undefined">
<v-divider />
<v-list-item>
<v-list-item-action />
<v-list-item-content>
@ -281,7 +285,8 @@
</v-dialog>
<Preview
:enabled="approveModal"
:slug="toApproveItem.slug"
:id="toApproveItem._id"
:slug="toApproveItem.slugs[0]"
:dialogTitle="approveModalTitle"
@close="approveModal = false"
>
@ -325,11 +330,12 @@ export default {
data: () => {
const item = {
_id: '',
adminName: '',
email: '',
validationState: 'unaware',
rejectionDescription: '',
slug: ''
slugs: ['']
}
return {
dialog: false,
@ -518,7 +524,12 @@ export default {
},
openExternal (item) {
window.open(process.env.VUE_APP_BASE_URL + '/association/' + item.slug + '?version=proposed', '_blank').focus()
window.open(process.env.VUE_APP_BASE_URL + '/association/' + item.slugs[item.slug.length - 1] + '?version=proposed', '_blank').focus()
},
openPanel (item) {
const routeData = this.$router.resolve({ name: 'DelegateMain', query: { delegateToken: item.token } })
window.open(routeData.href, '_blank').focus()
},
openApproveModal (item) {

View file

@ -43,7 +43,11 @@
/>
<!-- COVER END -->
<div class="d-flex justify-end mb-3">
<v-btn color="primary" outlined @click="addMediaModal = true">
<v-btn
color="primary"
outlined
:disabled="$store.state.delegate.validationState === 'pending'"
@click="addMediaModal = true">
<v-icon left>add</v-icon>
Ajouter un média
</v-btn>

View file

@ -19,13 +19,24 @@
<img :src="$store.state.data.thumbnail.location" />
</v-avatar>
</v-col>
<v-col cols="12" sm="6" style="align-items: center; justify-content: center; display: flex;">
<v-btn @click="$refs.avatarEditor.toggle()" color="primary" outlined>
<v-col cols="12" sm="6" style="align-items: center; justify-content: center; display: flex; flex-direction: column">
<v-btn
color="primary"
outlined
:disabled="$store.state.delegate.validationState === 'pending'"
@click="$refs.avatarEditor.toggle()"
>
<v-icon left>
edit
</v-icon>
Changer le logo
<span v-if="$store.state.data.thumbnail.location === ''">Définir un logo</span>
<span v-else>Changer le logo</span>
</v-btn>
<div
v-if="$store.state.data.thumbnail.location === '' && validateLogo"
class="red--text mt-2">
Vous devez définir un logo !
</div>
</v-col>
</v-row>
@ -39,10 +50,12 @@
<v-select
label="Catégorie(s) de l'association"
outlined
multiple
prepend-icon="category"
item-text="name"
item-value="_id"
v-model="$store.state.data.tag"
v-model="$store.state.data.tags"
:rules="rules.tags"
:items="$store.state.tags">
</v-select>
@ -91,6 +104,7 @@ export default {
data: () => ({
formValid: true,
logoLoading: false,
validateLogo: false,
rules: {
name: [
v => v.length >= 3 || 'Au minimum 3 caractères',
@ -100,6 +114,7 @@ export default {
v => v.length >= 20 || 'Au minimum 20 caractères',
v => v.length <= 200 || 'Au maximum 200 caractères'
],
tags: [v => (Array.isArray(v) && v.length > 0) || 'Vous devez choisir au minimum une catégorie'],
email: [v => /.+@.+\..+/.test(v) || "L'email est requis et dois être valide"],
person: [v => v.length >= 4 || 'Au minimum 4 caractères']
}
@ -115,7 +130,11 @@ export default {
watch: {
'$store.state.validateMain' (val) {
if (val) {
this.$store.state.validateMainCallback(this.$refs.form.validate())
this.validateLogo = true
this.$store.state.validateMainCallback(
this.$refs.form.validate() &&
this.$store.state.data.thumbnail.location.length > 1
)
}
}
},