feat: Show links for custom attributes (#2723)

This commit is contained in:
Nithin David Thomas 2021-07-28 21:36:35 +05:30 committed by GitHub
parent 223385d134
commit 8f30abb98b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 4 deletions

View file

@ -14,7 +14,7 @@
{{ attribute }} {{ attribute }}
</div> </div>
<div> <div>
{{ customAttributes[attribute] }} <span v-html="valueWithLink(customAttributes[attribute])"></span>
</div> </div>
</div> </div>
</div> </div>
@ -22,11 +22,13 @@
<script> <script>
import ContactDetailsItem from './ContactDetailsItem.vue'; import ContactDetailsItem from './ContactDetailsItem.vue';
import MessageFormatter from 'shared/helpers/MessageFormatter.js';
export default { export default {
components: { components: {
ContactDetailsItem, ContactDetailsItem,
}, },
props: { props: {
customAttributes: { customAttributes: {
type: Object, type: Object,
@ -41,6 +43,12 @@ export default {
}); });
}, },
}, },
methods: {
valueWithLink(attribute) {
const messageFormatter = new MessageFormatter(attribute);
return messageFormatter.formattedMessage;
},
},
}; };
</script> </script>

View file

@ -195,9 +195,8 @@ export default {
return this.additionalAttributes.initiated_at; return this.additionalAttributes.initiated_at;
}, },
browserName() { browserName() {
return `${this.browser.browser_name || ''} ${ return `${this.browser.browser_name || ''} ${this.browser
this.browser.browser_version || '' .browser_version || ''}`;
}`;
}, },
contactAdditionalAttributes() { contactAdditionalAttributes() {
return this.contact.additional_attributes || {}; return this.contact.additional_attributes || {};