fix: Fixes parsing issue with custom attributes (#2796)

* fix: Fixes parsing issue with custom attributes

* Update app/javascript/dashboard/routes/dashboard/conversation/ContactCustomAttributes.vue

Co-authored-by: शैलेश कळमकर (Shailesh Kalamkar) <shailesh.kalamkar@gmail.com>

Co-authored-by: Muhsin Keloth <muhsinkeramam@gmail.com>
Co-authored-by: शैलेश कळमकर (Shailesh Kalamkar) <shailesh.kalamkar@gmail.com>
Co-authored-by: Sojan Jose <sojan@pepalo.com>
This commit is contained in:
Nithin David Thomas 2021-08-13 13:37:51 +05:30 committed by GitHub
parent acb39cbc8f
commit 0f148f7700
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -45,9 +45,20 @@ export default {
},
methods: {
valueWithLink(attribute) {
const messageFormatter = new MessageFormatter(attribute);
const parsedAttribute = this.parseAttributeToString(attribute);
const messageFormatter = new MessageFormatter(parsedAttribute);
return messageFormatter.formattedMessage;
},
parseAttributeToString(attribute) {
switch (typeof attribute) {
case 'string':
return attribute;
case 'object':
return JSON.stringify(attribute);
default:
return `${attribute}`;
}
},
},
};
</script>