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

[stable28] fix(settings): Fix required groups validation for subadmins #43719

Merged
merged 1 commit into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
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
22 changes: 2 additions & 20 deletions apps/settings/src/components/Users/NewUserModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,6 @@
spellcheck="false"
:required="newUser.password === '' || settings.newUserRequireEmail" />
<div class="modal__item">
<!-- hidden input trick for vanilla html5 form validation -->
<NcTextField v-if="!settings.isAdmin"
id="new-user-groups-input"
tabindex="-1"
:class="{ 'icon-loading-small': loading.groups }"
:value="newUser.groups"
:required="!settings.isAdmin" />
<label class="modal__label"
for="new-user-groups">
{{ !settings.isAdmin ? t('settings', 'Groups (required)') : t('settings', 'Groups') }}
Expand All @@ -96,13 +89,14 @@
:close-on-select="false"
:multiple="true"
:taggable="true"
:required="!settings.isAdmin"
@input="handleGroupInput"
@option:created="createGroup" />
<!-- If user is not admin, he is a subadmin.
Subadmins can't create users outside their groups
Therefore, empty select is forbidden -->
</div>
<div v-if="subAdminsGroups.length > 0 && settings.isAdmin"
<div v-if="subAdminsGroups.length > 0"
class="modal__item">
<label class="modal__label"
for="new-user-sub-admin">
Expand Down Expand Up @@ -396,18 +390,6 @@ export default {
align-items: center;
padding: 20px;
gap: 4px 0;

/* fake input for groups validation */
#new-user-groups-input {
position: absolute;
opacity: 0;
/* The "hidden" input is behind the NcSelect, so in general it does
* not receives clicks. However, with Firefox, after the validation
* fails, it will receive the first click done on it, so its width needs
* to be set to 0 to prevent that ("pointer-events: none" does not
* prevent it). */
width: 0;
}
}

&__item {
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-users-8351.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-users-8351.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.

Loading