Fixed not clearing project panel items immediately on node click/open
authorDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 26 Jun 2018 10:20:02 +0000 (12:20 +0200)
committerDaniel Kos <daniel.kos@contractors.roche.com>
Tue, 26 Jun 2018 10:20:02 +0000 (12:20 +0200)
Feature #13666

Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos@contractors.roche.com>

src/store/navigation/navigation-action.ts
src/views/project-panel/project-panel.tsx
src/views/workbench/workbench.tsx

index 9b4c88eac845a7df4317a0b4403cef5288f6c5c6..0b4bcdf87ab033421319eaa472a3ea15449ea296 100644 (file)
@@ -36,18 +36,20 @@ export const setProjectItem = (projects: Array<TreeItem<Project>>, itemId: strin
         }
 
         if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
-            dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(resource.uuid));
             dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(resource.uuid));
         }
 
         dispatch(push(getResourceUrl({...resource, kind: itemKind})));
     };
+
     let treeItem = findTreeItem(projects, itemId);
     if (treeItem && itemKind === ResourceKind.LEVEL_UP) {
         treeItem = findTreeItem(projects, treeItem.data.ownerUuid);
     }
 
     if (treeItem) {
+        dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(treeItem.data.uuid));
+
         if (treeItem.status === TreeItemStatus.Loaded) {
             openProjectItem(treeItem.data);
         } else {
index 830ea7b824123d0b9ed15122dc36ad9856eb8aac..534f843f31499b064500f7751f18c61afe2198ef 100644 (file)
@@ -9,7 +9,7 @@ import { RootState } from '../../store/store';
 import { connect, DispatchProp } from 'react-redux';
 import { CollectionState } from "../../store/collection/collection-reducer";
 import { ItemMode, setProjectItem } from "../../store/navigation/navigation-action";
-import ProjectExplorer, { ProjectExplorerContextActions } from "../../views-components/project-explorer/project-explorer";
+import ProjectExplorer from "../../views-components/project-explorer/project-explorer";
 import { projectExplorerItems } from "./project-panel-selectors";
 import { ProjectExplorerItem } from "../../views-components/project-explorer/project-explorer-item";
 
index e8b15f206d213b66e7d3f97feb2f7ac647e3d131..1069de530c02986b78d86859d3910d9cfab7b72d 100644 (file)
@@ -25,6 +25,7 @@ import sidePanelActions from '../../store/side-panel/side-panel-action';
 import SidePanel, { SidePanelItem } from '../../components/side-panel/side-panel';
 import { ResourceKind } from "../../models/resource";
 import { ItemMode, setProjectItem } from "../../store/navigation/navigation-action";
+import projectActions from "../../store/project/project-action";
 
 const drawerWidth = 240;
 const appBarHeight = 102;
@@ -148,7 +149,7 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
 
     toggleSidePanelActive = (itemId: string) => {
         this.props.dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(itemId));
-        // this.props.dispatch(projectActions.RESET_PROJECT_TREE_ACTIVITY(itemId));
+        this.props.dispatch(projectActions.RESET_PROJECT_TREE_ACTIVITY(itemId));
     }
 
     render() {