X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/811f596a423314b60b9953bbaba48afeb47841ab..847ac07f82a1432d6472390aab5e8c2198d425a5:/src/views/workbench/workbench.tsx

diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index 0e85ca3e84..47e2254150 100644
--- a/src/views/workbench/workbench.tsx
+++ b/src/views/workbench/workbench.tsx
@@ -4,22 +4,16 @@
 
 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 { User } from "~/models/user";
-import { RootState } from "~/store/store";
-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';
 import { ArvadosTheme } from '~/common/custom-theme';
-import { detailsPanelActions } from "~/store/details-panel/details-panel-action";
 import { ContextMenu } from "~/views-components/context-menu/context-menu";
 import { FavoritePanel } from "../favorite-panel/favorite-panel";
 import { CurrentTokenDialog } from '~/views-components/current-token-dialog/current-token-dialog';
+import { RichTextEditorDialog } from '~/views-components/rich-text-editor-dialog/rich-text-editor-dialog';
 import { Snackbar } from '~/views-components/snackbar/snackbar';
 import { CollectionPanel } from '../collection-panel/collection-panel';
-import { AuthService } from "~/services/auth-service/auth-service";
 import { RenameFileDialog } from '~/views-components/rename-file-dialog/rename-file-dialog';
 import { FileRemoveDialog } from '~/views-components/file-remove-dialog/file-remove-dialog';
 import { MultipleFilesRemoveDialog } from '~/views-components/file-remove-dialog/multiple-files-remove-dialog';
@@ -32,146 +26,106 @@ import { CreateCollectionDialog } from '~/views-components/dialog-forms/create-c
 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 { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
+import { MainContentBar } from '~/views-components/main-content-bar/main-content-bar';
 import { Grid } from '@material-ui/core';
+import { TrashPanel } from "~/views/trash-panel/trash-panel";
+import { SharedWithMePanel } from '~/views/shared-with-me-panel/shared-with-me-panel';
+import { RunProcessPanel } from '~/views/run-process-panel/run-process-panel';
+import SplitterLayout from 'react-splitter-layout';
+import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel';
 
-type CssRules = 'root' | 'contentWrapper' | 'content' | 'appBar';
+type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
-        overflow: 'hidden',
-        width: '100vw',
-        height: '100vh'
+        paddingTop: theme.spacing.unit * 7,
+        background: theme.palette.background.default
+    },
+    container: {
+        position: 'relative'
+    },
+    splitter: {
+        '& > .layout-splitter': {
+            width: '2px'
+        }
+    },
+    asidePanel: {
+        paddingTop: theme.spacing.unit,
+        height: '100%'
     },
     contentWrapper: {
-        background: theme.palette.background.default,
-        minWidth: 0,
+        paddingTop: theme.spacing.unit,
+        minWidth: 0
     },
     content: {
         minWidth: 0,
-        overflow: 'auto',
         paddingLeft: theme.spacing.unit * 3,
         paddingRight: theme.spacing.unit * 3,
-    },
-    appBar: {
-        zIndex: 1,
     }
 });
 
-interface WorkbenchDataProps {
-    user?: User;
-    currentToken?: string;
-}
-
-interface WorkbenchGeneralProps {
-    authService: AuthService;
-    buildInfo: string;
-}
+type WorkbenchPanelProps = WithStyles<CssRules>;
 
-type WorkbenchProps = WorkbenchDataProps & WorkbenchGeneralProps & DispatchProp<any> & WithStyles<CssRules>;
-
-interface WorkbenchState {
-    searchText: string;
-}
-
-export const Workbench = withStyles(styles)(
-    connect<WorkbenchDataProps>(
-        (state: RootState) => ({
-            user: state.auth.user,
-            currentToken: state.auth.apiToken,
-        })
-    )(
-        class extends React.Component<WorkbenchProps, WorkbenchState> {
-            state = {
-                searchText: "",
-            };
-
-            render() {
-                return <>
-                    <Grid
-                        container
-                        direction="column"
-                        className={this.props.classes.root}>
-                        <Grid className={this.props.classes.appBar}>
-                            <MainAppBar
-                                searchText={this.state.searchText}
-                                user={this.props.user}
-                                onSearch={this.onSearch}
-                                buildInfo={this.props.buildInfo} />
+export const WorkbenchPanel = 
+    withStyles(styles)(({ classes }: WorkbenchPanelProps) => 
+        <Grid container item xs className={classes.root}>
+            <Grid container item xs className={classes.container}>
+                <SplitterLayout customClassName={classes.splitter} percentage={true}
+                    primaryIndex={0} primaryMinSize={20} secondaryInitialSize={80} secondaryMinSize={40}>
+                    <Grid container item xs component='aside' direction='column' className={classes.asidePanel}>
+                        <SidePanel />
+                    </Grid>
+                    <Grid container item xs component="main" direction="column" className={classes.contentWrapper}>
+                        <Grid item>
+                            <MainContentBar />
+                        </Grid>
+                        <Grid item xs className={classes.content}>
+                            <Switch>
+                                <Route path={Routes.PROJECTS} component={ProjectPanel} />
+                                <Route path={Routes.COLLECTIONS} component={CollectionPanel} />
+                                <Route path={Routes.FAVORITES} component={FavoritePanel} />
+                                <Route path={Routes.PROCESSES} component={ProcessPanel} />
+                                <Route path={Routes.TRASH} component={TrashPanel} />
+                                <Route path={Routes.PROCESS_LOGS} component={ProcessLogPanel} />
+                                <Route path={Routes.SHARED_WITH_ME} component={SharedWithMePanel} />
+                                <Route path={Routes.RUN_PROCESS} component={RunProcessPanel} />
+                                <Route path={Routes.WORKFLOWS} component={WorkflowPanel} />
+                            </Switch>
                         </Grid>
-                        {this.props.user &&
-                            <Grid
-                                container
-                                item
-                                xs
-                                alignItems="stretch"
-                                wrap="nowrap">
-                                <Grid item>
-                                    <SidePanel />
-                                </Grid>
-                                <Grid
-                                    container
-                                    item
-                                    xs
-                                    component="main"
-                                    direction="column"
-                                    className={this.props.classes.contentWrapper}>
-                                    <Grid item>
-                                        <MainContentBar />
-                                    </Grid>
-                                    <Grid item xs className={this.props.classes.content}>
-                                        <Switch>
-                                            <Route path={Routes.PROJECTS} component={ProjectPanel} />
-                                            <Route path={Routes.COLLECTIONS} component={CollectionPanel} />
-                                            <Route path={Routes.FAVORITES} component={FavoritePanel} />
-                                            <Route path={Routes.PROCESSES} component={ProcessPanel} />
-                                            <Route path={Routes.TRASH} component={TrashPanel} />
-                                            <Route path={Routes.PROCESS_LOGS} component={ProcessLogPanel} />
-                                        </Switch>
-                                    </Grid>
-                                </Grid>
-                                <Grid item>
-                                    <DetailsPanel />
-                                </Grid>
-                            </Grid>}
                     </Grid>
-                    <ContextMenu />
-                    <Snackbar />
-                    <CreateProjectDialog />
-                    <CreateCollectionDialog />
-                    <RenameFileDialog />
-                    <PartialCopyCollectionDialog />
-                    <FileRemoveDialog />
-                    <CopyCollectionDialog />
-                    <CopyProcessDialog />
-                    <FileRemoveDialog />
-                    <MultipleFilesRemoveDialog />
-                    <UpdateCollectionDialog />
-                    <FilesUploadCollectionDialog />
-                    <UpdateProjectDialog />
-                    <MoveCollectionDialog />
-                    <MoveProcessDialog />
-                    <MoveProjectDialog />
-                    <CurrentTokenDialog />
-                </>;
-            }
-
-            onSearch = (searchText: string) => {
-                this.setState({ searchText });
-                this.props.dispatch(push(`/search?q=${searchText}`));
-            }
-
-            toggleDetailsPanel = () => {
-                this.props.dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
-            }
-
-        }
-    )
-);
+                </SplitterLayout>
+            </Grid>
+            <Grid item>
+                <DetailsPanel />
+            </Grid>
+            <ContextMenu />
+            <CopyCollectionDialog />
+            <CopyProcessDialog />
+            <CreateCollectionDialog />
+            <CreateProjectDialog />
+            <CurrentTokenDialog />
+            <FileRemoveDialog />
+            <FileRemoveDialog />
+            <FilesUploadCollectionDialog />
+            <MoveCollectionDialog />
+            <MoveProcessDialog />
+            <MoveProjectDialog />
+            <MultipleFilesRemoveDialog />
+            <PartialCopyCollectionDialog />
+            <ProcessCommandDialog />
+            <RenameFileDialog />
+            <RichTextEditorDialog />
+            <Snackbar />
+            <UpdateCollectionDialog />
+            <UpdateProcessDialog />
+            <UpdateProjectDialog />
+        </Grid>
+    );
