17426: Add "enableWhenPristine" option for dialog boxes.
authorPeter Amstutz <peter.amstutz@curii.com>
Mon, 5 Apr 2021 14:31:50 +0000 (10:31 -0400)
committerPeter Amstutz <peter.amstutz@curii.com>
Mon, 5 Apr 2021 14:31:50 +0000 (10:31 -0400)
Update README.

Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz@curii.com>

src/components/form-dialog/form-dialog.tsx
src/plugins/README.md

index 8c847ca48e77acb5ba33670d1cf0e8da4dc64200..6970a38af8595087344d0ed4e5b52071c578f99a 100644 (file)
@@ -42,6 +42,7 @@ interface DialogProjectDataProps {
     dialogTitle: string;
     formFields: React.ComponentType<InjectedFormProps<any> & WithDialogProps<any>>;
     submitLabel?: string;
+    enableWhenPristine?: boolean;
 }
 
 type DialogProjectProps = DialogProjectDataProps & WithDialogProps<{}> & InjectedFormProps<any> & WithStyles<CssRules>;
@@ -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 && <CircularProgress size={20} className={props.classes.progressIndicator} />}
@@ -85,5 +86,3 @@ export const FormDialog = withStyles(styles)((props: DialogProjectProps) =>
         </form>
     </Dialog>
 );
-
-
index f95317c33bcdfe43c6f320b0b0d86a3a7add95d8..931590cb66d67a37dd810b9628734699bb8379f3 100644 (file)
@@ -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