mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +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 CuesheetProgress from './cuesheet-progress/CuesheetProgress';
|
||||||
import { makeCuesheetColumns } from './cuesheet-table/cuesheet-table-elements/cuesheetCols';
|
import { makeCuesheetColumns } from './cuesheet-table/cuesheet-table-elements/cuesheetCols';
|
||||||
import CuesheetTable from './cuesheet-table/CuesheetTable';
|
import CuesheetTable from './cuesheet-table/CuesheetTable';
|
||||||
import { cuesheetOptions } from './cuesheet.options';
|
import { cuesheetOptions, useCuesheetOptions } from './cuesheet.options';
|
||||||
|
|
||||||
import styles from './CuesheetPage.module.scss';
|
import styles from './CuesheetPage.module.scss';
|
||||||
|
|
||||||
@@ -28,8 +28,9 @@ export default function CuesheetPage() {
|
|||||||
const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure();
|
const { isOpen: isMenuOpen, onOpen, onClose } = useDisclosure();
|
||||||
const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure();
|
const { isOpen: isEventEditorOpen, onOpen: onEventEditorOpen, onClose: onEventEditorClose } = useDisclosure();
|
||||||
const [eventId, setEventId] = useState<string | null>(null);
|
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');
|
useWindowTitle('Cuesheet');
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,13 @@ export const cuesheetOptions: ViewOption[] = [
|
|||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
defaultValue: false,
|
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;
|
hideIndexColumn: boolean;
|
||||||
showDelayedTimes: boolean;
|
showDelayedTimes: boolean;
|
||||||
hideDelays: boolean;
|
hideDelays: boolean;
|
||||||
|
hideCustom: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,6 +105,7 @@ function getOptionsFromParams(searchParams: URLSearchParams): CuesheetOptions {
|
|||||||
hideIndexColumn: isStringBoolean(searchParams.get('hideIndexColumn')),
|
hideIndexColumn: isStringBoolean(searchParams.get('hideIndexColumn')),
|
||||||
showDelayedTimes: isStringBoolean(searchParams.get('showDelayedTimes')),
|
showDelayedTimes: isStringBoolean(searchParams.get('showDelayedTimes')),
|
||||||
hideDelays: isStringBoolean(searchParams.get('hideDelays')),
|
hideDelays: isStringBoolean(searchParams.get('hideDelays')),
|
||||||
|
hideCustom: isStringBoolean(searchParams.get('hideCustomColumns')),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user