fix: Render valid urls only in custom attributes (#3921)

This commit is contained in:
Muhsin Keloth
2022-02-07 13:04:27 +05:30
committed by GitHub
parent 047070ad87
commit 9f37a6e2ba
5 changed files with 23 additions and 21 deletions

View File

@@ -63,7 +63,7 @@
rel="noopener noreferrer"
class="value"
>
{{ value || '---' }}
{{ urlValue }}
</a>
<p v-else class="value">
{{ displayValue || '---' }}
@@ -119,7 +119,7 @@ import format from 'date-fns/format';
import { required, url } from 'vuelidate/lib/validators';
import { BUS_EVENTS } from 'shared/constants/busEvents';
import MultiselectDropdown from 'shared/components/ui/MultiselectDropdown.vue';
import { isValidURL } from '../helper/URLHelper';
const DATE_FORMAT = 'yyyy-MM-dd';
export default {
@@ -184,6 +184,9 @@ export default {
isAttributeTypeDate() {
return this.attributeType === 'date';
},
urlValue() {
return isValidURL(this.value) ? this.value : '---';
},
notAttributeTypeCheckboxAndList() {
return !this.isAttributeTypeCheckbox && !this.isAttributeTypeList;
},