diff --git a/apps/client/src/views/cuesheet/CuesheetPage.tsx b/apps/client/src/views/cuesheet/CuesheetPage.tsx index 00b7a62b8..e7a4a7ee4 100644 --- a/apps/client/src/views/cuesheet/CuesheetPage.tsx +++ b/apps/client/src/views/cuesheet/CuesheetPage.tsx @@ -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(null); + const { hideCustom } = useCuesheetOptions(); - const columns = useMemo(() => makeCuesheetColumns(customFields), [customFields]); + const columns = useMemo(() => makeCuesheetColumns(hideCustom ? {} : customFields), [customFields, hideCustom]); useWindowTitle('Cuesheet'); diff --git a/apps/client/src/views/cuesheet/cuesheet.options.ts b/apps/client/src/views/cuesheet/cuesheet.options.ts index 61e5309bd..9dfd8fe7c 100644 --- a/apps/client/src/views/cuesheet/cuesheet.options.ts +++ b/apps/client/src/views/cuesheet/cuesheet.options.ts @@ -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')), }; }