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

Fix new group selection #10045

Merged
merged 1 commit into from
Jun 29, 2018
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
4 changes: 2 additions & 2 deletions settings/js/settings-vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion settings/js/settings-vue.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions settings/src/components/userList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
},
Expand All @@ -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);
Expand Down Expand Up @@ -275,7 +275,7 @@ export default {
},
methods: {
onScroll(event) {
this.scrolled = event.target.scrollTop>0;
this.scrolled = event.target.scrollTo > 0;
},

/**
Expand Down
8 changes: 4 additions & 4 deletions settings/src/components/userList/userRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down Expand Up @@ -405,7 +405,7 @@ export default {
* @returns {Promise}
*/
addUserGroup(group) {
if (!group.canAdd) {
if (group.canAdd === false) {
return false;
}
this.loading.groups = true;
Expand All @@ -422,7 +422,7 @@ export default {
* @returns {Promise}
*/
removeUserGroup(group) {
if (!group.canRemove) {
if (group.canRemove === false) {
return false;
}
this.loading.groups = true;
Expand Down
4 changes: 3 additions & 1 deletion settings/src/store/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@ const defaults = {
id: '',
name: '',
usercount: 0,
disabled: 0
disabled: 0,
canAdd: true,
canRemove: true
}
};

Expand Down