[enh] visibleIf -> visible

This commit is contained in:
ljf 2021-09-06 17:10:14 +02:00
parent e2512168a4
commit 13f8354513
2 changed files with 7 additions and 7 deletions

View file

@ -27,7 +27,7 @@
<template v-for="(field, fname) in section.fields"> <template v-for="(field, fname) in section.fields">
<form-field :key="fname" v-model="forms[id_][fname]" <form-field :key="fname" v-model="forms[id_][fname]"
:validation="$v.forms[id_][fname]" :validation="$v.forms[id_][fname]"
v-if="isVisible(field.visibleIf)" v-bind="field" v-if="isVisible(field.visible)" v-bind="field"
/> />
</template> </template>
</div> </div>
@ -108,8 +108,8 @@ export default {
forms[id] = {} forms[id] = {}
validations_[id] = {} validations_[id] = {}
errors_[id] = {} errors_[id] = {}
for (const { id_, name, help, visibleIf, options } of sections) { for (const { id_, name, help, visible, options } of sections) {
const section_ = { id: id_, visibleIf } const section_ = { id: id_, visible }
if (help) section_.help = formatI18nField(help) if (help) section_.help = formatI18nField(help)
if (name) section_.name = formatI18nField(name) if (name) section_.name = formatI18nField(name)
const { form, fields, validations, errors } = formatYunoHostArguments(options) const { form, fields, validations, errors } = formatYunoHostArguments(options)
@ -138,8 +138,8 @@ export default {
}).catch(err => { }).catch(err => {
if (err.name !== 'APIBadRequestError') throw err if (err.name !== 'APIBadRequestError') throw err
const panel = this.panels.find(({ id }) => id_ === id) const panel = this.panels.find(({ id }) => id_ === id)
if (err.data.field) { if (err.data.name) {
this.errors[id_][err.data.field].message = err.message this.errors[id_][err.data.name].message = err.message
} else this.$set(panel, 'serverError', err.message) } else this.$set(panel, 'serverError', err.message)
}) })
}) })

View file

@ -117,8 +117,8 @@ export default {
this.$router.push({ name: 'app-list' }) this.$router.push({ name: 'app-list' })
}).catch(err => { }).catch(err => {
if (err.name !== 'APIBadRequestError') throw err if (err.name !== 'APIBadRequestError') throw err
if (err.data.field) { if (err.data.name) {
this.errors[err.data.field].message = err.message this.errors[err.data.name].message = err.message
} else this.serverError = err.message } else this.serverError = err.message
}) })
} }