[arvados-workbench2] created: 2.5.0-102-ga6b824e6
git repository hosting
git at public.arvados.org
Mon Mar 20 20:24:38 UTC 2023
at a6b824e63de4df4296a17d74d80ff2101820762d (commit)
commit a6b824e63de4df4296a17d74d80ff2101820762d
Author: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
Date: Mon Mar 20 21:23:58 2023 +0100
200085: Fix for sharing dialog
Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla at contractors.roche.com>
diff --git a/cypress/integration/sharing.spec.js b/cypress/integration/sharing.spec.js
index 1d3112c2..c64f57fd 100644
--- a/cypress/integration/sharing.spec.js
+++ b/cypress/integration/sharing.spec.js
@@ -140,4 +140,25 @@ describe('Sharing tests', function () {
cy.testEditProjectOrCollection('main', mySharedWritableProject.name, newProjectName, newProjectDescription);
});
});
+
+ it('can share only when target users are present', () => {
+ const collName = `mySharedCollectionForUsers-${new Date().getTime()}`;
+ cy.createCollection(adminUser.token, {
+ name: collName,
+ owner_uuid: adminUser.uuid,
+ }).as('mySharedCollectionForUsers')
+
+ cy.getAll('@mySharedCollectionForUsers')
+ .then(function ([]) {
+ cy.loginAs(adminUser);
+ cy.get('[data-cy=project-panel]').contains(collName).rightclick();
+ cy.get('[data-cy=context-menu]').contains('Share').click();
+ cy.get('button').contains('Save changes').parent().should('be.disabled');
+ cy.get('[data-cy=invite-people-field] input').type('Anonymous');
+ cy.get('div[role=tooltip]').contains('anonymous').click();
+ cy.get('button').contains('Save changes').parent().should('not.be.disabled');
+ cy.get('[data-cy=invite-people-field] div[role=button]').contains('anonymous').parent().find('svg').click();
+ cy.get('button').contains('Save changes').parent().should('be.disabled');
+ });
+ });
});
\ No newline at end of file
diff --git a/src/components/autocomplete/autocomplete.tsx b/src/components/autocomplete/autocomplete.tsx
index b5c634c3..17d85e85 100644
--- a/src/components/autocomplete/autocomplete.tsx
+++ b/src/components/autocomplete/autocomplete.tsx
@@ -175,17 +175,17 @@ export class Autocomplete<Value, Suggestion> extends React.Component<Autocomplet
(item, index) => {
const tooltip = this.props.renderChipTooltip ? this.props.renderChipTooltip(item) : '';
if (tooltip && tooltip.length) {
- return <Tooltip title={tooltip}>
+ return <span key={index}>
+ <Tooltip title={tooltip}>
<Chip
label={this.renderChipValue(item)}
key={index}
onDelete={onDelete && !this.props.disabled ? (() => onDelete(item, index)) : undefined} />
- </Tooltip>
+ </Tooltip></span>
} else {
- return <Chip
+ return <span key={index}><Chip
label={this.renderChipValue(item)}
- key={index}
- onDelete={onDelete && !this.props.disabled ? (() => onDelete(item, index)) : undefined} />
+ onDelete={onDelete && !this.props.disabled ? (() => onDelete(item, index)) : undefined} /></span>
}
}
);
diff --git a/src/store/sharing-dialog/sharing-dialog-types.ts b/src/store/sharing-dialog/sharing-dialog-types.ts
index a05224e2..67da4b21 100644
--- a/src/store/sharing-dialog/sharing-dialog-types.ts
+++ b/src/store/sharing-dialog/sharing-dialog-types.ts
@@ -53,4 +53,4 @@ export const getSharingPublicAccessFormData = (state: any) =>
export const hasChanges = (state: RootState) =>
isDirty(SHARING_PUBLIC_ACCESS_FORM_NAME)(state) ||
isDirty(SHARING_MANAGEMENT_FORM_NAME)(state) ||
- isDirty(SHARING_INVITATION_FORM_NAME)(state);
+ (isDirty(SHARING_INVITATION_FORM_NAME)(state) && !!state.form[SHARING_INVITATION_FORM_NAME].values?.invitedPeople.length);
diff --git a/src/views-components/sharing-dialog/sharing-dialog.tsx b/src/views-components/sharing-dialog/sharing-dialog.tsx
index 01cd390b..db89a83c 100644
--- a/src/views-components/sharing-dialog/sharing-dialog.tsx
+++ b/src/views-components/sharing-dialog/sharing-dialog.tsx
@@ -36,6 +36,7 @@ const mapStateToProps = (state: RootState, { working, ...props }: Props): Sharin
const dialog = getDialog<SharingDialogData>(state.dialog, SHARING_DIALOG_NAME);
const sharedResourceUuid = dialog?.data.resourceUuid || '';
const sharingURLsDisabled = state.auth.config.clusterConfig.Workbench.DisableSharingURLsUI;
+ console.log(state);
return ({
...props,
saveEnabled: hasChanges(state),
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list