cy.getAll('@banner', '@tooltips')
.then(([banner, tooltips]) => {
- console.log(tooltips)
cy.get('[data-cy=drag-and-drop]').upload(banner, 'banner.html', false);
cy.get('[data-cy=drag-and-drop]').upload(tooltips, 'tooltips.json', false);
});
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);
onSelect={this.handleSelect}
onDelete={this.props.onDelete && !this.props.disabled ? this.handleDelete : undefined}
onFocus={this.props.onFocus}
- onBlur={this.props.onBlur}
+ onBlur={this.onBlur}
renderChipValue={this.renderChipValue}
renderChipTooltip={this.renderChipTooltip}
renderSuggestion={this.renderSuggestion}
);
}
+ onBlur = (e) => {
+ if (this.props.onBlur) {
+ this.props.onBlur(e);
+ }
+ setTimeout(() => this.setState({ value: '', suggestions: [] }), 200);
+ }
+
renderChipValue(chipValue: Participant) {
const { name, uuid } = chipValue;
return name || uuid;
});
export const GroupArrayInput = ({name, input, setPartialGroupInput, hasPartialGroupInput}: GroupArrayInputProps & GroupArrayDataProps) => {
- console.log(hasPartialGroupInput);
return <GroupArrayField
name={name}
commandInput={input}