Arvados-DCO-1.1-Signed-off-by: Daniel Kutyła <daniel.kutyla@contractors.roche.com>
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
(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>
}
}
);
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);
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),