From 657f03bc67f84a8593b28483684c2ad8ad432865 Mon Sep 17 00:00:00 2001 From: Faton Ramadani Date: Tue, 6 Aug 2024 10:16:29 +0200 Subject: [PATCH] fix(frontend): fix the app created from a script or flow with the new topbar (#4194) --- .../components/details/createAppFromScript.ts | 294 +++++++++++++++++- 1 file changed, 290 insertions(+), 4 deletions(-) diff --git a/frontend/src/lib/components/details/createAppFromScript.ts b/frontend/src/lib/components/details/createAppFromScript.ts index 13054d4f0000c..52dd5d9caa17a 100644 --- a/frontend/src/lib/components/details/createAppFromScript.ts +++ b/frontend/src/lib/components/details/createAppFromScript.ts @@ -5,7 +5,7 @@ export function createAppFromScript(path: string, schema: Record | '3': { fixed: false, x: 0, - y: 0, + y: 2, w: 2, h: 8, fullHeight: false @@ -13,7 +13,7 @@ export function createAppFromScript(path: string, schema: Record | '12': { fixed: false, x: 0, - y: 0, + y: 2, w: 12, h: 21, fullHeight: false @@ -27,6 +27,38 @@ export function createAppFromScript(path: string, schema: Record | id: 'a' }, id: 'a' + }, + { + '3': { + fixed: false, + x: 0, + y: 8, + fullHeight: false, + w: 6, + h: 2 + }, + '12': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 12, + h: 2 + }, + data: { + type: 'containercomponent', + configuration: {}, + customCss: { + container: { + class: '!p-0', + style: '' + } + }, + actions: [], + numberOfSubgrids: 1, + id: 'g' + }, + id: 'g' } ], fullscreen: false, @@ -34,6 +66,7 @@ export function createAppFromScript(path: string, schema: Record | hiddenInlineScripts: [], css: {}, norefreshbar: false, + hideLegacyTopBar: true, subgrids: { 'a-0': [ { @@ -376,6 +409,116 @@ export function createAppFromScript(path: string, schema: Record | }, id: 'f' } + ], + 'g-0': [ + { + '3': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + '12': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + data: { + type: 'textcomponent', + configuration: { + style: { + type: 'static', + value: 'Body' + }, + copyButton: { + type: 'static', + value: false + }, + tooltip: { + type: 'evalv2', + value: '', + fieldType: 'text', + expr: '`Author: ${ctx.author}`', + connections: [ + { + componentId: 'ctx', + id: 'author' + } + ] + }, + disableNoText: { + type: 'static', + value: true, + fieldType: 'boolean' + } + }, + componentInput: { + type: 'templatev2', + fieldType: 'template', + eval: '${ctx.summary}', + connections: [ + { + id: 'summary', + componentId: 'ctx' + } + ] + }, + customCss: { + text: { + class: 'text-xl font-semibold whitespace-nowrap truncate', + style: '' + }, + container: { + class: '', + style: '' + } + }, + actions: [], + horizontalAlignment: 'left', + verticalAlignment: 'center', + id: 'h' + }, + id: 'h' + }, + { + '3': { + fixed: false, + x: 0, + y: 1, + fullHeight: false, + w: 3, + h: 1 + }, + '12': { + fixed: false, + x: 6, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + data: { + type: 'recomputeallcomponent', + configuration: {}, + customCss: { + container: { + style: '', + class: '' + } + }, + actions: [], + menuItems: [], + horizontalAlignment: 'right', + verticalAlignment: 'center', + id: 'i' + }, + id: 'i' + } ] } } @@ -424,7 +567,7 @@ export function createAppFromFlow(path: string, schema: Record | un '3': { fixed: false, x: 0, - y: 0, + y: 2, w: 2, h: 8, fullHeight: false @@ -432,7 +575,7 @@ export function createAppFromFlow(path: string, schema: Record | un '12': { fixed: false, x: 0, - y: 0, + y: 2, w: 12, h: 21, fullHeight: false @@ -446,6 +589,38 @@ export function createAppFromFlow(path: string, schema: Record | un id: 'a' }, id: 'a' + }, + { + '3': { + fixed: false, + x: 0, + y: 8, + fullHeight: false, + w: 6, + h: 2 + }, + '12': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 12, + h: 2 + }, + data: { + type: 'containercomponent', + configuration: {}, + customCss: { + container: { + class: '!p-0', + style: '' + } + }, + actions: [], + numberOfSubgrids: 1, + id: 'g' + }, + id: 'g' } ], fullscreen: false, @@ -453,6 +628,7 @@ export function createAppFromFlow(path: string, schema: Record | un hiddenInlineScripts: [], css: {}, norefreshbar: false, + hideLegacyTopBar: true, subgrids: { 'a-0': [ { @@ -796,6 +972,116 @@ export function createAppFromFlow(path: string, schema: Record | un }, id: 'f' } + ], + 'g-0': [ + { + '3': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + '12': { + fixed: false, + x: 0, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + data: { + type: 'textcomponent', + configuration: { + style: { + type: 'static', + value: 'Body' + }, + copyButton: { + type: 'static', + value: false + }, + tooltip: { + type: 'evalv2', + value: '', + fieldType: 'text', + expr: '`Author: ${ctx.author}`', + connections: [ + { + componentId: 'ctx', + id: 'author' + } + ] + }, + disableNoText: { + type: 'static', + value: true, + fieldType: 'boolean' + } + }, + componentInput: { + type: 'templatev2', + fieldType: 'template', + eval: '${ctx.summary}', + connections: [ + { + id: 'summary', + componentId: 'ctx' + } + ] + }, + customCss: { + text: { + class: 'text-xl font-semibold whitespace-nowrap truncate', + style: '' + }, + container: { + class: '', + style: '' + } + }, + actions: [], + horizontalAlignment: 'left', + verticalAlignment: 'center', + id: 'h' + }, + id: 'h' + }, + { + '3': { + fixed: false, + x: 0, + y: 1, + fullHeight: false, + w: 3, + h: 1 + }, + '12': { + fixed: false, + x: 6, + y: 0, + fullHeight: false, + w: 6, + h: 1 + }, + data: { + type: 'recomputeallcomponent', + configuration: {}, + customCss: { + container: { + style: '', + class: '' + } + }, + actions: [], + menuItems: [], + horizontalAlignment: 'right', + verticalAlignment: 'center', + id: 'i' + }, + id: 'i' + } ] } }