From: Daniel Kos Date: Tue, 26 Jun 2018 10:20:02 +0000 (+0200) Subject: Fixed not clearing project panel items immediately on node click/open X-Git-Tag: 1.2.0~67^2 X-Git-Url: https://git.arvados.org/arvados-workbench2.git/commitdiff_plain/b0ea85a58cf15903e67c5a7161d7887b03af713e Fixed not clearing project panel items immediately on node click/open Feature #13666 Arvados-DCO-1.1-Signed-off-by: Daniel Kos --- diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts index 9b4c88ea..0b4bcdf8 100644 --- a/src/store/navigation/navigation-action.ts +++ b/src/store/navigation/navigation-action.ts @@ -36,18 +36,20 @@ export const setProjectItem = (projects: Array>, 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 { diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx index 830ea7b8..534f843f 100644 --- a/src/views/project-panel/project-panel.tsx +++ b/src/views/project-panel/project-panel.tsx @@ -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"; diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx index e8b15f20..1069de53 100644 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@ -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 { 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() {