mirror of
https://github.com/YunoHost/yunohost-admin.git
synced 2024-09-03 20:06:15 +02:00
[enh] Improve UX in validation
This commit is contained in:
parent
b9b0dd906f
commit
abfd018a46
6 changed files with 9 additions and 8 deletions
|
@ -46,12 +46,12 @@ export default {
|
|||
|
||||
computed: {
|
||||
disabled () {
|
||||
return this.validation ? this.validation.$invalid : false
|
||||
return false // this.validation ? this.validation.$invalid : false
|
||||
},
|
||||
errorFeedback () {
|
||||
if (this.serverError) return this.serverError
|
||||
else if (this.validation && this.validation.$invalid) {
|
||||
return this.$t('invalid_form')
|
||||
else if (this.validation && this.validation.$anyError) {
|
||||
return this.$i18n.t('form_errors.invalid_form')
|
||||
} else return ''
|
||||
}
|
||||
},
|
||||
|
|
|
@ -2,7 +2,8 @@
|
|||
<b-alert :variant="type" show>
|
||||
<icon :iname="icon_" />
|
||||
<vue-showdown :markdown="label" flavor="github"
|
||||
tag="span" class="markdown" />
|
||||
tag="span" class="markdown"
|
||||
/>
|
||||
</b-alert>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ export function formatYunoHostArgument (arg) {
|
|||
if (!isNaN(parseInt(arg.max))) {
|
||||
validation.maxValue = validators.maxValue(parseInt(arg.max))
|
||||
}
|
||||
validation.numValue = validators.numeric
|
||||
validation.numValue = validators.helpers.regex('Please provide an integer', new RegExp('^-?[0-9]+$'))
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
|
@ -183,7 +183,8 @@
|
|||
"passwordMatch": "Passwords don't match.",
|
||||
"required": "Field is required.",
|
||||
"remote": "{message}",
|
||||
"pattern": "{type}"
|
||||
"pattern": "{type}",
|
||||
"invalid_form": "The form contains some errors."
|
||||
},
|
||||
"form_input_example": "Example: {example}",
|
||||
"from_to": "from {0} to {1}",
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
<icon iname="download" /> {{ $t('users_export') }}
|
||||
</b-dropdown-item>
|
||||
</b-dropdown>
|
||||
|
||||
</template>
|
||||
|
||||
<b-list-group>
|
||||
|
|
Loading…
Reference in a new issue