mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-05 23:43:57 +00:00
chore: format (#2030)
* chore: format * chore: add formatter in CI check --------- Co-authored-by: alex-Arc <omnivox@LAPTOP-RC5SNBVV.localdomain>
This commit is contained in:
committed by
GitHub
parent
7e3aaa8c30
commit
73eff20d08
@@ -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
|
||||
|
||||
|
||||
@@ -9,11 +9,10 @@ import { downloadBlob } from './utils';
|
||||
const customViewsPath = `${apiEntryUrl}/custom-views`;
|
||||
|
||||
export async function getCustomViews(options?: RequestOptions): Promise<CustomViewsListResponse> {
|
||||
const response =
|
||||
await axios.get<CustomViewsListResponse>(customViewsPath, {
|
||||
signal: options?.signal,
|
||||
timeout: options?.timeout ?? axiosConfig.shortTimeout,
|
||||
})
|
||||
const response = await axios.get<CustomViewsListResponse>(customViewsPath, {
|
||||
signal: options?.signal,
|
||||
timeout: options?.timeout ?? axiosConfig.shortTimeout,
|
||||
});
|
||||
return response.data;
|
||||
}
|
||||
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -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 <div className={cx([style.fieldDescription, tone === 'warning' && style.warningText])}>{children}</div>;
|
||||
}
|
||||
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -55,7 +55,9 @@ export default function TriggersList(props: TriggersListProps) {
|
||||
<Panel.Divider />
|
||||
<Panel.Section>
|
||||
{enabledAutomations === false && (
|
||||
<Info>Automations are disabled. You can still manage triggers here, but they will not run until enabled.</Info>
|
||||
<Info>
|
||||
Automations are disabled. You can still manage triggers here, but they will not run until enabled.
|
||||
</Info>
|
||||
)}
|
||||
{duplicates && (
|
||||
<Panel.Error>
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
|
||||
</Panel.Section>
|
||||
</Panel.Card>
|
||||
</Panel.Section>
|
||||
|
||||
@@ -25,13 +25,7 @@ export default function CustomViewsList({ views, onOpenUpload, onMutate, onError
|
||||
<tbody>
|
||||
{views.length === 0 && <Panel.TableEmpty handleClick={onOpenUpload} label='No custom views yet' />}
|
||||
{views.map((view, index) => (
|
||||
<CustomViewsListItem
|
||||
key={view.slug}
|
||||
slug={view.slug}
|
||||
index={index}
|
||||
onMutate={onMutate}
|
||||
onError={onError}
|
||||
/>
|
||||
<CustomViewsListItem key={view.slug} slug={view.slug} index={index} onMutate={onMutate} onError={onError} />
|
||||
))}
|
||||
</tbody>
|
||||
</Panel.Table>
|
||||
|
||||
+1
-2
@@ -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 {
|
||||
|
||||
@@ -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 = (() => {
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -51,8 +51,8 @@ export default defineConfig({
|
||||
}),
|
||||
prismjsPlugin({
|
||||
manual: true,
|
||||
languages: ['css',],
|
||||
css: true
|
||||
languages: ['css'],
|
||||
css: true,
|
||||
}),
|
||||
],
|
||||
server: {
|
||||
|
||||
@@ -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' },
|
||||
],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ export async function shutdown(exitCode = 0): Promise<void> {
|
||||
|
||||
shutdownPromise = performShutdown(exitCode);
|
||||
return shutdownPromise;
|
||||
};
|
||||
}
|
||||
|
||||
const closeHttpServer = async (server: Server | null): Promise<void> => {
|
||||
if (!server) return;
|
||||
@@ -344,7 +344,7 @@ async function performShutdown(exitCode: number): Promise<void> {
|
||||
logger.shutdown();
|
||||
process.exit(exitCode);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
process.on('exit', (code) => consoleHighlight(`Ontime shutdown with code: ${code}`));
|
||||
|
||||
|
||||
+5
-2
@@ -1,10 +1,13 @@
|
||||
<!DOCTYPE html>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title>Custom View E2E Test</title>
|
||||
<style>
|
||||
body { font-family: sans-serif; padding: 2rem; }
|
||||
body {
|
||||
font-family: sans-serif;
|
||||
padding: 2rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
Reference in New Issue
Block a user