mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-07 16:33:51 +00:00
option to hide custom fields
This commit is contained in:
@@ -16,7 +16,7 @@ import CuesheetDnd from './cuesheet-dnd/CuesheetDnd';
|
||||
import CuesheetProgress from './cuesheet-progress/CuesheetProgress';
|
||||
import { makeCuesheetColumns } from './cuesheet-table/cuesheet-table-elements/cuesheetCols';
|
||||
import CuesheetTable from './cuesheet-table/CuesheetTable';
|
||||
import { cuesheetOptions } from './cuesheet.options';
|
||||
import { cuesheetOptions, useCuesheetOptions } from './cuesheet.options';
|
||||
|
||||
import styles from './CuesheetPage.module.scss';
|
||||
|
||||
@@ -28,8 +28,9 @@ export default function CuesheetPage() {
|
||||
const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure();
|
||||
const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure();
|
||||
const [eventId, setEventId] = useState<string | null>(null);
|
||||
const { hideCustom } = useCuesheetOptions();
|
||||
|
||||
const columns = useMemo(() => makeCuesheetColumns(customFields), [customFields]);
|
||||
const columns = useMemo(() => makeCuesheetColumns(hideCustom ? {} : customFields), [customFields, hideCustom]);
|
||||
|
||||
useWindowTitle('Cuesheet');
|
||||
|
||||
|
||||
@@ -49,6 +49,13 @@ export const cuesheetOptions: ViewOption[] = [
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
},
|
||||
{
|
||||
id: 'hideCustomColumns',
|
||||
title: 'Hide custom data columns',
|
||||
description: 'Whether the hide the custom data in the table',
|
||||
type: 'boolean',
|
||||
defaultValue: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
@@ -81,6 +88,7 @@ type CuesheetOptions = {
|
||||
hideIndexColumn: boolean;
|
||||
showDelayedTimes: boolean;
|
||||
hideDelays: boolean;
|
||||
hideCustom: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
@@ -97,6 +105,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): CuesheetOptions {
|
||||
hideIndexColumn: isStringBoolean(searchParams.get('hideIndexColumn')),
|
||||
showDelayedTimes: isStringBoolean(searchParams.get('showDelayedTimes')),
|
||||
hideDelays: isStringBoolean(searchParams.get('hideDelays')),
|
||||
hideCustom: isStringBoolean(searchParams.get('hideCustomColumns')),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user