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

View file

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