Mergeg branch 'master'
[arvados-workbench2.git] / src / views / workbench / workbench.tsx
index 9f1ab478ffc63f8f042af94eb6c3dd87dddd3978..1d7d47d09ee89f8085312cf2b0a1b804f823e07c 100644 (file)
@@ -44,8 +44,9 @@ import { MainContentBar } from '~/views-components/main-content-bar/main-content
 import { Grid } from '@material-ui/core';
 import { SharedWithMePanel } from '../shared-with-me-panel/shared-with-me-panel';
 import { ProcessCommandDialog } from '~/views-components/process-command-dialog/process-command-dialog';
+import SplitterLayout from 'react-splitter-layout';
 
-type CssRules = 'root' | 'asidePanel' | 'contentWrapper' | 'content' | 'appBar';
+type CssRules = 'root' | 'container' | 'splitter' | 'asidePanel' | 'contentWrapper' | 'content' | 'appBar';
 
 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     root: {
@@ -53,8 +54,16 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
         width: '100vw',
         height: '100vh'
     },
+    container: {
+        position: 'relative'
+    },
+    splitter: {
+        '& > .layout-splitter': {
+            width: '2px'
+        }
+    },
     asidePanel: {
-        maxWidth: '240px',
+        height: '100%',
         background: theme.palette.background.default
     },
     contentWrapper: {
@@ -63,7 +72,6 @@ const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
     },
     content: {
         minWidth: 0,
-        overflow: 'auto',
         paddingLeft: theme.spacing.unit * 3,
         paddingRight: theme.spacing.unit * 3,
     },
@@ -112,29 +120,35 @@ export const Workbench = withStyles(styles)(
                         </Grid>
                         {this.props.user &&
                             <Grid container item xs alignItems="stretch" wrap="nowrap">
-                                <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 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>}
+                            </Grid>
+                        }
                     </Grid>
                     <ContextMenu />
                     <CopyCollectionDialog />