projects
/
arvados.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master'
[arvados.git]
/
src
/
views
/
workbench
/
workbench.tsx
diff --git
a/src/views/workbench/workbench.tsx
b/src/views/workbench/workbench.tsx
index 20e3648e0561151c8d63fd57ef04858206f5d914..0aecc0d2b578e7045c4a6a37a892c5492cf81e65 100644
(file)
--- a/
src/views/workbench/workbench.tsx
+++ b/
src/views/workbench/workbench.tsx
@@
-19,6
+19,7
@@
import ProjectTree from '../../components/project-tree/project-tree';
import { TreeItem, TreeItemStatus } from "../../components/tree/tree";
import { Project } from "../../models/project";
import { projectService } from '../../services/services';
import { TreeItem, TreeItemStatus } from "../../components/tree/tree";
import { Project } from "../../models/project";
import { projectService } from '../../services/services';
+import { findTreeBranch } from '../../store/project/project-reducer';
import DataExplorer from '../data-explorer/data-explorer';
const drawerWidth = 240;
import DataExplorer from '../data-explorer/data-explorer';
const drawerWidth = 240;
@@
-66,7
+67,8
@@
interface WorkbenchActionProps {
type WorkbenchProps = WorkbenchDataProps & WorkbenchActionProps & DispatchProp & WithStyles<CssRules>;
interface NavBreadcrumb extends Breadcrumb {
type WorkbenchProps = WorkbenchDataProps & WorkbenchActionProps & DispatchProp & WithStyles<CssRules>;
interface NavBreadcrumb extends Breadcrumb {
- path: string;
+ itemId: string;
+ status: TreeItemStatus;
}
interface NavMenuItem extends MainAppBarMenuItem {
}
interface NavMenuItem extends MainAppBarMenuItem {
@@
-88,15
+90,7
@@
class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
state = {
anchorEl: null,
searchText: "",
state = {
anchorEl: null,
searchText: "",
- breadcrumbs: [
- {
- label: "Projects",
- path: "/projects"
- }, {
- label: "Project 1",
- path: "/projects/project-1"
- }
- ],
+ breadcrumbs: [],
menuItems: {
accountMenu: [
{
menuItems: {
accountMenu: [
{
@@
-125,7
+119,9
@@
class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
mainAppBarActions: MainAppBarActionProps = {
mainAppBarActions: MainAppBarActionProps = {
- onBreadcrumbClick: (breadcrumb: NavBreadcrumb) => this.props.dispatch(push(breadcrumb.path)),
+ onBreadcrumbClick: ({ itemId, status }: NavBreadcrumb) => {
+ this.toggleProjectTreeItem(itemId, status);
+ },
onSearch: searchText => {
this.setState({ searchText });
this.props.dispatch(push(`/search?q=${searchText}`));
onSearch: searchText => {
this.setState({ searchText });
this.props.dispatch(push(`/search?q=${searchText}`));
@@
-142,6
+138,14
@@
class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
}
openProjectItem = (itemId: string) => {
}
openProjectItem = (itemId: string) => {
+ const branch = findTreeBranch(this.props.projects, itemId);
+ this.setState({
+ breadcrumbs: branch.map(item => ({
+ label: item.data.name,
+ itemId: item.data.uuid,
+ status: item.status
+ }))
+ });
this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(itemId));
this.props.dispatch(push(`/project/${itemId}`));
}
this.props.dispatch(projectActions.TOGGLE_PROJECT_TREE_ITEM(itemId));
this.props.dispatch(push(`/project/${itemId}`));
}
@@
-171,6
+175,7
@@
class Workbench extends React.Component<WorkbenchProps, WorkbenchState> {
toggleProjectTreeItem={this.toggleProjectTreeItem} />
</Drawer>}
<main className={classes.content}>
toggleProjectTreeItem={this.toggleProjectTreeItem} />
</Drawer>}
<main className={classes.content}>
+ <div className={classes.toolbar} />
<div className={classes.toolbar} />
<Switch>
<Route path="/project/:name" component={DataExplorer} />
<div className={classes.toolbar} />
<Switch>
<Route path="/project/:name" component={DataExplorer} />