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:
committed by
GitHub
parent
acb39cbc8f
commit
0f148f7700
@@ -45,9 +45,20 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
valueWithLink(attribute) {
|
valueWithLink(attribute) {
|
||||||
const messageFormatter = new MessageFormatter(attribute);
|
const parsedAttribute = this.parseAttributeToString(attribute);
|
||||||
|
const messageFormatter = new MessageFormatter(parsedAttribute);
|
||||||
return messageFormatter.formattedMessage;
|
return messageFormatter.formattedMessage;
|
||||||
},
|
},
|
||||||
|
parseAttributeToString(attribute) {
|
||||||
|
switch (typeof attribute) {
|
||||||
|
case 'string':
|
||||||
|
return attribute;
|
||||||
|
case 'object':
|
||||||
|
return JSON.stringify(attribute);
|
||||||
|
default:
|
||||||
|
return `${attribute}`;
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user