X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/a2bf1ed3a15cf55e426c51ad8e6febd7ff2e3020..1514f6a2ae8103f75f08034299115ad751d8a785:/src/views/workbench/workbench.tsx

diff --git a/src/views/workbench/workbench.tsx b/src/views/workbench/workbench.tsx
index ad1a2668..553afa4d 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';
@@ -39,22 +33,22 @@ import { MoveProjectDialog } from '~/views-components/dialog-forms/move-project-
 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 { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
 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 { 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 { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
-import { isSystemWorking } from "~/store/progress-indicator/progress-indicator-reducer";
+import { WorkflowPanel } from '~/views/workflow-panel/workflow-panel';
+import { FileSelectionDialog } from '~/views-components/dialog-forms/file-selection-dialog';
 
-type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | '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 * 8
+        paddingTop: theme.spacing.unit * 7,
+        background: theme.palette.background.default
     },
     container: {
         position: 'relative'
@@ -65,127 +59,75 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         }
     },
     asidePanel: {
-        height: '100%',
-        background: theme.palette.background.default
+        paddingTop: theme.spacing.unit,
+        height: '100%'
     },
     contentWrapper: {
-        background: theme.palette.background.default,
-        minWidth: 0,
+        paddingTop: theme.spacing.unit,
+        minWidth: 0
     },
     content: {
         minWidth: 0,
         paddingLeft: theme.spacing.unit * 3,
         paddingRight: theme.spacing.unit * 3,
-    },
-    appBar: {
-        zIndex: 1,
     }
 });
 
-interface WorkbenchDataProps {
-    user?: User;
-    currentToken?: string;
-    working: boolean;
-}
+type WorkbenchPanelProps = WithStyles<CssRules>;
 
-interface WorkbenchGeneralProps {
-    authService: AuthService;
-    buildInfo: string;
-}
-
-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,
-            working: isSystemWorking(state.progressIndicator)
-        })
-    )(
-        class extends React.Component<WorkbenchProps, WorkbenchState> {
-            state = {
-                searchText: "",
-            };
-            render() {
-                const { classes } = this.props;
-                return <>
-                    <MainAppBar
-                        searchText={this.state.searchText}
-                        user={this.props.user}
-                        onSearch={this.onSearch}
-                        buildInfo={this.props.buildInfo}>
-                        {this.props.working ? <LinearProgress color="secondary" /> : null}
-                    </MainAppBar>
-                    <Grid container direction="column" className={classes.root}>
-                        {this.props.user &&
-                            <Grid container item xs alignItems="stretch" wrap="nowrap">
-                                <Grid container item 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} />
-                                                </Switch>
-                                            </Grid>
-                                        </Grid>
-                                    </SplitterLayout>
-                                </Grid>
-                                <Grid item>
-                                    <DetailsPanel />
-                                </Grid>
-                            </Grid>
-                        }
+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={15} secondaryInitialSize={85} secondaryMinSize={40}>
+                    <Grid container item xs component='aside' direction='column' className={classes.asidePanel}>
+                        <SidePanel />
                     </Grid>
-                    <ContextMenu />
-                    <CopyCollectionDialog />
-                    <CopyProcessDialog />
-                    <CreateCollectionDialog />
-                    <CreateProjectDialog />
-                    <CurrentTokenDialog />
-                    <FileRemoveDialog />
-                    <FileRemoveDialog />
-                    <FilesUploadCollectionDialog />
-                    <MoveCollectionDialog />
-                    <MoveProcessDialog />
-                    <MoveProjectDialog />
-                    <MultipleFilesRemoveDialog />
-                    <PartialCopyCollectionDialog />
-                    <ProcessCommandDialog />
-                    <RenameFileDialog />
-                    <Snackbar />
-                    <UpdateCollectionDialog />
-                    <UpdateProcessDialog />
-                    <UpdateProjectDialog />
-                </>;
-            }
-
-            onSearch = (searchText: string) => {
-                this.setState({ searchText });
-                this.props.dispatch(push(`/search?q=${searchText}`));
-            }
-
-            toggleDetailsPanel = () => {
-                this.props.dispatch(detailsPanelActions.TOGGLE_DETAILS_PANEL());
-            }
-
-        }
-    )
-);
+                    <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>
+                    </Grid>
+                </SplitterLayout>
+            </Grid>
+            <Grid item>
+                <DetailsPanel />
+            </Grid>
+            <ContextMenu />
+            <CopyCollectionDialog />
+            <CopyProcessDialog />
+            <CreateCollectionDialog />
+            <CreateProjectDialog />
+            <CurrentTokenDialog />
+            <FileRemoveDialog />
+            <FileRemoveDialog />
+            <FileSelectionDialog />
+            <FilesUploadCollectionDialog />
+            <MoveCollectionDialog />
+            <MoveProcessDialog />
+            <MoveProjectDialog />
+            <MultipleFilesRemoveDialog />
+            <PartialCopyCollectionDialog />
+            <ProcessCommandDialog />
+            <RenameFileDialog />
+            <RichTextEditorDialog />
+            <Snackbar />
+            <UpdateCollectionDialog />
+            <UpdateProcessDialog />
+            <UpdateProjectDialog />
+        </Grid>
+    );
