X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/db1c206c8403ed2b874625f1d1afc7af85dde25c..215d0b7a7e1f69765c5f2a1139e52d8c427066eb:/src/views/run-process-panel/inputs/project-input.tsx diff --git a/src/views/run-process-panel/inputs/project-input.tsx b/src/views/run-process-panel/inputs/project-input.tsx index 9cf16c31e7..ef6d08f400 100644 --- a/src/views/run-process-panel/inputs/project-input.tsx +++ b/src/views/run-process-panel/inputs/project-input.tsx @@ -5,7 +5,7 @@ import React from 'react'; import { connect, DispatchProp } from 'react-redux'; import { Field } from 'redux-form'; -import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button } from '@material-ui/core'; +import { Input, Dialog, DialogTitle, DialogContent, DialogActions, Button, withStyles, WithStyles, StyleRulesCallback } from '@material-ui/core'; import { GenericCommandInputParameter } from 'models/workflow'; @@ -27,6 +27,9 @@ export interface ProjectInputProps { input: ProjectCommandInputParameter; options?: { showOnlyOwned: boolean, showOnlyWritable: boolean }; } + +type DialogContentCssRules = 'root' | 'pickerWrapper'; + export const ProjectInput = ({ input, options }: ProjectInputProps) => {this.renderInput()} - {this.renderDialog()} + ; } @@ -109,29 +112,44 @@ export const ProjectInputComponent = connect(mapStateToProps)( {...this.props} />; } - renderDialog() { - return this.state.open ? - Choose a project - - - - - - - - : null; - } + dialogContentStyles: StyleRulesCallback = ({ spacing }) => ({ + root: { + display: 'flex', + flexDirection: 'column', + }, + pickerWrapper: { + flexBasis: `${spacing.unit * 8}vh`, + flexShrink: 1, + minHeight: 0, + }, + }); + + dialog = withStyles(this.dialogContentStyles)( + ({ classes }: WithStyles) => + this.state.open ? + Choose a project + +
+ +
+
+ + + + +
: null + ); });