Skip to content

Commit

Permalink
fix(frontend): fix the app created from a script or flow with the new…
Browse files Browse the repository at this point in the history
… topbar (windmill-labs#4194)
  • Loading branch information
fatonramadani authored Aug 6, 2024
1 parent fbcac1e commit 657f03b
Showing 1 changed file with 290 additions and 4 deletions.
294 changes: 290 additions & 4 deletions frontend/src/lib/components/details/createAppFromScript.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ export function createAppFromScript(path: string, schema: Record<string, any> |
'3': {
fixed: false,
x: 0,
y: 0,
y: 2,
w: 2,
h: 8,
fullHeight: false
},
'12': {
fixed: false,
x: 0,
y: 0,
y: 2,
w: 12,
h: 21,
fullHeight: false
Expand All @@ -27,13 +27,46 @@ export function createAppFromScript(path: string, schema: Record<string, any> |
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,
unusedInlineScripts: [],
hiddenInlineScripts: [],
css: {},
norefreshbar: false,
hideLegacyTopBar: true,
subgrids: {
'a-0': [
{
Expand Down Expand Up @@ -376,6 +409,116 @@ export function createAppFromScript(path: string, schema: Record<string, any> |
},
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'
}
]
}
}
Expand Down Expand Up @@ -424,15 +567,15 @@ export function createAppFromFlow(path: string, schema: Record<string, any> | un
'3': {
fixed: false,
x: 0,
y: 0,
y: 2,
w: 2,
h: 8,
fullHeight: false
},
'12': {
fixed: false,
x: 0,
y: 0,
y: 2,
w: 12,
h: 21,
fullHeight: false
Expand All @@ -446,13 +589,46 @@ export function createAppFromFlow(path: string, schema: Record<string, any> | 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,
unusedInlineScripts: [],
hiddenInlineScripts: [],
css: {},
norefreshbar: false,
hideLegacyTopBar: true,
subgrids: {
'a-0': [
{
Expand Down Expand Up @@ -796,6 +972,116 @@ export function createAppFromFlow(path: string, schema: Record<string, any> | 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'
}
]
}
}
Expand Down

0 comments on commit 657f03b

Please sign in to comment.