refactor: improve navigation and settings locks

This commit is contained in:
Carlos Valente
2025-08-11 06:35:54 +02:00
committed by Carlos Valente
parent 836fa52757
commit efceb930e5
8 changed files with 49 additions and 37 deletions
@@ -1,13 +1,13 @@
import ViewNavigationMenu from '../../common/components/navigation-menu/ViewNavigationMenu';
import ProtectRoute from '../../common/components/protect-route/ProtectRoute';
import { getIsViewLocked } from '../../externals';
import { getIsNavigationLocked } from '../../externals';
import Operator from './Operator';
export default function OperatorExport() {
return (
<ProtectRoute permission='operator'>
<ViewNavigationMenu isViewLocked={getIsViewLocked()} />
<ViewNavigationMenu isNavigationLocked={getIsNavigationLocked()} />
<Operator />
</ProtectRoute>
);
@@ -55,10 +55,11 @@ function RundownExport() {
<ProtectRoute permission='editor'>
<div className={cx([style.rundownExport, isExtracted && style.extracted])} data-testid='panel-rundown'>
<FinderPlacement />
{isExtracted && <ViewNavigationMenu suppressSettings />}
<div className={style.rundown}>
<div className={style.list}>
<ErrorBoundary>
<Corner onClick={(event) => handleLinks('rundown', event)} />
{!isExtracted && <Corner onClick={(event) => handleLinks('rundown', event)} />}
<RundownContextMenu>
<RundownWrapper />
</RundownContextMenu>
@@ -227,16 +227,25 @@ export default function GenerateLinkForm({ hostOptions, pathOptions, presets, is
name='lockNav'
checked={watch('lockNav')}
onCheckedChange={(checked) => setValue('lockNav', checked, { shouldDirty: true })}
disabled={watch('lockConfig')}
/>
</Panel.ListItem>
{watch('path') !== OntimeView.Cuesheet && (
<Panel.ListItem>
<Panel.Field title='Lock configuration' description='Whether to hide the configuration panel' />
<Panel.Field
title='Lock configuration'
description='Whether to hide the configuration panel (also hides navigation)'
/>
<Switch
size='large'
name='lockConfig'
checked={watch('lockConfig')}
onCheckedChange={(checked) => setValue('lockConfig', checked, { shouldDirty: true })}
onCheckedChange={(checked) => {
if (checked) {
setValue('lockNav', checked, { shouldDirty: true });
}
setValue('lockConfig', checked, { shouldDirty: true });
}}
/>
</Panel.ListItem>
)}