[ARVADOS-WORKBENCH2] updated: 1.1.4-143-ge9fe89a

Git user git at public.curoverse.com
Tue Jun 26 02:31:18 EDT 2018


Summary of changes:
 src/store/navigation/navigation-action.ts | 45 +++++++++++++------------------
 src/views/project-panel/project-panel.tsx |  4 +--
 src/views/workbench/workbench.tsx         | 16 +++--------
 3 files changed, 25 insertions(+), 40 deletions(-)

       via  e9fe89a00d2aea95b7e6c5ecdbeb4f6a583070b1 (commit)
      from  5fd5db805554d3eddd46cc911a5108fbb74b3cfc (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 e9fe89a00d2aea95b7e6c5ecdbeb4f6a583070b1
Author: Daniel Kos <daniel.kos at contractors.roche.com>
Date:   Tue Jun 26 08:31:16 2018 +0200

    Post merge fixes
    
    Feature #13666
    
    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 6d1754d..6e4b4be 100644
--- a/src/store/navigation/navigation-action.ts
+++ b/src/store/navigation/navigation-action.ts
@@ -22,12 +22,24 @@ export const getResourceUrl = (resource: Resource): string => {
     }
 };
 
-export const setProjectItem = (projects: Array<TreeItem<Project>>, itemId: string, itemKind: ResourceKind) => (dispatch: Dispatch) => {
+export enum ItemMode {
+    BOTH,
+    OPEN,
+    ACTIVE
+}
+
+export const setProjectItem = (projects: Array<TreeItem<Project>>, itemId: string, itemKind: ResourceKind, itemMode: ItemMode) => (dispatch: Dispatch) => {
 
     const openProjectItem = (resource: Resource) => {
-        dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(resource.uuid));
-        dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(resource.uuid));
-        dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(resource.uuid));
+        if (itemMode === ItemMode.OPEN || itemMode === ItemMode.BOTH) {
+            dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_OPEN(resource.uuid));
+        }
+
+        if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
+            dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(resource.uuid));
+            dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(resource.uuid));
+        }
+
         dispatch(push(getResourceUrl({...resource, kind: itemKind})));
     };
     const treeItem = findTreeItem(projects, itemId);
@@ -39,27 +51,8 @@ export const setProjectItem = (projects: Array<TreeItem<Project>>, itemId: strin
             dispatch<any>(getProjectList(itemId))
                 .then(() => openProjectItem(treeItem.data));
         }
-        dispatch<any>(getCollectionList(itemId));
-
-        // if (item.type === ResourceKind.PROJECT || item.type === ResourceKind.LEVEL_UP) {
-        //     this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(item.uuid));
-        // }
-        // this.props.dispatch<any>(getCollectionList(item.uuid));
-
+        if (itemMode === ItemMode.ACTIVE || itemMode === ItemMode.BOTH) {
+            dispatch<any>(getCollectionList(itemId));
+        }
     }
 };
-
-    // toggleProjectTreeItemActive = (itemId: string, status: TreeItemStatus) => {
-    //     if (status === TreeItemStatus.Loaded) {
-    //         this.openProjectItem(itemId);
-    //         this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(itemId));
-    //         this.props.dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(itemId));
-    //     } else {
-    //         this.props.dispatch<any>(getProjectList(itemId))
-    //             .then(() => {
-    //                 this.openProjectItem(itemId);
-    //                 this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM_ACTIVE(itemId));
-    //                 this.props.dispatch(sidePanelActions.RESET_SIDE_PANEL_ACTIVITY(itemId));
-    //             });
-    //     }
-    // }
diff --git a/src/views/project-panel/project-panel.tsx b/src/views/project-panel/project-panel.tsx
index 68cbc8e..830ea7b 100644
--- a/src/views/project-panel/project-panel.tsx
+++ b/src/views/project-panel/project-panel.tsx
@@ -8,7 +8,7 @@ import { ProjectState } from '../../store/project/project-reducer';
 import { RootState } from '../../store/store';
 import { connect, DispatchProp } from 'react-redux';
 import { CollectionState } from "../../store/collection/collection-reducer";
-import { setProjectItem } from "../../store/navigation/navigation-action";
+import { ItemMode, setProjectItem } from "../../store/navigation/navigation-action";
 import ProjectExplorer, { ProjectExplorerContextActions } from "../../views-components/project-explorer/project-explorer";
 import { projectExplorerItems } from "./project-panel-selectors";
 import { ProjectExplorerItem } from "../../views-components/project-explorer/project-explorer-item";
@@ -36,7 +36,7 @@ class ProjectPanel extends React.Component<ProjectPanelProps> {
     }
 
     goToItem = (item: ProjectExplorerItem) => {
-        this.props.dispatch<any>(setProjectItem(this.props.projects.items, item.uuid, item.kind));
+        this.props.dispatch<any>(setProjectItem(this.props.projects.items, item.uuid, item.kind, ItemMode.BOTH));
     }
 }
 
diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index b6a8457..a597c59 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -24,7 +24,7 @@ import ProjectPanel from '../project-panel/project-panel';
 import sidePanelActions from '../../store/side-panel/side-panel-action';
 import SidePanel, { SidePanelItem } from '../../components/side-panel/side-panel';
 import { ResourceKind } from "../../models/resource";
-import { setProjectItem } from "../../store/navigation/navigation-action";
+import { ItemMode, setProjectItem } from "../../store/navigation/navigation-action";
 
 const drawerWidth = 240;
 const appBarHeight = 102;
@@ -184,11 +184,11 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                                 projects={this.props.projects}
                                 toggleOpen={itemId =>
                                     this.props.dispatch<any>(
-                                        setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT)
+                                        setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT, ItemMode.OPEN)
                                     )}
                                 toggleActive={itemId =>
                                     this.props.dispatch<any>(
-                                        setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT)
+                                        setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT, ItemMode.ACTIVE)
                                     )}
                             />
                         </SidePanel>
@@ -196,7 +196,7 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                 <main className={classes.contentWrapper}>
                     <div className={classes.content}>
                         <Switch>
-                            <Route path="/project/:name" component={ProjectPanel} />
+                            <Route path="/projects/:name" component={ProjectPanel} />
                         </Switch>
                     </div>
                 </main>
@@ -204,14 +204,6 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
         );
     }
 }
-/*
-                    <ProjectTree
-                        projects={this.props.projects}
-                        toggleProjectTreeItem={itemId =>
-                            this.props.dispatch<any>(
-                                setProjectItem(this.props.projects, itemId, ResourceKind.PROJECT)
-                            )}/>
-*/
 
 export default connect<WorkbenchDataProps>(
     (state: RootState) => ({

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list