21225: Combine project panel id consts
authorStephen Smith <stephen@curii.com>
Thu, 8 Feb 2024 14:39:21 +0000 (09:39 -0500)
committerStephen Smith <stephen@curii.com>
Fri, 7 Jun 2024 18:08:23 +0000 (14:08 -0400)
Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen@curii.com>

services/workbench2/src/store/project-panel/project-panel-action-bind.ts
services/workbench2/src/store/project-panel/project-panel-action.ts
services/workbench2/src/store/store.ts
services/workbench2/src/views/project-panel/project-panel.tsx

index 31a5f8d6b60677d7dbdef4a07982b074b564f859..a84039571b928ae4017846df33bb033829b6efa6 100644 (file)
@@ -4,6 +4,8 @@
 
 import { bindDataExplorerActions } from "store/data-explorer/data-explorer-action";
 
-const PROJECT_PANEL_ID = "projectPanel";
+// These are split into a separate file to avoid circular imports causing
+// invariant violations with unit tests
 
+export const PROJECT_PANEL_ID = "projectPanel";
 export const projectPanelActions = bindDataExplorerActions(PROJECT_PANEL_ID);
index 305799e820f6c070a1797d457989ae022ff591c5..a0547ced2376d80cd18d0057002afcab6f2b0a88 100644 (file)
@@ -9,7 +9,6 @@ import { getProperty } from "store/properties/properties";
 import { loadProject } from "store/workbench/workbench-actions";
 import { projectPanelActions } from "store/project-panel/project-panel-action-bind";
 
-export const PROJECT_PANEL_ID = "projectPanel";
 export const PROJECT_PANEL_CURRENT_UUID = "projectPanelCurrentUuid";
 export const IS_PROJECT_PANEL_TRASHED = "isProjectPanelTrashed";
 
index 4033166bb93c5e51921c6186e7d0e2b8821bce0b..b18bf8199ea0b649b5a06f75a5365b596c88b371 100644 (file)
@@ -19,7 +19,7 @@ import { snackbarReducer } from "./snackbar/snackbar-reducer";
 import { collectionPanelFilesReducer } from "./collection-panel/collection-panel-files/collection-panel-files-reducer";
 import { dataExplorerMiddleware } from "./data-explorer/data-explorer-middleware";
 import { FAVORITE_PANEL_ID } from "./favorite-panel/favorite-panel-action";
-import { PROJECT_PANEL_ID } from "./project-panel/project-panel-action";
+import { PROJECT_PANEL_ID } from "./project-panel/project-panel-action-bind";
 import { WORKFLOW_PROCESSES_PANEL_ID } from "./workflow-panel/workflow-panel-actions";
 import { ProjectPanelMiddlewareService } from "./project-panel/project-panel-middleware-service";
 import { FavoritePanelMiddlewareService } from "./favorite-panel/favorite-panel-middleware-service";
index 19408d5db99fb039e71405e04148a9ddd6111819..5e10d022cd689c6549397c3f4e48d2eb3681b6ac 100644 (file)
@@ -52,7 +52,8 @@ import { CollectionResource } from 'models/collection';
 import { resourceIsFrozen } from 'common/frozen-resources';
 import { ProjectResource } from 'models/project';
 import { deselectAllOthers, toggleOne } from 'store/multiselect/multiselect-actions';
-import { DetailsCardRoot } from 'views-components/details-card/details-card-root'; 
+import { DetailsCardRoot } from 'views-components/details-card/details-card-root';
+import { PROJECT_PANEL_ID } from 'store/project-panel/project-panel-action-bind';
 
 type CssRules = 'root' | 'button' ;
 
@@ -235,8 +236,6 @@ export const projectPanelColumns: DataColumns<string, ProjectResource> = [
     },
 ];
 
-export const PROJECT_PANEL_ID = 'projectPanel';
-
 const DEFAULT_VIEW_MESSAGES = ['Your project is empty.', 'Please create a project or create a collection and upload a data.'];
 
 interface ProjectPanelDataProps {