Skip to content

Commit

Permalink
ELEMENTS-1665: fix error/validation message when adding permission
Browse files Browse the repository at this point in the history
  • Loading branch information
alokhyland committed Sep 6, 2023
1 parent 3cb8f45 commit 48f0a6b
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit 48f0a6b

Please sign in to comment.