From 331698b11fe75ca3605cffa2d02f638885af1321 Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Sat, 8 May 2021 17:13:28 +0200 Subject: [PATCH] Documents Fix status default value --- .../components/documents/ResourceLinkForm.vue | 35 +++++-------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/assets/vue/components/documents/ResourceLinkForm.vue b/assets/vue/components/documents/ResourceLinkForm.vue index 5b2ef781e5..d8de771330 100644 --- a/assets/vue/components/documents/ResourceLinkForm.vue +++ b/assets/vue/components/documents/ResourceLinkForm.vue @@ -19,11 +19,12 @@ @@ -38,7 +39,11 @@ import { required } from '@vuelidate/validators'; export default { name: 'ResourceLinkForm', setup () { - return { v$: useVuelidate() } + const visibilityList = [ + {value: 2, label: 'Published'}, + {value: 0, label: 'Draft'}, + ]; + return {v$: useVuelidate(), visibilityList}; }, props: { values: { @@ -54,34 +59,10 @@ export default { default: () => {} }, }, - data() { - return { - // See ResourceLink entity constants. - visibilityList: [ - {value: 2, label: 'Published'}, - {value: 0, label: 'Draft'}, - ], - }; - }, computed: { item() { return this.initialValues || this.values; }, - titleErrors() { - const errors = []; - if (!this.$v.item.title.$dirty) return errors; - has(this.violations, 'title') && errors.push(this.violations.title); - !this.$v.item.title.required && errors.push(this.$t('Field is required')); - - return errors; - }, - violations() { - return this.errors || {}; - } }, - validations: { - item: { - } - } };