From 0445c9903e02cf27b36c1b41ffbd76de81b9d2e8 Mon Sep 17 00:00:00 2001 From: Peter Amstutz Date: Mon, 5 Apr 2021 10:31:50 -0400 Subject: [PATCH] 17426: Add "enableWhenPristine" option for dialog boxes. Update README. Arvados-DCO-1.1-Signed-off-by: Peter Amstutz --- src/components/form-dialog/form-dialog.tsx | 5 ++--- src/plugins/README.md | 16 +++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/form-dialog/form-dialog.tsx b/src/components/form-dialog/form-dialog.tsx index 8c847ca4..6970a38a 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 f95317c3..931590cb 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 -- 2.30.2