X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/d1c2611350e47527730f6d3b226b998abf15a607..3d4f1fd8ce62ed2cd35af23231062a95b70c500b:/src/views-components/sharing-dialog/sharing-public-access-form-component.tsx

diff --git a/src/views-components/sharing-dialog/sharing-public-access-form-component.tsx b/src/views-components/sharing-dialog/sharing-public-access-form-component.tsx
index 7ec71161..bcee8dce 100644
--- a/src/views-components/sharing-dialog/sharing-public-access-form-component.tsx
+++ b/src/views-components/sharing-dialog/sharing-public-access-form-component.tsx
@@ -16,8 +16,14 @@ const sharingPublicAccessStyles: StyleRulesCallback<'root'> = theme => ({
     }
 });
 
+interface AccessProps {
+    visibility: VisibilityLevel;
+    includePublic: boolean;
+    onSave: () => void;
+}
+
 const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
-    ({ classes, visibility }: WithStyles<'root'> & { visibility: VisibilityLevel }) =>
+    ({ classes, visibility, includePublic, onSave }: WithStyles<'root'> & AccessProps) =>
         <>
             <Divider />
             <Grid container alignItems='center' spacing={8} className={classes.root}>
@@ -27,7 +33,7 @@ const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
                     </Typography>
                 </Grid>
                 <Grid item xs={4} container wrap='nowrap'>
-                    <Field name='visibility' component={VisibilityLevelSelectComponent} />
+                    <Field<{ includePublic: boolean }> name='visibility' component={VisibilityLevelSelectComponent} includePublic={includePublic} onChange={onSave} />
                 </Grid>
             </Grid>
         </>
@@ -36,7 +42,9 @@ const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
 const renderVisibilityInfo = (visibility: VisibilityLevel) => {
     switch (visibility) {
         case VisibilityLevel.PUBLIC:
-            return 'Anyone can access';
+            return 'Anyone on the Internet can access';
+        case VisibilityLevel.ALL_USERS:
+            return 'All users on this cluster can access';
         case VisibilityLevel.SHARED:
             return 'Specific people can access';
         case VisibilityLevel.PRIVATE:
@@ -46,9 +54,10 @@ const renderVisibilityInfo = (visibility: VisibilityLevel) => {
     }
 };
 
-export default ({ visibility }: { visibility: VisibilityLevel }) =>
-    <SharingPublicAccessForm {...{ visibility }} />;
+const SharingPublicAccessFormComponent = ({ visibility, includePublic, onSave }: AccessProps) =>
+    <SharingPublicAccessForm {...{ visibility, includePublic, onSave }} />;
 
-const VisibilityLevelSelectComponent = ({ input }: WrappedFieldProps) =>
-    <VisibilityLevelSelect fullWidth disableUnderline {...input} />;
+export default SharingPublicAccessFormComponent;
 
+const VisibilityLevelSelectComponent = ({ input, includePublic }: { includePublic: boolean } & WrappedFieldProps) =>
+    <VisibilityLevelSelect fullWidth disableUnderline includePublic={includePublic} {...input} />;
