[arvados] created: 2.7.0-6289-gf9378d4015

git repository hosting git at public.arvados.org
Thu Apr 4 15:08:00 UTC 2024


        at  f9378d4015246bab78305a2f117e144248acfbb4 (commit)


commit f9378d4015246bab78305a2f117e144248acfbb4
Author: Lisa Knox <lisaknox83 at gmail.com>
Date:   Thu Apr 4 11:07:45 2024 -0400

    21313: added warning and diabled button while saveEnabled Arvados-DCO-1.1-Signed-off-by: Lisa Knox <lisa.knox at curii.com>

diff --git a/services/workbench2/src/views-components/sharing-dialog/sharing-dialog-component.tsx b/services/workbench2/src/views-components/sharing-dialog/sharing-dialog-component.tsx
index f83cec60f2..9a150b2e5c 100644
--- a/services/workbench2/src/views-components/sharing-dialog/sharing-dialog-component.tsx
+++ b/services/workbench2/src/views-components/sharing-dialog/sharing-dialog-component.tsx
@@ -182,7 +182,9 @@ export default (props: SharingDialogComponentProps) => {
                     <Button onClick={() => {
                         onClose();
                         setWithExpiration(false);
-                    }}>
+                    }}
+                    disabled={saveEnabled}
+                    >
                         Close
                     </Button>
                 </Grid>
diff --git a/services/workbench2/src/views-components/sharing-dialog/sharing-invitation-form-component.tsx b/services/workbench2/src/views-components/sharing-dialog/sharing-invitation-form-component.tsx
index 871ea503ec..70ae505640 100644
--- a/services/workbench2/src/views-components/sharing-dialog/sharing-invitation-form-component.tsx
+++ b/services/workbench2/src/views-components/sharing-dialog/sharing-invitation-form-component.tsx
@@ -4,7 +4,7 @@
 
 import React from 'react';
 import { Field, WrappedFieldProps, FieldArray, WrappedFieldArrayProps } from 'redux-form';
-import { Grid, FormControl, InputLabel, Tooltip, IconButton, StyleRulesCallback } from '@material-ui/core';
+import { Grid, FormControl, InputLabel, Tooltip, IconButton, StyleRulesCallback, Typography } from '@material-ui/core';
 import { PermissionSelect, parsePermissionLevel, formatPermissionLevel } from './permission-select';
 import { ParticipantSelect, Participant } from './participant-select';
 import { AddIcon } from 'components/icon/icon';
@@ -12,7 +12,7 @@ import { WithStyles } from '@material-ui/core/styles';
 import withStyles from '@material-ui/core/styles/withStyles';
 import { ArvadosTheme } from 'common/custom-theme';
 
-type SharingStyles = 'root' | 'addButtonRoot' | 'addButtonPrimary' | 'addButtonDisabled';
+type SharingStyles = 'root' | 'addButtonRoot' | 'addButtonPrimary' | 'addButtonDisabled' | 'shareWarning' ;
 
 const styles: StyleRulesCallback<SharingStyles> = (theme: ArvadosTheme) => ({
     root: {
@@ -34,7 +34,12 @@ const styles: StyleRulesCallback<SharingStyles> = (theme: ArvadosTheme) => ({
     },
     addButtonDisabled: {
         background: 'none',
-    }
+    },
+    shareWarning: {
+        color: theme.palette.error.main,
+        marginTop: '-1rem',
+        fontSize: '0.75rem',
+    },
 });
 
 const SharingInvitationFormComponent = (props: { onSave: () => void, saveEnabled: boolean }) => <StyledSharingInvitationFormComponent onSave={props.onSave} saveEnabled={props.saveEnabled} />
@@ -46,6 +51,13 @@ const StyledSharingInvitationFormComponent = withStyles(styles)(
         <Grid container spacing={8} wrap='nowrap' className={classes.root} >
             <Grid data-cy="invite-people-field" item xs={8}>
                 <InvitedPeopleField />
+                {saveEnabled && 
+                    <Typography 
+                        variant='caption' 
+                        className={classes.shareWarning}
+                        >
+                        You must click &#x1F7A4; to add a participant.
+                    </Typography>}
             </Grid>
             <Grid data-cy="permission-select-field" item xs={4} container wrap='nowrap'>
                 <PermissionSelectField />

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list