From: Peter Amstutz Date: Mon, 5 Apr 2021 14:31:50 +0000 (-0400) Subject: 17426: Add "enableWhenPristine" option for dialog boxes. X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/1df2b7a4d6f599828f9ba81b325382fe5947e281 17426: Add "enableWhenPristine" option for dialog boxes. Update README. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- diff --git a/src/components/form-dialog/form-dialog.tsx b/src/components/form-dialog/form-dialog.tsx index 8c847ca48e..6970a38af8 100644 --- a/src/components/form-dialog/form-dialog.tsx +++ b/src/components/form-dialog/form-dialog.tsx @@ -42,6 +42,7 @@ interface DialogProjectDataProps { dialogTitle: string; formFields: React.ComponentType & WithDialogProps>; submitLabel?: string; + enableWhenPristine?: boolean; } type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps & WithStyles; @@ -76,7 +77,7 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) => onClick={props.handleSubmit} className={props.classes.lastButton} color="primary" - disabled={props.invalid || props.submitting || props.pristine} + disabled={props.invalid || props.submitting || (props.pristine && !props.enableWhenPristine)} variant="contained"> {props.submitLabel || 'Submit'} {props.submitting && } @@ -85,5 +86,3 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) => ); - - diff --git a/src/plugins/README.md b/src/plugins/README.md index f95317c33b..931590cb66 100644 --- a/src/plugins/README.md +++ b/src/plugins/README.md @@ -32,30 +32,32 @@ differently from the standard `arvados-workbench2` to avoid confusion. ## Existing plugins -* "example" +### example This is an example plugin showing how to add a new navigation tree item, displaying a new center panel, as well as adding account menu and "New" menu items, and showing how to use SET_PROPERTY and getProperty() for state. -* "blank" +### blank This deletes all of the existing user interface. If you want the application to only display your plugin's UI elements and none of the standard elements, you would load and register this first. -* "root-redirect" +### root-redirect This helper takes a path when registered. It tweaks the navigation behavior so that the default starting location when the application loads will be the path you provide, instead of "Projects". -* "sample-tracker" - -This can be found at - +### sample-tracker +This is a a new set of user interface screens that assist with +clinical sample tracking and analysis. It is intended as a demo of +how a real-world application can built using the Workbench 2 +plug-in interface. It can be found at +https://github.com/arvados/sample-tracker . ## Developing plugins