X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/b6ac7fe88d347582d39fffa002e300af222c578f..47c824dd6472897b18738ad4b03dad5cf00e74bc:/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 8fb427af..03885a43 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
@@ -13,13 +13,22 @@ import { VisibilityLevel } from 'store/sharing-dialog/sharing-dialog-types';
 const sharingPublicAccessStyles: StyleRulesCallback<'root'> = theme => ({
     root: {
         padding: `${theme.spacing.unit * 2}px 0`,
+    },
+    heading: {
+        fontSize: '1.25rem',
     }
 });
 
+interface AccessProps {
+    visibility: VisibilityLevel;
+    includePublic: boolean;
+    onSave: () => void;
+}
+
 const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
-    ({ classes, visibility }: WithStyles<'root'> & { visibility: VisibilityLevel }) =>
+    ({ classes, visibility, includePublic, onSave }: WithStyles<'root' | 'heading'> & AccessProps) =>
         <>
-            <Divider />
+            <Typography className={classes.heading}>General access</Typography>
             <Grid container alignItems='center' spacing={8} className={classes.root}>
                 <Grid item xs={8}>
                     <Typography variant='subtitle1'>
@@ -27,7 +36,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,18 +45,22 @@ const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
 const renderVisibilityInfo = (visibility: VisibilityLevel) => {
     switch (visibility) {
         case VisibilityLevel.PUBLIC:
-            return 'Anyone can access';
+            return 'Shared with anyone on the Internet';
+        case VisibilityLevel.ALL_USERS:
+            return 'Shared with all users on this cluster';
         case VisibilityLevel.SHARED:
-            return 'Specific people can access';
+            return 'Shared with specific people';
         case VisibilityLevel.PRIVATE:
-            return 'Only you can access';
+            return 'Not shared';
         default:
             return '';
     }
 };
 
-export default ({ visibility }: { visibility: VisibilityLevel }) =>
-    <SharingPublicAccessForm {...{ visibility }} />;
+const SharingPublicAccessFormComponent = ({ visibility, includePublic, onSave }: AccessProps) =>
+    <SharingPublicAccessForm {...{ visibility, includePublic, onSave }} />;
+
+export default SharingPublicAccessFormComponent;
 
-const VisibilityLevelSelectComponent = ({ input }: WrappedFieldProps) =>
-    <VisibilityLevelSelect fullWidth disableUnderline {...input} />;
+const VisibilityLevelSelectComponent = ({ input, includePublic }: { includePublic: boolean } & WrappedFieldProps) =>
+    <VisibilityLevelSelect fullWidth disableUnderline includePublic={includePublic} {...input} />;
