Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ELEMENTS-1665: fix error/validation message when adding permission #796

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ui/nuxeo-document-permissions/nuxeo-popup-permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ import '../nuxeo-button-styles.js';
value="{{params.users}}"
placeholder="[[i18n('popupPermission.userGroup.placeholder')]]"
multiple
required
invalid="{{params.invalid}}"
>
</nuxeo-user-suggestion>
</div>
Expand Down Expand Up @@ -192,7 +194,9 @@ import '../nuxeo-button-styles.js';
</paper-dialog-scrollable>

<div class="buttons">
<paper-button dialog-dismiss class="secondary">[[i18n('popupPermission.cancel')]]</paper-button>
<paper-button dialog-dismiss class="secondary" on-click="doCancel"
>[[i18n('popupPermission.cancel')]]</paper-button
>
<dom-if if="{{!updatingACE}}">
<template>
<paper-button noink class="primary small" on-click="doCreateAndAdd" id="createAndAddPermissionButton">
Expand Down Expand Up @@ -284,6 +288,11 @@ import '../nuxeo-button-styles.js';
this._doSend(true);
}

doCancel() {
this.params = this._getResetParams();
this.set('params.invalid', false);
}

_computeTitle() {
if (this.updatingACE) {
return this.i18n('popupPermission.updatePermission');
Expand Down Expand Up @@ -312,6 +321,7 @@ import '../nuxeo-button-styles.js';
return;
}
if (!this.shareWithExternal && !this.params.username && (!this.params.users || this.params.users.length === 0)) {
this.set('params.invalid', true);
return;
}

Expand Down Expand Up @@ -428,6 +438,7 @@ import '../nuxeo-button-styles.js';
end: null,
notify: true,
comment: '',
invalid: false,
};
}
}
Expand Down
Loading