From 00143f7ee5080f360d76c6b3c6b5f17b52efc509 Mon Sep 17 00:00:00 2001 From: Muhsin Keloth Date: Wed, 24 Nov 2021 11:02:45 +0530 Subject: [PATCH] fix: Render checkbox if string value passed (#3453) --- .../dashboard/components/CustomAttribute.vue | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/app/javascript/dashboard/components/CustomAttribute.vue b/app/javascript/dashboard/components/CustomAttribute.vue index b11350d2d..a1dad74c4 100644 --- a/app/javascript/dashboard/components/CustomAttribute.vue +++ b/app/javascript/dashboard/components/CustomAttribute.vue @@ -66,7 +66,7 @@ {{ value || '---' }}

- {{ formattedValue || '---' }} + {{ displayValue || '---' }}

({ id: index + 1, @@ -175,6 +181,9 @@ export default { isAttributeTypeLink() { return this.attributeType === 'link'; }, + isAttributeTypeDate() { + return this.attributeType === 'date'; + }, notAttributeTypeCheckboxAndList() { return !this.isAttributeTypeCheckbox && !this.isAttributeTypeList; }, @@ -190,7 +199,7 @@ export default { } return this.$t('CUSTOM_ATTRIBUTES.VALIDATIONS.REQUIRED'); }, - formattedValue() { + displayValue() { if (this.attributeType === 'date') { return format(new Date(this.editedValue), 'dd-MM-yyyy'); } @@ -198,6 +207,7 @@ export default { }, }, mounted() { + this.editedValue = this.formattedValue; bus.$on(BUS_EVENTS.FOCUS_CUSTOM_ATTRIBUTE, focusAttributeKey => { if (this.attributeKey === focusAttributeKey) { this.onEdit();