Add placeholder for new contributions

This commit is contained in:
Matt Rider 2019-06-14 17:18:09 -03:00
parent dd627535e4
commit ebb73c8782

View File

@ -15,7 +15,7 @@
model="language" model="language"
:options="form.languageOptions" :options="form.languageOptions"
icon="globe" icon="globe"
:placeholder="form.placeholder" :placeholder="locale"
:label="$t('contribution.languageSelectLabel')" :label="$t('contribution.languageSelectLabel')"
/> />
</ds-flex-item> </ds-flex-item>
@ -64,7 +64,6 @@ export default {
content: '', content: '',
language: null, language: null,
languageOptions: [], languageOptions: [],
placeholder: '',
}, },
formSchema: { formSchema: {
title: { required: true, min: 3, max: 64 }, title: { required: true, min: 3, max: 64 },
@ -89,15 +88,15 @@ export default {
this.form.content = contribution.content this.form.content = contribution.content
this.form.title = contribution.title this.form.title = contribution.title
this.form.language = this.locale this.form.language = this.locale
this.form.placeholder = this.locale
}, },
}, },
}, },
computed: { computed: {
locale() { locale() {
const locale = this.contribution.language const locale =
? locales.find(loc => this.contribution.language === loc.code) this.contribution && this.contribution.language
: locales.find(loc => this.$i18n.locale() === loc.code) ? locales.find(loc => this.contribution.language === loc.code)
: locales.find(loc => this.$i18n.locale() === loc.code)
return locale.name return locale.name
}, },
}, },