Skip to content

Commit

Permalink
Austenem/CAT-933 fix helper panel dialogs (#3554)
Browse files Browse the repository at this point in the history
* add checks for dialogs

* add changelog

* update doc
  • Loading branch information
austenem authored Oct 2, 2024
1 parent 75e6350 commit af196d9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG-fix-helper-panel-dialogs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Fix bug on dataset detail page for workspace dialogs opened in succession for different processed datasets.
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ function AddDatasetsFromDetailDialog({ uuid, dialogType }: AddDatasetsFromDetail
}

return (
// We're populating the table provider with the dataset from the detail page so as not to duplicate logic from the search dialog
<SelectableTableProvider tableLabel="Add Datasets From Detail Dialog" selectedRows={new Set([uuid])}>
<SelectableTableProvider key={uuid} tableLabel="Add Datasets From Detail Dialog" selectedRows={new Set([uuid])}>
<AddDatasetsFromSearchDialog />
</SelectableTableProvider>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,12 @@ function useCreateWorkspaceForm({
if (initialProtectedDatasets && initialProtectedDatasets !== '') {
setValue('protected-datasets', initialProtectedDatasets);
}
}, [initialProtectedDatasets, setValue]);
// Necessary to update dialog state between different processed datasets on detail pages
if (initialSelectedDatasets && initialSelectedDatasets.length !== 0) {
setValue('datasets', initialSelectedDatasets);
setValue('workspace-name', checkedWorkspaceName);
}
}, [initialProtectedDatasets, initialSelectedDatasets, checkedWorkspaceName, setValue]);

useEffect(() => {
if (dialogIsOpen) {
Expand Down

0 comments on commit af196d9

Please sign in to comment.