bugs fixes

This commit is contained in:
Matthieu Bessat 2020-07-23 12:42:43 +02:00
commit 46953da4cc
7 changed files with 131 additions and 62 deletions

View file

@ -17,6 +17,7 @@
prepend-icon="public"
label="Site web"
outlined
:rules="rules.website"
v-model="$store.state.data.contacts.website" />
<v-textarea
prepend-icon="room"
@ -94,7 +95,7 @@ export default {
data: () => ({
rules: {
website: [
v => v === '' || /.+@.+\..+/.test(v) || "L'email doit être valide"
v => v === '' || /^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/gm.test(v) || "L'adresse web doit être valide"
],
address: [
v => v.length < 200 || 'Maximum 200 caractères'

View file

@ -119,8 +119,7 @@
<span>Décaler vers la droite</span>
</v-tooltip>
<v-spacer />
<v-tooltip bottom>
<v-tooltip bottom v-if="media.contentType.split('/')[0] === 'image'">
<template v-slot:activator="{ on, attrs }">
<v-btn
icon
@ -351,14 +350,14 @@ export default {
},
clearCover () {
this.$store.commit('SET_DATA', {
cover: undefined
cover: null
})
},
openMedia (item) {
window.open(item.location, '_blank').focus()
},
chooseAsCover (item) {
this.coverImage = item.location
this.coverImage = process.env.VUE_APP_BASE_URL + '/proxy-s3/' + item.key
this.$refs.avatarEditor.toggle()
}
}

View file

@ -127,20 +127,29 @@ export default {
// })
// },
mounted () {
if (this.$store.state.onMainReady()) {
this.validate()
}
},
watch: {
'$store.state.validateMain' (val) {
if (val) {
this.validateLogo = true
this.$store.state.validateMainCallback(
this.$refs.form.validate() &&
this.$store.state.data.thumbnail.location.length > 1
)
this.validate()
}
}
},
methods: {
handleAvatarEditorSubmitted: function (blob) {
validate () {
this.validateLogo = true
this.$store.state.validateMainCallback(
this.$refs.form.validate() &&
this.$store.state.data.thumbnail.location.length > 1
)
},
handleAvatarEditorSubmitted (blob) {
const form = new FormData()
form.append('file', blob, blob.filename)
this.logoLoading = true