[ARVADOS-WORKBENCH2] updated: 1.1.4-428-gccc52fb

Git user git at public.curoverse.com
Mon Jul 30 03:10:57 EDT 2018


Summary of changes:
 src/common/actions.ts                           | 11 -----------
 src/models/collection.ts                        |  4 ++++
 src/models/project.ts                           |  4 ++++
 src/store/navigation/navigation-action.ts       |  7 ++++---
 src/views/collection-panel/collection-panel.tsx | 11 ++++++-----
 src/views/workbench/workbench.tsx               |  6 +++---
 6 files changed, 21 insertions(+), 22 deletions(-)
 delete mode 100644 src/common/actions.ts

       via  ccc52fb9e9a880f8b8e9b15b09c2ebd513575bd4 (commit)
      from  c01f42311966c4d13413ee34dd6c97d5e5ac8b7f (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 ccc52fb9e9a880f8b8e9b15b09c2ebd513575bd4
Author: Janicki Artur <artur.janicki at contractors.roche.com>
Date:   Mon Jul 30 09:10:46 2018 +0200

    change code after CR
    
    Feature #13853
    
    Arvados-DCO-1.1-Signed-off-by: Janicki Artur <artur.janicki at contractors.roche.com>

diff --git a/src/common/actions.ts b/src/common/actions.ts
deleted file mode 100644
index 9ab6fd4..0000000
--- a/src/common/actions.ts
+++ /dev/null
@@ -1,11 +0,0 @@
-// Copyright (C) The Arvados Authors. All rights reserved.
-//
-// SPDX-License-Identifier: AGPL-3.0
-
-export const goToProject = (uuid: string) => {
-    return `/projects/${uuid}`;
-};
-
-export const goToCollection = (uuid: string) => {
-    return `/collections/${uuid}`;
-};
\ No newline at end of file
diff --git a/src/models/collection.ts b/src/models/collection.ts
index 2a92594..8ab3199 100644
--- a/src/models/collection.ts
+++ b/src/models/collection.ts
@@ -18,3 +18,7 @@ export interface CollectionResource extends Resource {
     deleteAt: string;
     isTrashed: boolean;
 }
+
+export const getCollectionUrl = (uuid: string) => {
+    return `/collections/${uuid}`;
+};
\ No newline at end of file
diff --git a/src/models/project.ts b/src/models/project.ts
index 1373ca7..d3626d3 100644
--- a/src/models/project.ts
+++ b/src/models/project.ts
@@ -7,3 +7,7 @@ import { GroupResource, GroupClass } from "./group";
 export interface ProjectResource extends GroupResource {
     groupClass: GroupClass.Project;
 }
+
+export const getProjectUrl = (uuid: string) => {
+    return `/projects/${uuid}`;
+};
diff --git a/src/store/navigation/navigation-action.ts b/src/store/navigation/navigation-action.ts
index 0cb6983..d65685d 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -11,12 +11,13 @@ import { dataExplorerActions } from "../data-explorer/data-explorer-action";
 import { PROJECT_PANEL_ID } from "../../views/project-panel/project-panel";
 import { RootState } from "../store";
 import { Resource, ResourceKind } from "../../models/resource";
-import { goToProject, goToCollection } from "../../common/actions";
+import { getCollectionUrl } from "../../models/collection";
+import { getProjectUrl } from "../../models/project";
 
 export const getResourceUrl = <T extends Resource>(resource: T): string => {
     switch (resource.kind) {
-        case ResourceKind.Project: return goToProject(resource.uuid);
-        case ResourceKind.Collection: return goToCollection(resource.uuid);
+        case ResourceKind.Project: return getProjectUrl(resource.uuid);
+        case ResourceKind.Collection: return getCollectionUrl(resource.uuid);
         default: return resource.href;
     }
 };
diff --git a/src/views/collection-panel/collection-panel.tsx b/src/views/collection-panel/collection-panel.tsx
index 99c4e00..1e5fb5e 100644
--- a/src/views/collection-panel/collection-panel.tsx
+++ b/src/views/collection-panel/collection-panel.tsx
@@ -85,15 +85,16 @@ export const CollectionPanel = withStyles(styles)(
         class extends React.Component<CollectionPanelProps> { 
 
             state = {
-                anchorEl: undefined
+                anchorEl: undefined,
+                open: false
             };
 
             showMenu = (event: any) => {
-                this.setState({ anchorEl: event.currentTarget });
+                this.setState({ anchorEl: event.currentTarget, open: true });
             }
 
             closeMenu = () => {
-                this.setState({ anchorEl: undefined });
+                this.setState({ anchorEl: undefined, open: false });
             }
 
             displayMenuAction = () => {
@@ -107,7 +108,7 @@ export const CollectionPanel = withStyles(styles)(
             }
 
             render() {
-                const { anchorEl } = this.state;
+                const { anchorEl, open } = this.state;
                 const { classes, item } = this.props;
                 return <div>
                         <Card className={classes.card}>
@@ -127,7 +128,7 @@ export const CollectionPanel = withStyles(styles)(
                                 <Menu
                                     id="submenu"
                                     anchorEl={anchorEl}
-                                    open={Boolean(anchorEl)}
+                                    open={open}
                                     onClose={this.closeMenu}>
                                     {MENU_OPTIONS.map((option) => (
                                         <MenuItem key={option.title}>
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index f39c779..bef7ad8 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -28,7 +28,7 @@ import { authService } from '../../services/services';
 
 import { detailsPanelActions, loadDetails } from "../../store/details-panel/details-panel-action";
 import { contextMenuActions } from "../../store/context-menu/context-menu-actions";
-import { sidePanelData, SidePanelIdentifiers } from '../../store/side-panel/side-panel-reducer';
+import { SidePanelIdentifiers } from '../../store/side-panel/side-panel-reducer';
 import { ProjectResource } from '../../models/project';
 import { ResourceKind } from '../../models/resource';
 import { ContextMenu, ContextMenuKind } from "../../views-components/context-menu/context-menu";
@@ -37,8 +37,8 @@ import { CurrentTokenDialog } from '../../views-components/current-token-dialog/
 import { dataExplorerActions } from '../../store/data-explorer/data-explorer-action';
 import { Snackbar } from '../../views-components/snackbar/snackbar';
 import { CollectionPanel } from '../collection-panel/collection-panel';
-import { goToCollection } from '../../common/actions';
 import { loadCollection } from '../../store/collection-panel/collection-panel-action';
+import { getCollectionUrl } from '../../models/collection';
 
 const drawerWidth = 240;
 const appBarHeight = 100;
@@ -253,7 +253,7 @@ export const Workbench = withStyles(styles)(
                     switch (item.kind) {
                         case ResourceKind.Collection:
                             this.props.dispatch<any>(loadCollection(item.uuid, item.kind as ResourceKind));
-                            this.props.dispatch(push(goToCollection(item.uuid)));
+                            this.props.dispatch(push(getCollectionUrl(item.uuid)));
                         default: 
                             this.props.dispatch<any>(setProjectItem(item.uuid, ItemMode.ACTIVE));
                             this.props.dispatch<any>(loadDetails(item.uuid, item.kind as ResourceKind));

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list