mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-13 03:13:47 +00:00
refactor: improve navigation and settings locks
This commit is contained in:
committed by
Carlos Valente
parent
836fa52757
commit
efceb930e5
@@ -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>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user