20487: Correctly dispatch loadProject from openProjectPanel
authorPeter Amstutz <peter.amstutz@curii.com>
Tue, 9 May 2023 21:56:30 +0000 (17:56 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Tue, 9 May 2023 21:56:30 +0000 (17:56 -0400)
Also fix it to recognize PDH in the files panel.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/components/collection-panel-files/collection-panel-files.tsx
src/store/project-panel/project-panel-action.ts

index b75f3018e4894fa02bb8adedafe2b7b2130f126a..4896641b19aaf649773a38513dab31b3c9837e24 100644 (file)
@@ -39,7 +39,7 @@ import { setCollectionFiles } from 'store/collection-panel/collection-panel-file
 import { sortBy } from 'lodash';
 import { formatFileSize } from 'common/formatters';
 import { getInlineFileUrl, sanitizeToken } from 'views-components/context-menu/actions/helpers';
-import { extractUuidObjectType, ResourceObjectType } from 'models/resource';
+import { extractUuidKind, ResourceKind } from 'models/resource';
 
 export interface CollectionPanelFilesProps {
     isWritable: boolean;
@@ -261,7 +261,7 @@ export const CollectionPanelFiles = withStyles(styles)(connect((state: RootState
     const rightData = pathData[rightKey];
 
     React.useEffect(() => {
-        if (props.currentItemUuid && extractUuidObjectType(props.currentItemUuid) == ResourceObjectType.COLLECTION) {
+        if (props.currentItemUuid && extractUuidKind(props.currentItemUuid) == ResourceKind.COLLECTION) {
             setPathData({});
             setPath([props.currentItemUuid]);
         }
index 6b99e300692de38b762eea09eaa7774e9b7191d0..7ad18b67bdb2f50b5baf1e4a3818abc3d4581d37 100644 (file)
@@ -16,7 +16,7 @@ export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID);
 
 export const openProjectPanel = (projectUuid: string) =>
     async (dispatch: Dispatch) => {
-        await loadProject(projectUuid);
+        await dispatch<any>(loadProject(projectUuid));
         dispatch(propertiesActions.SET_PROPERTY({ key: PROJECT_PANEL_CURRENT_UUID, value: projectUuid }));
         dispatch(projectPanelActions.RESET_EXPLORER_SEARCH_VALUE());
         dispatch(projectPanelActions.REQUEST_ITEMS());