[arvados-workbench2] updated: 2.5.0-107-gd2ea9fe9
git repository hosting
git at public.arvados.org
Fri Mar 31 21:59:40 UTC 2023
Summary of changes:
.../sharing-dialog/sharing-dialog-component.tsx | 2 +-
.../sharing-public-access-form-component.tsx | 16 +++++++++++-----
.../sharing-dialog/sharing-public-access-form.tsx | 7 +++++--
3 files changed, 17 insertions(+), 8 deletions(-)
via d2ea9fe92fc067096a8ffbbe1da012c6011c0838 (commit)
from a39cc426fdcde42210966da888eb11634e3a321a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d2ea9fe92fc067096a8ffbbe1da012c6011c0838
Author: Peter Amstutz <peter.amstutz at curii.com>
Date: Fri Mar 31 17:59:16 2023 -0400
20085: Make the public/private/shared dropdown save on change
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <peter.amstutz at curii.com>
diff --git a/src/views-components/sharing-dialog/sharing-dialog-component.tsx b/src/views-components/sharing-dialog/sharing-dialog-component.tsx
index 44824fe3..0cc9fc90 100644
--- a/src/views-components/sharing-dialog/sharing-dialog-component.tsx
+++ b/src/views-components/sharing-dialog/sharing-dialog-component.tsx
@@ -114,7 +114,7 @@ export default (props: SharingDialogComponentProps) => {
{tabNr === SharingDialogTab.PERMISSIONS &&
<Grid container direction='column' spacing={24}>
<Grid item>
- <SharingPublicAccessForm />
+ <SharingPublicAccessForm onSave={onSave} />
</Grid>
<Grid item>
<SharingManagementForm onSave={onSave} />
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..37b3d376 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,13 @@ const sharingPublicAccessStyles: StyleRulesCallback<'root'> = theme => ({
}
});
+interface AccessProps {
+ visibility: VisibilityLevel;
+ onSave: () => void;
+}
+
const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
- ({ classes, visibility }: WithStyles<'root'> & { visibility: VisibilityLevel }) =>
+ ({ classes, visibility, onSave }: WithStyles<'root'> & AccessProps) =>
<>
<Divider />
<Grid container alignItems='center' spacing={8} className={classes.root}>
@@ -27,7 +32,7 @@ const SharingPublicAccessForm = withStyles(sharingPublicAccessStyles)(
</Typography>
</Grid>
<Grid item xs={4} container wrap='nowrap'>
- <Field name='visibility' component={VisibilityLevelSelectComponent} />
+ <Field name='visibility' component={VisibilityLevelSelectComponent} onChange={onSave} />
</Grid>
</Grid>
</>
@@ -46,9 +51,10 @@ const renderVisibilityInfo = (visibility: VisibilityLevel) => {
}
};
-export default ({ visibility }: { visibility: VisibilityLevel }) =>
- <SharingPublicAccessForm {...{ visibility }} />;
+const SharingPublicAccessFormComponent = ({ visibility, onSave }: AccessProps) =>
+ <SharingPublicAccessForm {...{ visibility, onSave }} />;
+
+export default SharingPublicAccessFormComponent;
const VisibilityLevelSelectComponent = ({ input }: WrappedFieldProps) =>
<VisibilityLevelSelect fullWidth disableUnderline {...input} />;
-
diff --git a/src/views-components/sharing-dialog/sharing-public-access-form.tsx b/src/views-components/sharing-dialog/sharing-public-access-form.tsx
index 8ee1d94d..f95ff297 100644
--- a/src/views-components/sharing-dialog/sharing-public-access-form.tsx
+++ b/src/views-components/sharing-dialog/sharing-public-access-form.tsx
@@ -10,8 +10,12 @@ import { SHARING_PUBLIC_ACCESS_FORM_NAME, VisibilityLevel } from 'store/sharing-
import { RootState } from 'store/store';
import { getSharingPublicAccessFormData } from '../../store/sharing-dialog/sharing-dialog-types';
+interface SaveProps {
+ onSave: () => void;
+}
+
export const SharingPublicAccessForm = compose(
- reduxForm(
+ reduxForm<{}, SaveProps>(
{ form: SHARING_PUBLIC_ACCESS_FORM_NAME }
),
connect(
@@ -21,4 +25,3 @@ export const SharingPublicAccessForm = compose(
}
)
)(SharingPublicAccessFormComponent);
-
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list