refs #master Merge branch 'origin/master' into 14007-ts-paths
[arvados-workbench2.git] / src / store / side-panel / side-panel-reducer.ts
index 9d56102b149719e74454a69b7d3bf1d917ab7d8c..8c73a8f596b6c9a96d0359dd804e7838ce307827 100644 (file)
@@ -4,12 +4,14 @@
 
 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 { dataExplorerActions } from "../data-explorer/data-explorer-action";
+import { SidePanelItem } from '~/components/side-panel/side-panel';
+import { ProjectsIcon, ShareMeIcon, WorkflowIcon, RecentIcon, FavoriteIcon, TrashIcon } from "~/components/icon/icon";
 import { Dispatch } from "redux";
-import { FAVORITE_PANEL_ID } from "../../views/favorite-panel/favorite-panel";
 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";
 
 export type SidePanelState = SidePanelItem[];
 
@@ -57,7 +59,13 @@ 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.RESET_PAGINATION());
+            dispatch(projectPanelActions.REQUEST_ITEMS()); 
+        }
     },
     {
         id: SidePanelIdentifiers.SHARED_WITH_ME,
@@ -84,8 +92,8 @@ export const sidePanelData = [
         active: false,
         activeAction: (dispatch: Dispatch) => {
             dispatch(push("/favorites"));
-            dispatch(dataExplorerActions.RESET_PAGINATION({id: FAVORITE_PANEL_ID}));
-            dispatch(dataExplorerActions.REQUEST_ITEMS({id: FAVORITE_PANEL_ID}));
+            dispatch(favoritePanelActions.RESET_PAGINATION());
+            dispatch(favoritePanelActions.REQUEST_ITEMS());
         }
     },
     {