Skip to content

Commit

Permalink
block column reorder in results view
Browse files Browse the repository at this point in the history
  • Loading branch information
sharadsw committed May 16, 2024
1 parent 13bafa9 commit 687fd7a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function WbSpreadsheetComponent({
data,
workbench,
mappings,
isResultsOpen,
checkDeletedFail,
spreadsheetChanged,
onClickDisambiguate: handleClickDisambiguate,
Expand All @@ -48,6 +49,7 @@ function WbSpreadsheetComponent({
readonly data: RA<RA<string | null>>;
readonly workbench: Workbench;
readonly mappings: WbMapping | undefined;
readonly isResultsOpen: boolean;
readonly checkDeletedFail: (statusCode: number) => boolean;
readonly spreadsheetChanged: () => void;
readonly onClickDisambiguate: () => void;
Expand Down Expand Up @@ -205,13 +207,14 @@ function WbSpreadsheetComponent({
comments,
} = useHotProps({ dataset, mappings, physicalColToMappingCol });

const hooks = useHotHooks(
const hooks = useHotHooks({
workbench,
physicalColToMappingCol,
spreadsheetChanged,
checkDeletedFail,
isReadOnly
);
isReadOnly,
isResultsOpen,
});

return (
<section className="flex-1 overflow-hidden overscroll-none">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@ export function WbView({
hot={hot}
isUploaded={isUploaded}
mappings={mappings}
isResultsOpen={showResults}
setHotTable={setHotTable}
spreadsheetChanged={spreadsheetChanged}
workbench={workbench}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,7 @@ export function useHotHooks({
},

beforeColumnMove: (_columnIndexes, _finalIndex, dropIndex) =>
dropIndex !== undefined || workbench.hot !== undefined,
!isResultsOpen && (dropIndex !== undefined || workbench.hot !== undefined),

// Save new visualOrder on the back end
afterColumnMove: (_columnIndexes, _finalIndex, dropIndex) => {
Expand Down

0 comments on commit 687fd7a

Please sign in to comment.