Skip to content

Commit bff2058

Browse files
authored
Merge pull request #10045 from nextcloud/groups-creation-fixes
Fix new group selection
2 parents 322a113 + b495716 commit bff2058

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

settings/js/settings-vue.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/js/settings-vue.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

settings/src/components/userList.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ export default {
221221
},
222222
canAddGroups() {
223223
// disabled if no permission to add new users to group
224-
return this.groups.map((group) => {
224+
return this.groups.map(group => {
225225
// clone object because we don't want
226226
// to edit the original groups
227227
group = Object.assign({}, group);
228-
group.$isDisabled = group.canAdd !== true;
228+
group.$isDisabled = group.canAdd === false;
229229
return group;
230230
});
231231
},
@@ -235,7 +235,7 @@ export default {
235235
},
236236
quotaOptions() {
237237
// convert the preset array into objects
238-
let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({id:cur, label:cur}), []);
238+
let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({id: cur, label: cur}), []);
239239
// add default presets
240240
quotaPreset.unshift(this.unlimitedQuota);
241241
quotaPreset.unshift(this.defaultQuota);
@@ -275,7 +275,7 @@ export default {
275275
},
276276
methods: {
277277
onScroll(event) {
278-
this.scrolled = event.target.scrollTop>0;
278+
this.scrolled = event.target.scrollTo > 0;
279279
},
280280
281281
/**

settings/src/components/userList/userRow.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,9 @@ export default {
206206
// 1. user NOT in group but no permission to add
207207
// 2. user is in group but no permission to remove
208208
groupClone.$isDisabled =
209-
(group.canAdd !== true &&
209+
(group.canAdd === false &&
210210
!this.user.groups.includes(group.id)) ||
211-
(group.canRemove !== true &&
211+
(group.canRemove === false &&
212212
this.user.groups.includes(group.id));
213213
return groupClone;
214214
});
@@ -405,7 +405,7 @@ export default {
405405
* @returns {Promise}
406406
*/
407407
addUserGroup(group) {
408-
if (!group.canAdd) {
408+
if (group.canAdd === false) {
409409
return false;
410410
}
411411
this.loading.groups = true;
@@ -422,7 +422,7 @@ export default {
422422
* @returns {Promise}
423423
*/
424424
removeUserGroup(group) {
425-
if (!group.canRemove) {
425+
if (group.canRemove === false) {
426426
return false;
427427
}
428428
this.loading.groups = true;

settings/src/store/users.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ const defaults = {
3939
id: '',
4040
name: '',
4141
usercount: 0,
42-
disabled: 0
42+
disabled: 0,
43+
canAdd: true,
44+
canRemove: true
4345
}
4446
};
4547

0 commit comments

Comments
 (0)