Skip to content

Commit

Permalink
chore: fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
BigJk committed Oct 27, 2024
1 parent 6c51d9f commit 91d6528
Show file tree
Hide file tree
Showing 21 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/config/multiple-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default {
checked: value.allowDuplicate,
onChange: (allowDuplicate: boolean) => attrs.onChange({ ...value, allowDuplicate }),
}),
]
]
: []), //
// @ts-ignore
!attrs.inEdit ? null : m(MiniHeader, 'Default'),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/editor/basic-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export default <T extends Object>(): m.Component<BasicInfoProps<T>> => ({
m('div.f6', attrs.info.name), //
m('div.f8.text-muted', `${attrs.info.author}/${attrs.info.slug}`),
]),
]),
]),
]),
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/editor/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export default (): m.Component<TemplateEditorProps> => {
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();
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/modals/additional-infos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ const AditionalInfos = (): m.Component<AdditionalInfosProps> => {
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,
]),
]),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/modals/file-browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ const fileBrowserModal = (): m.Component<FileBrowserProps> => {
},
},
'Select',
),
),
]),
],
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ const createEditGridButton = (props: CreateEditGridButtonProps) => (): m.Compone
state.element!.configName = e.target.value;
},
}),
)
)
: null,
m(
HorizontalProperty,
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/portal/spotlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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), //
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/js/ui/components/print-preview-template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,12 +181,12 @@ export default (): m.Component<PrintPreviewTemplateProps> => {
},
'',
),
)
)
: null,
]),
]),
),
)
)
: null,
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/components/view-layout/sidebar-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default (): m.Component<SidebarProps> => {
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]()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export default (): m.Component<SidebarPrintProps> => {
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]()),
Expand All @@ -65,7 +65,7 @@ export default (): m.Component<SidebarPrintProps> => {
className: `.bg-black-05.ph1.ba.b--black-10${!vnode.attrs.hidePreview ? '' : '.o-0'}`,
onRendered: vnode.attrs.onRendered,
onMessage: vnode.attrs.onMessage,
})
})
: m('div'),
]),
};
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/shoelace/modal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default (): m.Component<ModalProps> => ({
? 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,
]),
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/js/ui/views/data-source/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export default (): m.Component<SingleSourceProps> => {
{ content: 'Delete Entry' },
m(IconButton, { intend: 'error', size: 'sm', onClick: () => deleteEntry(attrs.id, item), icon: 'trash' }),
),
])
])
: null,
}),
},
Expand All @@ -311,7 +311,7 @@ export default (): m.Component<SingleSourceProps> => {
onClick: () => saveSelected(attrs.id),
},
'Save Change',
)
)
: null,
m(Monaco, {
className: '.z-0',
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/views/generator/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default (): m.Component<GeneratorCreateProps> => {
state = generator;
m.redraw();
},
})
})
: m(Loader),
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/views/generator/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export default (): m.Component<EditGeneratorProps> => {
lastRenderedHTML = html;
},
editMode: true,
})
})
: m(Loader),
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/views/generator/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ export default (): m.Component<SingleGeneratorProps> => {
),
),
),
])
])
: m('div.pv2.text-muted', 'No saved configs yet...'),
]),
buttonBar(),
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/js/ui/views/session-grid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ export default (): m.Component<SessionGridProps> => {
});
},
}),
]),
]),
]),
m(
Grid,
Expand Down Expand Up @@ -355,7 +355,7 @@ export default (): m.Component<SessionGridProps> => {
m(Icon, { icon: 'add-circle-outline', size: 3, className: '.o-30' }),
), //
],
), //
), //
],
),
]),
Expand All @@ -366,7 +366,7 @@ export default (): m.Component<SessionGridProps> => {
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,
];
};
Expand Down Expand Up @@ -414,14 +414,14 @@ export default (): m.Component<SessionGridProps> => {
},
}),
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,
]),
},
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/js/ui/views/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ export default (): m.Component => {
settingsCopy = { ...settingsCopy, aiModel: e.value };
},
}),
),
),
!settingsCopy.aiProvider.startsWith('Custom')
? null
: [
Expand Down Expand Up @@ -402,7 +402,7 @@ export default (): m.Component => {
},
}),
),
],
],
]),
//
// Cache
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/js/ui/views/template/create-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ export default (): m.Component<CreateTemplateEntityProps> => {
value: state.id,
onChange: (val) => (state.id = val),
}),
),
),
]),
},
...Object.keys(cats).map((c) => ({
Expand All @@ -285,7 +285,7 @@ export default (): m.Component<CreateTemplateEntityProps> => {
c === 'Global'
? m(EditorHeader, {
title: c,
})
})
: null,
cats[c].map((n: SchemaNode) => renderObject(state.data, [n.key])),
]),
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/views/template/edit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export default (): m.Component<EditTemplateProps> => {
lastRenderedHTML = html;
},
editMode: true,
})
})
: m(Loader),
);
},
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/js/ui/views/template/single.ts
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export default (): m.Component<SingleTemplateProps> => {
},
}),
),
])
])
: null,
});
};
Expand Down Expand Up @@ -321,7 +321,7 @@ export default (): m.Component<SingleTemplateProps> => {
},
state.template
? // @ts-ignore
m(SidebarPrintPage, {
m(SidebarPrintPage, {
template: state.template,
it: state.selectedEntry?.data,
entry: state.selectedEntry,
Expand Down Expand Up @@ -395,7 +395,7 @@ export default (): m.Component<SingleTemplateProps> => {
},
'Save',
),
]
]
: null,
),
]),
Expand Down Expand Up @@ -439,7 +439,7 @@ export default (): m.Component<SingleTemplateProps> => {
},
'Save',
),
]
]
: null,
),
]),
Expand All @@ -453,7 +453,7 @@ export default (): m.Component<SingleTemplateProps> => {
? [
m('div.f5.mb2.b.mt3', 'Copyright Notice'),
m('div', { style: { whiteSpace: 'break-spaces' } }, state.template.copyrightNotice),
]
]
: []),
]),
Config: () =>
Expand All @@ -467,7 +467,7 @@ export default (): m.Component<SingleTemplateProps> => {
}),
//'Advanced Filter': () => m('div.pa3', 'Coming back soon...'),
},
})
})
: null,
);
},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/js/ui/views/workshop/repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ export default (): m.Component<WorkshopRepoProps> => {
exists(p) ? 'Re-Download' : 'Download',
),
),
),
),
),
]);

Expand Down

0 comments on commit 91d6528

Please sign in to comment.