Browse Source

Fix new group selection

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
tags/v14.0.0beta1
John Molakvoæ (skjnldsv) 6 years ago
parent
commit
b495716daf
No account linked to committer's email address

+ 2
- 2
settings/js/settings-vue.js
File diff suppressed because it is too large
View File


+ 1
- 1
settings/js/settings-vue.js.map
File diff suppressed because it is too large
View File


+ 4
- 4
settings/src/components/userList.vue View File

@@ -221,11 +221,11 @@ export default {
},
canAddGroups() {
// disabled if no permission to add new users to group
return this.groups.map((group) => {
return this.groups.map(group => {
// clone object because we don't want
// to edit the original groups
group = Object.assign({}, group);
group.$isDisabled = group.canAdd !== true;
group.$isDisabled = group.canAdd === false;
return group;
});
},
@@ -235,7 +235,7 @@ export default {
},
quotaOptions() {
// convert the preset array into objects
let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({id:cur, label:cur}), []);
let quotaPreset = this.settings.quotaPreset.reduce((acc, cur) => acc.concat({id: cur, label: cur}), []);
// add default presets
quotaPreset.unshift(this.unlimitedQuota);
quotaPreset.unshift(this.defaultQuota);
@@ -275,7 +275,7 @@ export default {
},
methods: {
onScroll(event) {
this.scrolled = event.target.scrollTop>0;
this.scrolled = event.target.scrollTo > 0;
},

/**

+ 4
- 4
settings/src/components/userList/userRow.vue View File

@@ -206,9 +206,9 @@ export default {
// 1. user NOT in group but no permission to add
// 2. user is in group but no permission to remove
groupClone.$isDisabled =
(group.canAdd !== true &&
(group.canAdd === false &&
!this.user.groups.includes(group.id)) ||
(group.canRemove !== true &&
(group.canRemove === false &&
this.user.groups.includes(group.id));
return groupClone;
});
@@ -405,7 +405,7 @@ export default {
* @returns {Promise}
*/
addUserGroup(group) {
if (!group.canAdd) {
if (group.canAdd === false) {
return false;
}
this.loading.groups = true;
@@ -422,7 +422,7 @@ export default {
* @returns {Promise}
*/
removeUserGroup(group) {
if (!group.canRemove) {
if (group.canRemove === false) {
return false;
}
this.loading.groups = true;

+ 3
- 1
settings/src/store/users.js View File

@@ -39,7 +39,9 @@ const defaults = {
id: '',
name: '',
usercount: 0,
disabled: 0
disabled: 0,
canAdd: true,
canRemove: true
}
};


Loading…
Cancel
Save