[ARVADOS-WORKBENCH2] updated: 1.1.4-60-g95a1494

Git user git at public.curoverse.com
Fri Jun 15 08:54:04 EDT 2018


Summary of changes:
 src/views/workbench/workbench.tsx | 44 ++++++++++++++++++++-------------------
 1 file changed, 23 insertions(+), 21 deletions(-)

       via  95a149461f453589ff5eb8a21b00f032d1c132a2 (commit)
      from  89161730d7d5e7d16a8fe2f5494db6560e718fa3 (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 95a149461f453589ff5eb8a21b00f032d1c132a2
Author: Michal Klobukowski <michal.klobukowski at contractors.roche.com>
Date:   Fri Jun 15 14:53:45 2018 +0200

    Connect breadcrumbs witg project tree
    
    Feature #13628
    
    Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski at contractors.roche.com>

diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index ef8e6bd..cb69186 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -30,6 +30,7 @@ import ProjectTree from '../../components/project-tree/project-tree';
 import { TreeItem } from "../../components/tree/tree";
 import { Project } from "../../models/project";
 import { projectService } from '../../services/services';
+import { findTreeBranch } from '../../store/project/project-reducer';
 
 const drawerWidth = 240;
 
@@ -76,7 +77,7 @@ interface WorkbenchActionProps {
 type WorkbenchProps = WorkbenchDataProps & WorkbenchActionProps & DispatchProp & WithStyles<CssRules>;
 
 interface NavBreadcrumb extends Breadcrumb {
-    path: string;
+    itemId: string;
 }
 
 interface NavMenuItem extends MainAppBarMenuItem {
@@ -98,15 +99,7 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
     state = {
         anchorEl: null,
         searchText: "",
-        breadcrumbs: [
-            {
-                label: "Projects",
-                path: "/projects"
-            }, {
-                label: "Project 1",
-                path: "/projects/project-1"
-            }
-        ],
+        breadcrumbs: [],
         menuItems: {
             accountMenu: [
                 {
@@ -135,7 +128,9 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
 
 
     mainAppBarActions: MainAppBarActionProps = {
-        onBreadcrumbClick: (breadcrumb: NavBreadcrumb) => this.props.dispatch(push(breadcrumb.path)),
+        onBreadcrumbClick: ({ itemId }: NavBreadcrumb) => {
+            this.toggleProjectTreeItem(itemId);
+        },
         onSearch: searchText => {
             this.setState({ searchText });
             this.props.dispatch(push(`/search?q=${searchText}`));
@@ -144,6 +139,13 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
     };
 
     toggleProjectTreeItem = (itemId: string) => {
+        const branch = findTreeBranch(this.props.projects, itemId);
+        this.setState({
+            breadcrumbs: branch.map(item => ({
+                label: item.data.name,
+                itemId: item.data.uuid
+            }))
+        });
         this.props.dispatch<any>(projectService.getProjectList(itemId)).then(() => {
             this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(itemId));
         });
@@ -163,16 +165,16 @@ class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
                     />
                 </div>
                 {user &&
-                <Drawer
-                    variant="permanent"
-                    classes={{
-                        paper: classes.drawerPaper,
-                    }}>
-                    <div className={classes.toolbar}/>
-                    <ProjectTree
-                        projects={this.props.projects}
-                        toggleProjectTreeItem={this.toggleProjectTreeItem}/>
-                </Drawer>}
+                    <Drawer
+                        variant="permanent"
+                        classes={{
+                            paper: classes.drawerPaper,
+                        }}>
+                        <div className={classes.toolbar} />
+                        <ProjectTree
+                            projects={this.props.projects}
+                            toggleProjectTreeItem={this.toggleProjectTreeItem} />
+                    </Drawer>}
                 <main className={classes.content}>
                     <div className={classes.toolbar} />
                     <div className={classes.toolbar} />

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list