mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-22 07:29:08 +00:00
fix: prevent hide index column from leaking between cuesheet and editor
This commit is contained in:
committed by
Carlos Valente
parent
c7d8b137ca
commit
3838bdc54d
@@ -206,9 +206,16 @@ export default function CuesheetTable({ columns, cuesheetMode, tableRoot, setCue
|
|||||||
: SortableCuesheetHeader;
|
: SortableCuesheetHeader;
|
||||||
|
|
||||||
// if the table is being resized, we render non-sortable headers to avoid performance issues
|
// if the table is being resized, we render non-sortable headers to avoid performance issues
|
||||||
return <HeaderComponent key={headerGroup.id} cuesheetMode={cuesheetMode} headerGroup={headerGroup} />;
|
return (
|
||||||
|
<HeaderComponent
|
||||||
|
key={headerGroup.id}
|
||||||
|
cuesheetMode={cuesheetMode}
|
||||||
|
headerGroup={headerGroup}
|
||||||
|
hideIndexColumn={hideIndexColumn}
|
||||||
|
/>
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}, [cuesheetMode, table]);
|
}, [cuesheetMode, hideIndexColumn, table]);
|
||||||
|
|
||||||
const isLoading = !data || status === 'pending';
|
const isLoading = !data || status === 'pending';
|
||||||
|
|
||||||
|
|||||||
+3
-7
@@ -5,7 +5,6 @@ import { CSSProperties } from 'react';
|
|||||||
import type { ExtendedEntry } from '../../../../common/utils/rundownMetadata';
|
import type { ExtendedEntry } from '../../../../common/utils/rundownMetadata';
|
||||||
import { getAccessibleColour } from '../../../../common/utils/styleUtils';
|
import { getAccessibleColour } from '../../../../common/utils/styleUtils';
|
||||||
import { AppMode } from '../../../../ontimeConfig';
|
import { AppMode } from '../../../../ontimeConfig';
|
||||||
import { usePersistedCuesheetOptions } from '../../cuesheet.options';
|
|
||||||
import { Draggable, SortableCell, TableCell } from './SortableCell';
|
import { Draggable, SortableCell, TableCell } from './SortableCell';
|
||||||
|
|
||||||
import style from '../CuesheetTable.module.scss';
|
import style from '../CuesheetTable.module.scss';
|
||||||
@@ -13,11 +12,10 @@ import style from '../CuesheetTable.module.scss';
|
|||||||
interface CuesheetHeaderProps {
|
interface CuesheetHeaderProps {
|
||||||
headerGroup: HeaderGroup<ExtendedEntry>;
|
headerGroup: HeaderGroup<ExtendedEntry>;
|
||||||
cuesheetMode: AppMode;
|
cuesheetMode: AppMode;
|
||||||
|
hideIndexColumn: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SortableCuesheetHeader({ headerGroup, cuesheetMode }: CuesheetHeaderProps) {
|
export function SortableCuesheetHeader({ headerGroup, cuesheetMode, hideIndexColumn }: CuesheetHeaderProps) {
|
||||||
const hideIndexColumn = usePersistedCuesheetOptions((state) => state.hideIndexColumn);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={headerGroup.id}>
|
<tr key={headerGroup.id}>
|
||||||
{cuesheetMode === AppMode.Edit && <th className={style.actionColumn} tabIndex={-1} />}
|
{cuesheetMode === AppMode.Edit && <th className={style.actionColumn} tabIndex={-1} />}
|
||||||
@@ -57,9 +55,7 @@ export function SortableCuesheetHeader({ headerGroup, cuesheetMode }: CuesheetHe
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function CuesheetHeader({ headerGroup, cuesheetMode }: CuesheetHeaderProps) {
|
export function CuesheetHeader({ headerGroup, cuesheetMode, hideIndexColumn }: CuesheetHeaderProps) {
|
||||||
const hideIndexColumn = usePersistedCuesheetOptions((state) => state.hideIndexColumn);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<tr key={headerGroup.id}>
|
<tr key={headerGroup.id}>
|
||||||
{cuesheetMode === AppMode.Edit && <th className={style.actionColumn} tabIndex={-1} />}
|
{cuesheetMode === AppMode.Edit && <th className={style.actionColumn} tabIndex={-1} />}
|
||||||
|
|||||||
Reference in New Issue
Block a user