X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/3b6cfdaf240a9a542cd5845524702aaf25a98e2c..b321c4ab41ef13dfb43c7e64aee395c4db161872:/src/views/run-process-panel/inputs/directory-input.tsx

diff --git a/src/views/run-process-panel/inputs/directory-input.tsx b/src/views/run-process-panel/inputs/directory-input.tsx
index 2120de99..1faf7381 100644
--- a/src/views/run-process-panel/inputs/directory-input.tsx
+++ b/src/views/run-process-panel/inputs/directory-input.tsx
@@ -6,7 +6,7 @@ import React from 'react';
 import { connect, DispatchProp } from 'react-redux';
 import { memoize } from 'lodash/fp';
 import { Field } from 'redux-form';
-import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core';
+import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button, StyleRulesCallback, withStyles, WithStyles } from '@material-ui/core';
 import {
     isRequiredInput,
     DirectoryCommandInputParameter,
@@ -26,6 +26,9 @@ export interface DirectoryInputProps {
     input: DirectoryCommandInputParameter;
     options?: { showOnlyOwned: boolean, showOnlyWritable: boolean };
 }
+
+type DialogContentCssRules = 'root';
+
 export const DirectoryInput = ({ input, options }: DirectoryInputProps) =>
     <Field
         name={input.id}
@@ -114,6 +117,12 @@ const DirectoryInputComponent = connect()(
                 {...this.props} />;
         }
 
+        dialogContentStyles: StyleRulesCallback<DialogContentCssRules> = ({ spacing }) => ({
+            root: {
+                height: `${spacing.unit * 8}vh`,
+            },
+        });
+
         renderDialog() {
             return <Dialog
                 open={this.state.open}
@@ -123,11 +132,7 @@ const DirectoryInputComponent = connect()(
                 maxWidth='md'>
                 <DialogTitle>Choose a directory</DialogTitle>
                 <DialogContent>
-                    <ProjectsTreePicker
-                        pickerId={this.props.commandInput.id}
-                        includeCollections
-                        options={this.props.options}
-                        toggleItemActive={this.setDirectory} />
+                    <this.dialogContent />
                 </DialogContent>
                 <DialogActions>
                     <Button onClick={this.closeDialog}>Cancel</Button>
@@ -140,4 +145,15 @@ const DirectoryInputComponent = connect()(
             </Dialog>;
         }
 
+        dialogContent = withStyles(this.dialogContentStyles)(
+            ({ classes }: WithStyles<DialogContentCssRules>) =>
+                <div className={classes.root}>
+                    <ProjectsTreePicker
+                        pickerId={this.props.commandInput.id}
+                        includeCollections
+                        options={this.props.options}
+                        toggleItemActive={this.setDirectory} />
+                </div>
+        );
+
     });
