diff --git a/CHANGELOG-fix-helper-panel-dialogs.md b/CHANGELOG-fix-helper-panel-dialogs.md new file mode 100644 index 0000000000..fff07eb05c --- /dev/null +++ b/CHANGELOG-fix-helper-panel-dialogs.md @@ -0,0 +1 @@ +- Fix bug on dataset detail page for workspace dialogs opened in succession for different processed datasets. \ No newline at end of file diff --git a/context/app/static/js/components/workspaces/AddDatasetsFromDetailDialog/AddDatasetsFromDetailDialog.tsx b/context/app/static/js/components/workspaces/AddDatasetsFromDetailDialog/AddDatasetsFromDetailDialog.tsx index 4314147de3..e26eb4735f 100644 --- a/context/app/static/js/components/workspaces/AddDatasetsFromDetailDialog/AddDatasetsFromDetailDialog.tsx +++ b/context/app/static/js/components/workspaces/AddDatasetsFromDetailDialog/AddDatasetsFromDetailDialog.tsx @@ -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 - + ); diff --git a/context/app/static/js/components/workspaces/NewWorkspaceDialog/useCreateWorkspaceForm.ts b/context/app/static/js/components/workspaces/NewWorkspaceDialog/useCreateWorkspaceForm.ts index 8929d014ff..94e2edb6e3 100644 --- a/context/app/static/js/components/workspaces/NewWorkspaceDialog/useCreateWorkspaceForm.ts +++ b/context/app/static/js/components/workspaces/NewWorkspaceDialog/useCreateWorkspaceForm.ts @@ -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) {