[ARVADOS-WORKBENCH2] updated: 1.1.4-587-g31afa12

Git user git at public.curoverse.com
Mon Aug 13 18:18:40 EDT 2018


Summary of changes:
 src/store/navigation/navigation-action.ts  | 19 +++++++++++--------
 src/store/side-panel/side-panel-reducer.ts |  6 +++++-
 2 files changed, 16 insertions(+), 9 deletions(-)

       via  31afa127fa9b354c46fd78a2fe28228f958df71f (commit)
      from  eb880179bed8f07348faeccb79d34c9726d206e8 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 31afa127fa9b354c46fd78a2fe28228f958df71f
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Mon Aug 13 19:38:21 2018 +0200

    Fix showing project explorer after going back from favourites
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index dc68021..dfffb9c 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -3,12 +3,12 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { Dispatch } from "redux";
-import { projectActions, getProjectList } from "../project/project-action";
+import { getProjectList, projectActions } from "../project/project-action";
 import { push } from "react-router-redux";
 import { TreeItemStatus } from "../../components/tree/tree";
 import { findTreeItem } from "../project/project-reducer";
 import { RootState } from "../store";
-import { Resource, ResourceKind } from "../../models/resource";
+import { ResourceKind } from "../../models/resource";
 import { projectPanelActions } from "../project-panel/project-panel-action";
 import { getCollectionUrl } from "../../models/collection";
 import { getProjectUrl, ProjectResource } from "../../models/project";
@@ -18,11 +18,12 @@ import { sidePanelActions } from "../side-panel/side-panel-action";
 import { SidePanelIdentifiers } from "../side-panel/side-panel-reducer";
 import { getUuidObjectType, ObjectTypes } from "../../models/object-types";
 
-export const getResourceUrl = <T extends Resource>(resource: T): string => {
-    switch (resource.kind) {
-        case ResourceKind.PROJECT: return getProjectUrl(resource.uuid);
-        case ResourceKind.COLLECTION: return getCollectionUrl(resource.uuid);
-        default: return resource.href;
+export const getResourceUrl = (resourceKind: ResourceKind, resourceUuid: string): string => {
+    switch (resourceKind) {
+        case ResourceKind.PROJECT: return getProjectUrl(resourceUuid);
+        case ResourceKind.COLLECTION: return getCollectionUrl(resourceUuid);
+        default:
+            return '';
     }
 };
 
@@ -34,11 +35,13 @@ export enum ItemMode {
 
 export const setProjectItem = (itemId: string, itemMode: ItemMode) =>
     (dispatch: Dispatch, getState: () => RootState, services: ServiceRepository) => {
+        console.log("SetProjectItem!!", itemId);
+        debugger;
         const { projects, router } = getState();
         const treeItem = findTreeItem(projects.items, itemId);
 
         if (treeItem) {
-            const resourceUrl = getResourceUrl(treeItem.data);
+            const resourceUrl = getResourceUrl(treeItem.data.kind, treeItem.data.uuid);
 
             if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
                 if (router.location && !router.location.pathname.includes(resourceUrl)) {
diff --git a/src/store/side-panel/side-panel-reducer.ts b/src/store/side-panel/side-panel-reducer.ts
index 7a27e5a..433da17 100644
--- a/src/store/side-panel/side-panel-reducer.ts
+++ b/src/store/side-panel/side-panel-reducer.ts
@@ -12,6 +12,8 @@ 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[];
 
@@ -63,8 +65,9 @@ export const sidePanelData = [
         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()); 
+            dispatch(projectPanelActions.REQUEST_ITEMS());
         }
     },
     {
@@ -92,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());
         }

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list