X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/9fbb245286171bc55fed5b5104361a1869a1d76b..a2bf1ed3a15cf55e426c51ad8e6febd7ff2e3020:/src/views/workbench/workbench.tsx diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx index a0619ae3..ad1a2668 100644 --- a/src/views/workbench/workbench.tsx +++ b/src/views/workbench/workbench.tsx @@ -6,10 +6,9 @@ import * as React from 'react'; import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; import { connect, DispatchProp } from "react-redux"; import { Route, Switch } from "react-router"; -import { login, logout } from "~/store/auth/auth-action"; import { User } from "~/models/user"; import { RootState } from "~/store/store"; -import { MainAppBar, MainAppBarActionProps, MainAppBarMenuItem } from '~/views-components/main-app-bar/main-app-bar'; +import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar'; import { push } from 'react-router-redux'; import { ProjectPanel } from "~/views/project-panel/project-panel"; import { DetailsPanel } from '~/views-components/details-panel/details-panel'; @@ -27,55 +26,66 @@ import { MultipleFilesRemoveDialog } from '~/views-components/file-remove-dialog import { Routes } from '~/routes/routes'; import { SidePanel } from '~/views-components/side-panel/side-panel'; import { ProcessPanel } from '~/views/process-panel/process-panel'; -import { Breadcrumbs } from '~/views-components/breadcrumbs/breadcrumbs'; +import { ProcessLogPanel } from '~/views/process-log-panel/process-log-panel'; import { CreateProjectDialog } from '~/views-components/dialog-forms/create-project-dialog'; import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-collection-dialog'; import { CopyCollectionDialog } from '~/views-components/dialog-forms/copy-collection-dialog'; +import { CopyProcessDialog } from '~/views-components/dialog-forms/copy-process-dialog'; import { UpdateCollectionDialog } from '~/views-components/dialog-forms/update-collection-dialog'; +import { UpdateProcessDialog } from '~/views-components/dialog-forms/update-process-dialog'; import { UpdateProjectDialog } from '~/views-components/dialog-forms/update-project-dialog'; +import { MoveProcessDialog } from '~/views-components/dialog-forms/move-process-dialog'; import { MoveProjectDialog } from '~/views-components/dialog-forms/move-project-dialog'; import { MoveCollectionDialog } from '~/views-components/dialog-forms/move-collection-dialog'; - import { FilesUploadCollectionDialog } from '~/views-components/dialog-forms/files-upload-collection-dialog'; import { PartialCopyCollectionDialog } from '~/views-components/dialog-forms/partial-copy-collection-dialog'; +import { TrashPanel } from "~/views/trash-panel/trash-panel"; +import { MainContentBar } from '~/views-components/main-content-bar/main-content-bar'; +import { Grid, LinearProgress } from '@material-ui/core'; +import { SharedWithMePanel } from '../shared-with-me-panel/shared-with-me-panel'; +import SplitterLayout from 'react-splitter-layout'; +import { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog'; +import { isSystemWorking } from "~/store/progress-indicator/progress-indicator-reducer"; -const APP_BAR_HEIGHT = 100; - -type CssRules = 'root' | 'appBar' | 'content' | 'contentWrapper'; +type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content' | 'appBar'; const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ root: { - flexGrow: 1, - zIndex: 1, overflow: 'hidden', - position: 'relative', - display: 'flex', width: '100vw', - height: '100vh' + height: '100vh', + paddingTop: theme.spacing.unit * 8 }, - appBar: { - zIndex: theme.zIndex.drawer + 1, - position: "absolute", - width: "100%" + container: { + position: 'relative' + }, + splitter: { + '& > .layout-splitter': { + width: '2px' + } + }, + asidePanel: { + height: '100%', + background: theme.palette.background.default }, contentWrapper: { - backgroundColor: theme.palette.background.default, - display: "flex", - flexGrow: 1, + background: theme.palette.background.default, minWidth: 0, - paddingTop: APP_BAR_HEIGHT }, content: { - padding: `${theme.spacing.unit}px ${theme.spacing.unit * 3}px`, - overflowY: "auto", - flexGrow: 1, - position: 'relative' + minWidth: 0, + paddingLeft: theme.spacing.unit * 3, + paddingRight: theme.spacing.unit * 3, }, + appBar: { + zIndex: 1, + } }); interface WorkbenchDataProps { user?: User; currentToken?: string; + working: boolean; } interface WorkbenchGeneralProps { @@ -83,24 +93,10 @@ interface WorkbenchGeneralProps { buildInfo: string; } -interface WorkbenchActionProps { -} - -type WorkbenchProps = WorkbenchDataProps & WorkbenchGeneralProps & WorkbenchActionProps & DispatchProp & WithStyles; - -interface NavMenuItem extends MainAppBarMenuItem { - action: () => void; -} +type WorkbenchProps = WorkbenchDataProps & WorkbenchGeneralProps & DispatchProp & WithStyles; interface WorkbenchState { - isCurrentTokenDialogOpen: boolean; - anchorEl: any; searchText: string; - menuItems: { - accountMenu: NavMenuItem[], - helpMenu: NavMenuItem[], - anonymousMenu: NavMenuItem[] - }; } export const Workbench = withStyles(styles)( @@ -108,106 +104,88 @@ export const Workbench = withStyles(styles)( (state: RootState) => ({ user: state.auth.user, currentToken: state.auth.apiToken, + working: isSystemWorking(state.progressIndicator) }) )( class extends React.Component { state = { - isCurrentTokenDialogOpen: false, - anchorEl: null, searchText: "", - breadcrumbs: [], - menuItems: { - accountMenu: [ - { - label: 'Current token', - action: () => this.toggleCurrentTokenModal() - }, - { - label: "Logout", - action: () => this.props.dispatch(logout()) - }, - { - label: "My account", - action: () => this.props.dispatch(push("/my-account")) - } - ], - helpMenu: [ - { - label: "Help", - action: () => this.props.dispatch(push("/help")) - } - ], - anonymousMenu: [ - { - label: "Sign in", - action: () => this.props.dispatch(login()) - } - ] - } }; - render() { - const { classes, user } = this.props; - return ( -
-
- -
- {user && } -
-
- - - - - - -
- {user && } -
- - - - - - - - - - - - - - - - -
- ); + const { classes } = this.props; + return <> + + {this.props.working ? : null} + + + {this.props.user && + + + + + + + + + + + + + + + + + + + + + + + + + + + + + } + + + + + + + + + + + + + + + + + + + + + + ; } - mainAppBarActions: MainAppBarActionProps = { - onSearch: searchText => { - this.setState({ searchText }); - this.props.dispatch(push(`/search?q=${searchText}`)); - }, - onMenuItemClick: (menuItem: NavMenuItem) => menuItem.action(), - onDetailsPanelToggle: () => { - this.props.dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); - }, - }; + onSearch = (searchText: string) => { + this.setState({ searchText }); + this.props.dispatch(push(`/search?q=${searchText}`)); + } - toggleCurrentTokenModal = () => { - this.setState({ isCurrentTokenDialogOpen: !this.state.isCurrentTokenDialogOpen }); + toggleDetailsPanel = () => { + this.props.dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL()); } + } ) );