X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/27bcade93df26e25bb2b4aff537875f78d3c1ff5..eb4491eea9ba873845f7a5796d139d19977f8112:/src/store/side-panel/side-panel-reducer.ts diff --git a/src/store/side-panel/side-panel-reducer.ts b/src/store/side-panel/side-panel-reducer.ts index cae42ac3..bda6965e 100644 --- a/src/store/side-panel/side-panel-reducer.ts +++ b/src/store/side-panel/side-panel-reducer.ts @@ -4,11 +4,16 @@ import * as _ from "lodash"; import { sidePanelActions, SidePanelAction } from './side-panel-action'; -import { SidePanelItem } from '../../components/side-panel/side-panel'; -import { ProjectsIcon, ShareMeIcon, WorkflowIcon, RecentIcon, FavoriteIcon, TrashIcon } from "../../components/icon/icon"; +import { SidePanelItem } from '~/components/side-panel/side-panel'; +import { ProjectsIcon, ShareMeIcon, WorkflowIcon, RecentIcon, FavoriteIcon, TrashIcon } from "~/components/icon/icon"; import { Dispatch } from "redux"; import { push } from "react-router-redux"; import { favoritePanelActions } from "../favorite-panel/favorite-panel-action"; +import { projectPanelActions } from "../project-panel/project-panel-action"; +import { projectActions } from "../project/project-action"; +import { getProjectUrl } from "../../models/project"; +import { columns as projectPanelColumns } from "../../views/project-panel/project-panel"; +import { columns as favoritePanelColumns } from "../../views/favorite-panel/favorite-panel"; export type SidePanelState = SidePanelItem[]; @@ -56,7 +61,14 @@ export const sidePanelData = [ open: false, active: false, margin: true, - openAble: true + openAble: true, + activeAction: (dispatch: Dispatch, uuid: string) => { + dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(uuid)); + dispatch(push(getProjectUrl(uuid))); + dispatch(projectPanelActions.SET_COLUMNS({ columns: projectPanelColumns })); + dispatch(projectPanelActions.RESET_PAGINATION()); + dispatch(projectPanelActions.REQUEST_ITEMS()); + } }, { id: SidePanelIdentifiers.SHARED_WITH_ME, @@ -83,6 +95,7 @@ export const sidePanelData = [ active: false, activeAction: (dispatch: Dispatch) => { dispatch(push("/favorites")); + dispatch(favoritePanelActions.SET_COLUMNS({ columns: favoritePanelColumns })); dispatch(favoritePanelActions.RESET_PAGINATION()); dispatch(favoritePanelActions.REQUEST_ITEMS()); }