diff --git a/frontend/src/js/ui/components/config/multiple-options.ts b/frontend/src/js/ui/components/config/multiple-options.ts index 5c7223c..8be651a 100644 --- a/frontend/src/js/ui/components/config/multiple-options.ts +++ b/frontend/src/js/ui/components/config/multiple-options.ts @@ -38,7 +38,7 @@ export default { checked: value.allowDuplicate, onChange: (allowDuplicate: boolean) => attrs.onChange({ ...value, allowDuplicate }), }), - ] + ] : []), // // @ts-ignore !attrs.inEdit ? null : m(MiniHeader, 'Default'), diff --git a/frontend/src/js/ui/components/editor/basic-info.ts b/frontend/src/js/ui/components/editor/basic-info.ts index 4503be1..171560d 100644 --- a/frontend/src/js/ui/components/editor/basic-info.ts +++ b/frontend/src/js/ui/components/editor/basic-info.ts @@ -77,7 +77,7 @@ export default (): m.Component> => ({ m('div.f6', attrs.info.name), // m('div.f8.text-muted', `${attrs.info.author}/${attrs.info.slug}`), ]), - ]), + ]), ]), ); }, diff --git a/frontend/src/js/ui/components/editor/template.ts b/frontend/src/js/ui/components/editor/template.ts index cab9fef..bc70be2 100644 --- a/frontend/src/js/ui/components/editor/template.ts +++ b/frontend/src/js/ui/components/editor/template.ts @@ -287,7 +287,7 @@ export default (): m.Component => { m(EditorHeader, { title: 'Test Config', description: 'Setup a temporary config for testing the template' }), m(Editor, { current: fillConfigValues(state.config, attrs.template?.config ?? []), - definition: [...(attrs.template ? attrs.template.config ?? [] : [])], + definition: [...(attrs.template ? (attrs.template.config ?? []) : [])], onChange: (updated) => { state.config = updated; m.redraw(); diff --git a/frontend/src/js/ui/components/modals/additional-infos.ts b/frontend/src/js/ui/components/modals/additional-infos.ts index 89d22f8..7e0064b 100644 --- a/frontend/src/js/ui/components/modals/additional-infos.ts +++ b/frontend/src/js/ui/components/modals/additional-infos.ts @@ -89,7 +89,7 @@ const AditionalInfos = (): m.Component => { m('div.f5.b', 'Config'), m('div', `This is the current config you selected in the ${attrs.type}.`), m(TextArea, { value: JSON.stringify(attrs.config, null, '\t'), rows: 8 }), - ]) + ]) : null, ]), ]), diff --git a/frontend/src/js/ui/components/modals/file-browser.ts b/frontend/src/js/ui/components/modals/file-browser.ts index 89def69..4066900 100644 --- a/frontend/src/js/ui/components/modals/file-browser.ts +++ b/frontend/src/js/ui/components/modals/file-browser.ts @@ -285,7 +285,7 @@ const fileBrowserModal = (): m.Component => { }, }, 'Select', - ), + ), ]), ], ); diff --git a/frontend/src/js/ui/components/modals/session-grid/create-edit-grid-button.ts b/frontend/src/js/ui/components/modals/session-grid/create-edit-grid-button.ts index 8b1784c..1d28b00 100644 --- a/frontend/src/js/ui/components/modals/session-grid/create-edit-grid-button.ts +++ b/frontend/src/js/ui/components/modals/session-grid/create-edit-grid-button.ts @@ -226,7 +226,7 @@ const createEditGridButton = (props: CreateEditGridButtonProps) => (): m.Compone state.element!.configName = e.target.value; }, }), - ) + ) : null, m( HorizontalProperty, diff --git a/frontend/src/js/ui/components/portal/spotlight.ts b/frontend/src/js/ui/components/portal/spotlight.ts index 0c6b558..b884de8 100644 --- a/frontend/src/js/ui/components/portal/spotlight.ts +++ b/frontend/src/js/ui/components/portal/spotlight.ts @@ -106,7 +106,7 @@ export default (): m.Component => { m( Flex, { className: `.w2.h2.br2.white.mr2${itemBackground(item.item.type)}`, items: 'center', justify: 'center' }, - m(Icon, { icon: item.item.type != 'operation' ? icons[item.item.type] : item.item.operation?.icon ?? '', size: 5 }), + m(Icon, { icon: item.item.type != 'operation' ? icons[item.item.type] : (item.item.operation?.icon ?? ''), size: 5 }), ), // m('div', [ m('div.b', name), // diff --git a/frontend/src/js/ui/components/print-preview-template.ts b/frontend/src/js/ui/components/print-preview-template.ts index e796d77..2f31fe0 100644 --- a/frontend/src/js/ui/components/print-preview-template.ts +++ b/frontend/src/js/ui/components/print-preview-template.ts @@ -181,12 +181,12 @@ export default (): m.Component => { }, '', ), - ) + ) : null, ]), ]), ), - ) + ) : null, ); }, diff --git a/frontend/src/js/ui/components/view-layout/sidebar-page.ts b/frontend/src/js/ui/components/view-layout/sidebar-page.ts index f4d8caf..abdbdd0 100644 --- a/frontend/src/js/ui/components/view-layout/sidebar-page.ts +++ b/frontend/src/js/ui/components/view-layout/sidebar-page.ts @@ -37,7 +37,7 @@ export default (): m.Component => { return leftElement(tab.icon, tab.label, selectedTab === tab.label, () => (selectedTab = tab.label)); }), ]), - ) + ) : null, // // @ts-ignore m(Flex, { className: '.bg-white.ba.b--black-10.br2.flex-grow-1.overflow-auto', direction: 'column' }, attrs.content[selectedTab]()), diff --git a/frontend/src/js/ui/components/view-layout/sidebar-print-page.ts b/frontend/src/js/ui/components/view-layout/sidebar-print-page.ts index 87c58b2..93ce327 100644 --- a/frontend/src/js/ui/components/view-layout/sidebar-print-page.ts +++ b/frontend/src/js/ui/components/view-layout/sidebar-print-page.ts @@ -50,7 +50,7 @@ export default (): m.Component => { return leftElement(tab.icon, tab.label, selectedTab === tab.label, () => (selectedTab = tab.label)); }), ]), - ) + ) : null, // // @ts-ignore m(Flex, { className: '.bg-white.ba.b--black-10.br2.flex-grow-1.overflow-auto', direction: 'column' }, vnode.attrs.content[selectedTab]()), @@ -65,7 +65,7 @@ export default (): m.Component => { className: `.bg-black-05.ph1.ba.b--black-10${!vnode.attrs.hidePreview ? '' : '.o-0'}`, onRendered: vnode.attrs.onRendered, onMessage: vnode.attrs.onMessage, - }) + }) : m('div'), ]), }; diff --git a/frontend/src/js/ui/shoelace/modal.ts b/frontend/src/js/ui/shoelace/modal.ts index 0e9165d..d9304bd 100644 --- a/frontend/src/js/ui/shoelace/modal.ts +++ b/frontend/src/js/ui/shoelace/modal.ts @@ -38,7 +38,7 @@ export default (): m.Component => ({ ? m(Flex, { className: '.bg-white-80.absolute.left-0.top-0.w-100.h-100.z-5', justify: 'center', items: 'center', direction: 'column' }, [ m(Loader), attrs.loadingMessage ? m('div.f8.text-muted.mt2', attrs.loadingMessage) : null, - ]) + ]) : null, children, ]), diff --git a/frontend/src/js/ui/views/data-source/single.ts b/frontend/src/js/ui/views/data-source/single.ts index dea39b6..518c63f 100644 --- a/frontend/src/js/ui/views/data-source/single.ts +++ b/frontend/src/js/ui/views/data-source/single.ts @@ -286,7 +286,7 @@ export default (): m.Component => { { content: 'Delete Entry' }, m(IconButton, { intend: 'error', size: 'sm', onClick: () => deleteEntry(attrs.id, item), icon: 'trash' }), ), - ]) + ]) : null, }), }, @@ -311,7 +311,7 @@ export default (): m.Component => { onClick: () => saveSelected(attrs.id), }, 'Save Change', - ) + ) : null, m(Monaco, { className: '.z-0', diff --git a/frontend/src/js/ui/views/generator/create.ts b/frontend/src/js/ui/views/generator/create.ts index 8f0006c..423e6a4 100644 --- a/frontend/src/js/ui/views/generator/create.ts +++ b/frontend/src/js/ui/views/generator/create.ts @@ -90,7 +90,7 @@ export default (): m.Component => { state = generator; m.redraw(); }, - }) + }) : m(Loader), ); }, diff --git a/frontend/src/js/ui/views/generator/edit.ts b/frontend/src/js/ui/views/generator/edit.ts index 895b412..b38d9a5 100644 --- a/frontend/src/js/ui/views/generator/edit.ts +++ b/frontend/src/js/ui/views/generator/edit.ts @@ -111,7 +111,7 @@ export default (): m.Component => { lastRenderedHTML = html; }, editMode: true, - }) + }) : m(Loader), ); }, diff --git a/frontend/src/js/ui/views/generator/single.ts b/frontend/src/js/ui/views/generator/single.ts index 11b7e81..2a5ba64 100644 --- a/frontend/src/js/ui/views/generator/single.ts +++ b/frontend/src/js/ui/views/generator/single.ts @@ -309,7 +309,7 @@ export default (): m.Component => { ), ), ), - ]) + ]) : m('div.pv2.text-muted', 'No saved configs yet...'), ]), buttonBar(), diff --git a/frontend/src/js/ui/views/session-grid.ts b/frontend/src/js/ui/views/session-grid.ts index 040029c..5a48c83 100644 --- a/frontend/src/js/ui/views/session-grid.ts +++ b/frontend/src/js/ui/views/session-grid.ts @@ -282,7 +282,7 @@ export default (): m.Component => { }); }, }), - ]), + ]), ]), m( Grid, @@ -355,7 +355,7 @@ export default (): m.Component => { m(Icon, { icon: 'add-circle-outline', size: 3, className: '.o-30' }), ), // ], - ), // + ), // ], ), ]), @@ -366,7 +366,7 @@ export default (): m.Component => { m('div.flex-grow-1.bb.b--black-10'), m(Icon, { icon: 'add-circle-outline', size: 6, className: '.o-30.pointer.grow' }), m('div.flex-grow-1.bb.b--black-10'), - ]) + ]) : null, ]; }; @@ -414,14 +414,14 @@ export default (): m.Component => { }, }), m(DividerVert, { noSpacing: true, className: '.ml3.mr2' }), - ] + ] : null, m(IconButton, { icon: 'add-circle-outline', intend: 'link', onClick: () => createNew() }, 'Create'), state.playMode ? [ m(DividerVert, { noSpacing: true, className: '.mr3' }), m(IconButton, { icon: 'close', onClick: () => (state.playMode = false) }, 'End Play-Mode'), - ] + ] : null, ]), }, diff --git a/frontend/src/js/ui/views/settings.ts b/frontend/src/js/ui/views/settings.ts index beb2a1d..0dc67bb 100644 --- a/frontend/src/js/ui/views/settings.ts +++ b/frontend/src/js/ui/views/settings.ts @@ -367,7 +367,7 @@ export default (): m.Component => { settingsCopy = { ...settingsCopy, aiModel: e.value }; }, }), - ), + ), !settingsCopy.aiProvider.startsWith('Custom') ? null : [ @@ -402,7 +402,7 @@ export default (): m.Component => { }, }), ), - ], + ], ]), // // Cache diff --git a/frontend/src/js/ui/views/template/create-entity.ts b/frontend/src/js/ui/views/template/create-entity.ts index 21faa99..4b9be92 100644 --- a/frontend/src/js/ui/views/template/create-entity.ts +++ b/frontend/src/js/ui/views/template/create-entity.ts @@ -272,7 +272,7 @@ export default (): m.Component => { value: state.id, onChange: (val) => (state.id = val), }), - ), + ), ]), }, ...Object.keys(cats).map((c) => ({ @@ -285,7 +285,7 @@ export default (): m.Component => { c === 'Global' ? m(EditorHeader, { title: c, - }) + }) : null, cats[c].map((n: SchemaNode) => renderObject(state.data, [n.key])), ]), diff --git a/frontend/src/js/ui/views/template/edit.ts b/frontend/src/js/ui/views/template/edit.ts index 284e0aa..0e2bded 100644 --- a/frontend/src/js/ui/views/template/edit.ts +++ b/frontend/src/js/ui/views/template/edit.ts @@ -116,7 +116,7 @@ export default (): m.Component => { lastRenderedHTML = html; }, editMode: true, - }) + }) : m(Loader), ); }, diff --git a/frontend/src/js/ui/views/template/single.ts b/frontend/src/js/ui/views/template/single.ts index 9561dce..151ea03 100644 --- a/frontend/src/js/ui/views/template/single.ts +++ b/frontend/src/js/ui/views/template/single.ts @@ -251,7 +251,7 @@ export default (): m.Component => { }, }), ), - ]) + ]) : null, }); }; @@ -321,7 +321,7 @@ export default (): m.Component => { }, state.template ? // @ts-ignore - m(SidebarPrintPage, { + m(SidebarPrintPage, { template: state.template, it: state.selectedEntry?.data, entry: state.selectedEntry, @@ -395,7 +395,7 @@ export default (): m.Component => { }, 'Save', ), - ] + ] : null, ), ]), @@ -439,7 +439,7 @@ export default (): m.Component => { }, 'Save', ), - ] + ] : null, ), ]), @@ -453,7 +453,7 @@ export default (): m.Component => { ? [ m('div.f5.mb2.b.mt3', 'Copyright Notice'), m('div', { style: { whiteSpace: 'break-spaces' } }, state.template.copyrightNotice), - ] + ] : []), ]), Config: () => @@ -467,7 +467,7 @@ export default (): m.Component => { }), //'Advanced Filter': () => m('div.pa3', 'Coming back soon...'), }, - }) + }) : null, ); }, diff --git a/frontend/src/js/ui/views/workshop/repo.ts b/frontend/src/js/ui/views/workshop/repo.ts index fb68ce2..cfa268b 100644 --- a/frontend/src/js/ui/views/workshop/repo.ts +++ b/frontend/src/js/ui/views/workshop/repo.ts @@ -300,7 +300,7 @@ export default (): m.Component => { exists(p) ? 'Re-Download' : 'Download', ), ), - ), + ), ), ]);