X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/c324b64f3b26e79b4640b6f0cf55671f1a261bca..62cb779efb0b098c05053e957c765a807467b28b:/src/components/form-dialog/form-dialog.tsx diff --git a/src/components/form-dialog/form-dialog.tsx b/src/components/form-dialog/form-dialog.tsx index 40050b76..b50504a6 100644 --- a/src/components/form-dialog/form-dialog.tsx +++ b/src/components/form-dialog/form-dialog.tsx @@ -2,13 +2,13 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; +import React from 'react'; import { InjectedFormProps } from 'redux-form'; import { Dialog, DialogActions, DialogContent, DialogTitle } from '@material-ui/core/'; import { Button, StyleRulesCallback, WithStyles, withStyles, CircularProgress } from '@material-ui/core'; -import { WithDialogProps } from '~/store/dialog/with-dialog'; +import { WithDialogProps } from 'store/dialog/with-dialog'; -type CssRules = "button" | "lastButton" | "formContainer" | "dialogTitle" | "progressIndicator" | "dialogActions"; +type CssRules = "button" | "lastButton" | "form" | "formContainer" | "dialogTitle" | "progressIndicator" | "dialogActions"; const styles: StyleRulesCallback = theme => ({ button: { @@ -16,22 +16,30 @@ const styles: StyleRulesCallback = theme => ({ }, lastButton: { marginLeft: theme.spacing.unit, - marginRight: "20px", + marginRight: "0", + }, + form: { + display: 'flex', + overflowY: 'auto', + flexDirection: 'column', + flex: '0 1 auto', }, formContainer: { display: "flex", flexDirection: "column", - marginTop: "20px", + paddingBottom: "0", }, dialogTitle: { - paddingBottom: "0" + paddingTop: theme.spacing.unit, + paddingBottom: theme.spacing.unit, }, progressIndicator: { position: "absolute", minWidth: "20px", }, dialogActions: { - marginBottom: theme.spacing.unit * 3 + marginBottom: theme.spacing.unit, + marginRight: theme.spacing.unit * 3, } }); @@ -40,6 +48,9 @@ interface DialogProjectDataProps { dialogTitle: string; formFields: React.ComponentType & WithDialogProps>; submitLabel?: string; + cancelCallback?: Function; + enableWhenPristine?: boolean; + doNotDisableCancel?: boolean; } type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps & WithStyles; @@ -48,11 +59,11 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) => -
+ maxWidth='md'> + {props.dialogTitle} @@ -61,18 +72,28 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
); - -