diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a68b00674..b185d4f7d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,6 +33,9 @@ jobs: run: pnpm install --frozen-lockfile # Run code quality + - name: Run formatter + run: pnpm format:check + - name: Run linter run: pnpm lint diff --git a/apps/client/src/common/api/customViews.ts b/apps/client/src/common/api/customViews.ts index 5a917263b..aaef2d22f 100644 --- a/apps/client/src/common/api/customViews.ts +++ b/apps/client/src/common/api/customViews.ts @@ -9,11 +9,10 @@ import { downloadBlob } from './utils'; const customViewsPath = `${apiEntryUrl}/custom-views`; export async function getCustomViews(options?: RequestOptions): Promise { - const response = - await axios.get(customViewsPath, { - signal: options?.signal, - timeout: options?.timeout ?? axiosConfig.shortTimeout, - }) + const response = await axios.get(customViewsPath, { + signal: options?.signal, + timeout: options?.timeout ?? axiosConfig.shortTimeout, + }); return response.data; } diff --git a/apps/client/src/common/hooks-query/useCssOverride.ts b/apps/client/src/common/hooks-query/useCssOverride.ts index 0ee332362..e8b946504 100644 --- a/apps/client/src/common/hooks-query/useCssOverride.ts +++ b/apps/client/src/common/hooks-query/useCssOverride.ts @@ -9,10 +9,11 @@ export default function useCssOverride(enabled: boolean) { queryKey: CSS_OVERRIDE, queryFn: ({ signal }) => getCSSContents({ signal }), staleTime: MILLIS_PER_HOUR, - enabled + enabled, }); return { - data: data ?? '', status + data: data ?? '', + status, }; } diff --git a/apps/client/src/features/app-settings/panel-utils/PanelUtils.tsx b/apps/client/src/features/app-settings/panel-utils/PanelUtils.tsx index a47e52dab..ebc996df1 100644 --- a/apps/client/src/features/app-settings/panel-utils/PanelUtils.tsx +++ b/apps/client/src/features/app-settings/panel-utils/PanelUtils.tsx @@ -105,13 +105,7 @@ export function Field({ ); } -export function Description({ - children, - tone = 'default', -}: { - children: ReactNode; - tone?: 'default' | 'warning'; -}) { +export function Description({ children, tone = 'default' }: { children: ReactNode; tone?: 'default' | 'warning' }) { return
{children}
; } diff --git a/apps/client/src/features/app-settings/panel/automations-panel/AutomationsList.tsx b/apps/client/src/features/app-settings/panel/automations-panel/AutomationsList.tsx index 7da9aa484..3da03d80a 100644 --- a/apps/client/src/features/app-settings/panel/automations-panel/AutomationsList.tsx +++ b/apps/client/src/features/app-settings/panel/automations-panel/AutomationsList.tsx @@ -5,8 +5,8 @@ import { IoAdd, IoPencil, IoTrash } from 'react-icons/io5'; import { deleteAutomation } from '../../../../common/api/automation'; import { maybeAxiosError } from '../../../../common/api/utils'; import Button from '../../../../common/components/buttons/Button'; -import Info from '../../../../common/components/info/Info'; import IconButton from '../../../../common/components/buttons/IconButton'; +import Info from '../../../../common/components/info/Info'; import Tag from '../../../../common/components/tag/Tag'; import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings'; import * as Panel from '../../panel-utils/PanelUtils'; diff --git a/apps/client/src/features/app-settings/panel/automations-panel/TriggersList.tsx b/apps/client/src/features/app-settings/panel/automations-panel/TriggersList.tsx index b77bf8633..5fa132a45 100644 --- a/apps/client/src/features/app-settings/panel/automations-panel/TriggersList.tsx +++ b/apps/client/src/features/app-settings/panel/automations-panel/TriggersList.tsx @@ -55,7 +55,9 @@ export default function TriggersList(props: TriggersListProps) { {enabledAutomations === false && ( - Automations are disabled. You can still manage triggers here, but they will not run until enabled. + + Automations are disabled. You can still manage triggers here, but they will not run until enabled. + )} {duplicates && ( diff --git a/apps/client/src/features/app-settings/panel/manage-panel/CustomViews.tsx b/apps/client/src/features/app-settings/panel/manage-panel/CustomViews.tsx index 5412e2d10..328a7e08f 100644 --- a/apps/client/src/features/app-settings/panel/manage-panel/CustomViews.tsx +++ b/apps/client/src/features/app-settings/panel/manage-panel/CustomViews.tsx @@ -9,8 +9,8 @@ import ExternalLink from '../../../../common/components/link/external-link/Exter import useCustomViews from '../../../../common/hooks-query/useCustomViews'; import * as Panel from '../../panel-utils/PanelUtils'; import CustomViewForm from './CustomViewForm'; -import CustomViewsList from './CustomViewsList'; import { customViewsDocs } from './customViews.utils'; +import CustomViewsList from './CustomViewsList'; export default function CustomViews() { const { data, refetch, status } = useCustomViews(); @@ -72,7 +72,6 @@ export default function CustomViews() { onMutate={() => refetch()} onError={setActionError} /> - diff --git a/apps/client/src/features/app-settings/panel/manage-panel/CustomViewsList.tsx b/apps/client/src/features/app-settings/panel/manage-panel/CustomViewsList.tsx index c43ec6dac..3336f2209 100644 --- a/apps/client/src/features/app-settings/panel/manage-panel/CustomViewsList.tsx +++ b/apps/client/src/features/app-settings/panel/manage-panel/CustomViewsList.tsx @@ -25,13 +25,7 @@ export default function CustomViewsList({ views, onOpenUpload, onMutate, onError {views.length === 0 && } {views.map((view, index) => ( - + ))} diff --git a/apps/client/src/features/app-settings/panel/settings-panel/composite/StyleEditor.tsx b/apps/client/src/features/app-settings/panel/settings-panel/composite/StyleEditor.tsx index a175ca43e..3e12b0081 100644 --- a/apps/client/src/features/app-settings/panel/settings-panel/composite/StyleEditor.tsx +++ b/apps/client/src/features/app-settings/panel/settings-panel/composite/StyleEditor.tsx @@ -1,9 +1,8 @@ -import Prism from 'virtual:prismjs'; import { memo } from 'react'; import Editor from 'react-simple-code-editor'; +import Prism from 'virtual:prismjs'; import 'prismjs/components/prism-css'; import 'prismjs/themes/prism-tomorrow.min.css'; - import style from './StyleEditor.module.scss'; interface CodeEditorProps { diff --git a/apps/client/src/features/overview/composite/TimeElements.tsx b/apps/client/src/features/overview/composite/TimeElements.tsx index 4c93038cc..2397b5172 100644 --- a/apps/client/src/features/overview/composite/TimeElements.tsx +++ b/apps/client/src/features/overview/composite/TimeElements.tsx @@ -212,7 +212,7 @@ function GroupTimes() { const currentGroupId = useCurrentGroupId(); const group = useEntry(currentGroupId) as OntimeGroup | null; - const hasRunningTimer = phase !== TimerPhase.Pending && isPlaybackActive(playback) ; + const hasRunningTimer = phase !== TimerPhase.Pending && isPlaybackActive(playback); // the group end time does not encode any day offsets so it is calculated with group start time and duration const plannedGroupEnd = (() => { diff --git a/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx b/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx index 2380af689..a9ef7e537 100644 --- a/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx +++ b/apps/client/src/features/rundown/entry-editor/composite/EventEditorTriggers.tsx @@ -4,9 +4,9 @@ import { Fragment, useCallback, useMemo, useState } from 'react'; import { IoAlertCircle, IoCheckmarkCircle, IoTrash } from 'react-icons/io5'; import Button from '../../../../common/components/buttons/Button'; +import IconButton from '../../../../common/components/buttons/IconButton'; import * as Editor from '../../../../common/components/editor-utils/EditorUtils'; import Info from '../../../../common/components/info/Info'; -import IconButton from '../../../../common/components/buttons/IconButton'; import Select from '../../../../common/components/select/Select'; import { useEntryActionsContext } from '../../../../common/context/EntryActionsContext'; import useAutomationSettings from '../../../../common/hooks-query/useAutomationSettings'; diff --git a/apps/client/vite.config.js b/apps/client/vite.config.js index 7787cfaf0..cef4525ba 100644 --- a/apps/client/vite.config.js +++ b/apps/client/vite.config.js @@ -51,8 +51,8 @@ export default defineConfig({ }), prismjsPlugin({ manual: true, - languages: ['css',], - css: true + languages: ['css'], + css: true, }), ], server: { diff --git a/apps/electron/src/menu/applicationMenu.js b/apps/electron/src/menu/applicationMenu.js index 2edd28b56..bc96d5235 100644 --- a/apps/electron/src/menu/applicationMenu.js +++ b/apps/electron/src/menu/applicationMenu.js @@ -134,9 +134,7 @@ function makeFileMenu(askToQuit, serverUrl, redirectWindow, showDialog, download ], }, { type: 'separator' }, - isMac - ? { role: 'close' } - : { label: 'Quit', click: askToQuit, accelerator: 'Alt+F4' }, + isMac ? { role: 'close' } : { label: 'Quit', click: askToQuit, accelerator: 'Alt+F4' }, ], }; } diff --git a/apps/server/src/app.ts b/apps/server/src/app.ts index f331b2eae..290e3bcc7 100644 --- a/apps/server/src/app.ts +++ b/apps/server/src/app.ts @@ -273,7 +273,7 @@ export async function shutdown(exitCode = 0): Promise { shutdownPromise = performShutdown(exitCode); return shutdownPromise; -}; +} const closeHttpServer = async (server: Server | null): Promise => { if (!server) return; @@ -344,7 +344,7 @@ async function performShutdown(exitCode: number): Promise { logger.shutdown(); process.exit(exitCode); } -}; +} process.on('exit', (code) => consoleHighlight(`Ontime shutdown with code: ${code}`)); diff --git a/e2e/tests/fixtures/custom-view-test.html b/e2e/tests/fixtures/custom-view-test.html index 5278e3fff..1e844a969 100644 --- a/e2e/tests/fixtures/custom-view-test.html +++ b/e2e/tests/fixtures/custom-view-test.html @@ -1,10 +1,13 @@ - + Custom View E2E Test