projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
18169: Removed cancel disable when uploading
[arvados-workbench2.git]
/
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 19145cea34ae12b62813742e8c20acfb419b5f13..0fc799dee92b62eb0ab58a6ce100403dc7477193 100644
(file)
--- a/
src/components/form-dialog/form-dialog.tsx
+++ b/
src/components/form-dialog/form-dialog.tsx
@@
-42,7
+42,9
@@
interface DialogProjectDataProps {
dialogTitle: string;
formFields: React.ComponentType<InjectedFormProps<any> & WithDialogProps<any>>;
submitLabel?: string;
dialogTitle: string;
formFields: React.ComponentType<InjectedFormProps<any> & WithDialogProps<any>>;
submitLabel?: string;
+ cancelCallback?: Function;
enableWhenPristine?: boolean;
enableWhenPristine?: boolean;
+ doNotDisableCancel?: boolean;
}
type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps<any> & WithStyles<CssRules>;
}
type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps<any> & WithStyles<CssRules>;
@@
-65,10
+67,18
@@
export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
<DialogActions className={props.classes.dialogActions}>
<Button
data-cy='form-cancel-btn'
<DialogActions className={props.classes.dialogActions}>
<Button
data-cy='form-cancel-btn'
- onClick={props.closeDialog}
+ onClick={() => {
+ props.closeDialog();
+
+ if (props.cancelCallback) {
+ props.cancelCallback();
+ props.reset();
+ props.initialize({});
+ }
+ }}
className={props.classes.button}
color="primary"
className={props.classes.button}
color="primary"
- disabled={props.submitting}>
+ disabled={props.
doNotDisableCancel ? false : props.
submitting}>
{props.cancelLabel || 'Cancel'}
</Button>
<Button
{props.cancelLabel || 'Cancel'}
</Button>
<Button