From: Michal Klobukowski Date: Thu, 12 Jul 2018 09:57:56 +0000 (+0200) Subject: Merge branch '13750-project-item-remains-active' X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/85e82d4c8a48aafeefa0b8b48a372e91faac64d0?hp=90aa25eab8c69ff908873edc72293c8feb4847bf Merge branch '13750-project-item-remains-active' refs #13750 Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski --- diff --git a/src/store/side-panel/side-panel-reducer.ts b/src/store/side-panel/side-panel-reducer.ts index 9fc5df1510..ca26eeb643 100644 --- a/src/store/side-panel/side-panel-reducer.ts +++ b/src/store/side-panel/side-panel-reducer.ts @@ -35,9 +35,18 @@ const sidePanelReducer = (state: SidePanelState = sidePanelData, action: SidePan } }; +export enum SidePanelIdentifiers { + Projects = "Projects", + SharedWithMe = "SharedWithMe", + Workflows = "Workflows", + RecentOpen = "RecentOpen", + Favourites = "Favourites", + Trash = "Trash" +} + export const sidePanelData = [ { - id: "1", + id: SidePanelIdentifiers.Projects, name: "Projects", icon: "fas fa-th fa-fw", open: false, @@ -46,31 +55,31 @@ export const sidePanelData = [ openAble: true }, { - id: "2", + id: SidePanelIdentifiers.SharedWithMe, name: "Shared with me", icon: "fas fa-users fa-fw", active: false, }, { - id: "3", + id: SidePanelIdentifiers.Workflows, name: "Workflows", icon: "fas fa-cogs fa-fw", active: false, }, { - id: "4", + id: SidePanelIdentifiers.RecentOpen, name: "Recent open", icon: "icon-time fa-fw", active: false, }, { - id: "5", + id: SidePanelIdentifiers.Favourites, name: "Favorites", icon: "fas fa-star fa-fw", active: false, }, { - id: "6", + id: SidePanelIdentifiers.Trash, name: "Trash", icon: "fas fa-trash-alt fa-fw", active: false, diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx index 6ad4d24745..e7a8ae3088 100644 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@ -34,6 +34,7 @@ import { authService } from '../../services/services'; import detailsPanelActions, { loadDetails } from "../../store/details-panel/details-panel-action"; import { ResourceKind } from '../../models/kinds'; +import { SidePanelIdentifiers } from '../../store/side-panel/side-panel-reducer'; const drawerWidth = 240; const appBarHeight = 100; @@ -172,6 +173,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(push("/")); } handleCreationDialogOpen = (itemUuid: string) => { @@ -239,7 +241,8 @@ class Workbench extends React.Component { toggleActive={itemId => { this.props.dispatch(setProjectItem(itemId, ItemMode.ACTIVE)); this.props.dispatch(loadDetails(itemId, ResourceKind.Project)); - }}/> + this.props.dispatch(sidePanelActions.TOGGLE_SIDE_PANEL_ITEM_ACTIVE(SidePanelIdentifiers.Projects)); + }} /> }