[ARVADOS-WORKBENCH2] updated: 1.1.4-144-g948bf5f

Git user git at public.curoverse.com
Tue Jun 26 05:06:07 EDT 2018


Summary of changes:
 src/services/auth-service/auth-service.ts  | 4 ++++
 src/store/collection/collection-reducer.ts | 2 +-
 src/store/navigation/navigation-action.ts  | 7 +++++--
 src/store/project/project-reducer.ts       | 8 ++++----
 src/views/workbench/workbench.tsx          | 4 +++-
 5 files changed, 17 insertions(+), 8 deletions(-)

       via  948bf5f1e58f1003630b3b564e813557d1f54d84 (commit)
      from  e9fe89a00d2aea95b7e6c5ecdbeb4f6a583070b1 (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 948bf5f1e58f1003630b3b564e813557d1f54d84
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Tue Jun 26 11:06:04 2018 +0200

    Navigation fixes
    
    Feature #13666
    
    Arvados-DCO-1.1-Signed-off-by: Daniel Kos <daniel.kos at contractors.roche.com>

diff --git a/src/services/auth-service/auth-service.ts b/src/services/auth-service/auth-service.ts
index d71f029..e953a75 100644
--- a/src/services/auth-service/auth-service.ts
+++ b/src/services/auth-service/auth-service.ts
@@ -35,6 +35,10 @@ export default class AuthService {
         return localStorage.getItem(API_TOKEN_KEY) || undefined;
     }
 
+    public getUuid() {
+        return localStorage.getItem(USER_UUID_KEY) || undefined;
+    }
+
     public getOwnerUuid() {
         return localStorage.getItem(USER_OWNER_UUID_KEY) || undefined;
     }
diff --git a/src/store/collection/collection-reducer.ts b/src/store/collection/collection-reducer.ts
index 939ca62..5c257ea 100644
--- a/src/store/collection/collection-reducer.ts
+++ b/src/store/collection/collection-reducer.ts
@@ -13,7 +13,7 @@ const collectionsReducer = (state: CollectionState = [], action: CollectionActio
         CREATE_COLLECTION: collection => [...state, collection],
         REMOVE_COLLECTION: () => state,
         COLLECTIONS_REQUEST: () => {
-            return state;
+            return [];
         },
         COLLECTIONS_SUCCESS: ({ collections }) => {
             return collections;
diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index 6e4b4be..9b4c88e 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -42,14 +42,17 @@ export const setProjectItem = (projects: Array<TreeItem<Project>>, itemId: strin
 
         dispatch(push(getResourceUrl({...resource, kind: itemKind})));
     };
-    const treeItem = findTreeItem(projects, itemId);
+    let treeItem = findTreeItem(projects, itemId);
+    if (treeItem && itemKind === ResourceKind.LEVEL_UP) {
+        treeItem = findTreeItem(projects, treeItem.data.ownerUuid);
+    }
 
     if (treeItem) {
         if (treeItem.status === TreeItemStatus.Loaded) {
             openProjectItem(treeItem.data);
         } else {
             dispatch<any>(getProjectList(itemId))
-                .then(() => openProjectItem(treeItem.data));
+                .then(() => openProjectItem(treeItem!.data));
         }
         if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
             dispatch<any>(getCollectionList(itemId));
diff --git a/src/store/project/project-reducer.ts b/src/store/project/project-reducer.ts
index 39d194d..0e2018b 100644
--- a/src/store/project/project-reducer.ts
+++ b/src/store/project/project-reducer.ts
@@ -123,8 +123,8 @@ const projectsReducer = (state: ProjectState = { items: [], currentItemId: "" },
                 item.open = !item.open;
             }
             return {
-                ...state,
-                items
+                items,
+                currentItemId: itemId
             };
         },
         TOGGLE_PROJECT_TREE_ITEM_ACTIVE: itemId => {
@@ -143,8 +143,8 @@ const projectsReducer = (state: ProjectState = { items: [], currentItemId: "" },
             const items = _.cloneDeep(state.items);
             resetTreeActivity(items);
             return {
-                ...state,
-                items
+                items,
+                currentItemId: ""
             };
         },
         default: () => state
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index a597c59..e8b15f2 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -131,7 +131,9 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
 
     mainAppBarActions: MainAppBarActionProps = {
         onBreadcrumbClick: ({ itemId }: NavBreadcrumb) => {
-            // this.toggleProjectTreeItem(itemId, status);
+            this.props.dispatch<any>(
+                setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT, ItemMode.BOTH)
+            );
         },
         onSearch: searchText => {
             this.setState({ searchText });

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list