From efaaebd29924453fa56ca4a154a3a145d6fcb569 Mon Sep 17 00:00:00 2001 From: Alexander Petric Date: Thu, 3 Apr 2025 15:25:34 -0400 Subject: [PATCH] fix(frontend): app builder - force json configuration in rich result (#5565) --- .../display/AppDisplayComponent.svelte | 1 + .../display/AppDisplayComponentByJobId.svelte | 1 + .../apps/editor/component/components.ts | 20 +++++++++++++++---- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte b/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte index c15855f873..114e349ce7 100644 --- a/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte +++ b/frontend/src/lib/components/apps/components/display/AppDisplayComponent.svelte @@ -98,6 +98,7 @@ {requireHtmlApproval} disableExpand={resolvedConfig?.hideDetails} appPath={$userStore ? undefined : $appPath} + forceJson={resolvedConfig?.forceJson} /> diff --git a/frontend/src/lib/components/apps/components/display/AppDisplayComponentByJobId.svelte b/frontend/src/lib/components/apps/components/display/AppDisplayComponentByJobId.svelte index f61db83517..3cb0db01a3 100644 --- a/frontend/src/lib/components/apps/components/display/AppDisplayComponentByJobId.svelte +++ b/frontend/src/lib/components/apps/components/display/AppDisplayComponentByJobId.svelte @@ -117,6 +117,7 @@ {requireHtmlApproval} disableExpand={resolvedConfig?.hideDetails} appPath={$userStore ? undefined : $appPath} + forceJson={resolvedConfig?.forceJson} /> diff --git a/frontend/src/lib/components/apps/editor/component/components.ts b/frontend/src/lib/components/apps/editor/component/components.ts index c073ca3691..2344b57947 100644 --- a/frontend/src/lib/components/apps/editor/component/components.ts +++ b/frontend/src/lib/components/apps/editor/component/components.ts @@ -963,6 +963,12 @@ export const components = { value: false, tooltip: 'Hide the details section: the object keys, the clipboard button and the maximise button' + }, + forceJson: { + type: 'static', + fieldType: 'boolean', + value: false, + tooltip: 'Force the result to be displayed as JSON' } } } @@ -1644,9 +1650,9 @@ Hello \${ctx.username} type: 'templatev2', fieldType: 'template', eval: `# This is a header -## This is a subheader +## This is a subheader This is a paragraph. - + * This is a list * With two items`, connections: [] as InputConnectionEval[] @@ -2680,7 +2686,7 @@ This is a paragraph. type: 'static', value: 'yyyy-MM-dd', fieldType: 'text', - markdownTooltip: `### Output format + markdownTooltip: `### Output format See date-fns format for more information. By default, it is 'yyyy-MM-dd' | Format | Result | Description | @@ -2737,7 +2743,7 @@ See date-fns format for more information. By default, it is 'yyyy-MM-dd' fieldType: 'text', documentationLink: 'https://date-fns.org/v2.30.0/docs/format', placeholder: 'dd.MM.yyyy HH:mm', - markdownTooltip: `### Output format + markdownTooltip: `### Output format See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm' | Format | Result | Description | @@ -4153,6 +4159,12 @@ See date-fns format for more information. By default, it is 'dd.MM.yyyy HH:mm' value: false, tooltip: 'Hide the details section: the object keys, the clipboard button and the maximise button' + }, + forceJson: { + type: 'static', + fieldType: 'boolean', + value: false, + tooltip: 'Force the result to be displayed as JSON' } } }