From acea500fde740e8bffd19746b03ec3f837fa4924 Mon Sep 17 00:00:00 2001 From: Pietocha Date: Tue, 7 Jan 2025 09:41:55 +0100 Subject: [PATCH] Checking validity of the messsage --- src/components/Extensibility/components/Badge.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/Extensibility/components/Badge.js b/src/components/Extensibility/components/Badge.js index 3bf5f717e4..bd1aee44f3 100644 --- a/src/components/Extensibility/components/Badge.js +++ b/src/components/Extensibility/components/Badge.js @@ -38,6 +38,14 @@ export function Badge({ arrayItems, }); + const extractMessageAndCheckValidity = text => { + const messageArray = `${text}`.split('message'); + const message = messageArray[messageArray.length - 1]; + return message.includes('null') || message.includes('undefined') + ? '' + : text; + }; + const [tooltip, tooltipError] = jsonata(structure?.description); let type = null; @@ -78,7 +86,9 @@ export function Badge({ autoResolveType={!type} type={type} tooltipContent={ - tooltip && !tooltipError ? tooltip : structure.description + tooltip && !tooltipError + ? tooltip + : extractMessageAndCheckValidity(structure.description) } > {tExt(value)}