15685: Expands file renaming tests exposing some edge cases.
[arvados.git] / src / components / form-dialog / form-dialog.tsx
index 150dc4b66519da12c402f851934e4df36876b7fb..8c847ca48e77acb5ba33670d1cf0e8da4dc64200 100644 (file)
@@ -16,41 +16,45 @@ const styles: StyleRulesCallback<CssRules> = theme => ({
     },
     lastButton: {
         marginLeft: theme.spacing.unit,
-        marginRight: "20px",
+        marginRight: "0",
     },
     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: "24px"
+        marginBottom: theme.spacing.unit,
+        marginRight: theme.spacing.unit * 3,
     }
 });
 
-interface DialogProjectProps {
+interface DialogProjectDataProps {
     cancelLabel?: string;
     dialogTitle: string;
     formFields: React.ComponentType<InjectedFormProps<any> & WithDialogProps<any>>;
     submitLabel?: string;
 }
 
-export const FormDialog = withStyles(styles)((props: DialogProjectProps & WithDialogProps<{}> & InjectedFormProps<any> & WithStyles<CssRules>) =>
+type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps<any> & WithStyles<CssRules>;
+
+export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
     <Dialog
         open={props.open}
         onClose={props.closeDialog}
-        disableBackdropClick={props.submitting}
+        disableBackdropClick
         disableEscapeKeyDown={props.submitting}
         fullWidth
-        maxWidth='sm'>
-        <form>
+        maxWidth='md'>
+        <form data-cy='form-dialog'>
             <DialogTitle className={props.classes.dialogTitle}>
                 {props.dialogTitle}
             </DialogTitle>
@@ -59,6 +63,7 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps & WithDi
             </DialogContent>
             <DialogActions className={props.classes.dialogActions}>
                 <Button
+                    data-cy='form-cancel-btn'
                     onClick={props.closeDialog}
                     className={props.classes.button}
                     color="primary"
@@ -66,6 +71,8 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps & WithDi
                     {props.cancelLabel || 'Cancel'}
                 </Button>
                 <Button
+                    data-cy='form-submit-btn'
+                    type="submit"
                     onClick={props.handleSubmit}
                     className={props.classes.lastButton}
                     color="primary"