summaryrefslogtreecommitdiffstats
path: root/settings/src
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-05-26 10:51:24 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-06-07 11:30:37 +0200
commitda583f05fce25a7f2ffadf54509b820bb7bc61e6 (patch)
treef7297714c5af2bddaa1cf8e1af33c2ebdc8ab036 /settings/src
parent132597bbd3e3e1633fa83c77c268242d5c59a4f4 (diff)
downloadnextcloud-server-da583f05fce25a7f2ffadf54509b820bb7bc61e6.tar.gz
nextcloud-server-da583f05fce25a7f2ffadf54509b820bb7bc61e6.zip
Allow 0 quota by provisioning api
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src')
-rw-r--r--settings/src/components/userList.vue4
-rw-r--r--settings/src/components/userList/userRow.vue8
-rw-r--r--settings/src/store/users.js2
-rw-r--r--settings/src/views/Users.vue4
4 files changed, 8 insertions, 10 deletions
diff --git a/settings/src/components/userList.vue b/settings/src/components/userList.vue
index f7aec953ecc..1deadc38cff 100644
--- a/settings/src/components/userList.vue
+++ b/settings/src/components/userList.vue
@@ -179,7 +179,7 @@ export default {
}
return disabledUsers;
}
- if (!settings.isAdmin) {
+ if (!this.settings.isAdmin) {
// We don't want subadmins to edit themselves
return this.users.filter(user => user.enabled !== false && user.id !== oc_current_user);
}
@@ -249,7 +249,7 @@ export default {
validateQuota(quota) {
// only used for new presets sent through @Tag
let validQuota = OC.Util.computerFileSize(quota);
- if (validQuota !== null && validQuota > 0) {
+ if (validQuota !== null && validQuota >= 0) {
// unify format output
quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota));
return this.newUser.quota = {id: quota, label: quota};
diff --git a/settings/src/components/userList/userRow.vue b/settings/src/components/userList/userRow.vue
index 67a2582fc11..9b1a164ce49 100644
--- a/settings/src/components/userList/userRow.vue
+++ b/settings/src/components/userList/userRow.vue
@@ -175,12 +175,12 @@ export default {
},
// Mapping saved values to objects
userQuota() {
- if (this.user.quota.quota > 0) {
+ if (this.user.quota.quota >= 0) {
// if value is valid, let's map the quotaOptions or return custom quota
let humanQuota = OC.Util.humanFileSize(this.user.quota.quota);
let userQuota = this.quotaOptions.find(quota => quota.id === humanQuota);
return userQuota ? userQuota : {id:humanQuota, label:humanQuota};
- } else if (this.user.quota.quota === 0 || this.user.quota.quota === 'default') {
+ } else if (this.user.quota.quota === 'default') {
// default quota is replaced by the proper value on load
return this.quotaOptions[0];
}
@@ -437,9 +437,7 @@ export default {
validateQuota(quota) {
// only used for new presets sent through @Tag
let validQuota = OC.Util.computerFileSize(quota);
- if (validQuota === 0) {
- return this.setUserQuota('none');
- } else if (validQuota !== null) {
+ if (validQuota !== null && validQuota >= 0) {
// unify format output
return this.setUserQuota(OC.Util.humanFileSize(OC.Util.computerFileSize(quota)));
}
diff --git a/settings/src/store/users.js b/settings/src/store/users.js
index f2393a93742..c1d81480541 100644
--- a/settings/src/store/users.js
+++ b/settings/src/store/users.js
@@ -118,7 +118,7 @@ const mutations = {
setUserData(state, { userid, key, value }) {
if (key === 'quota') {
let humanValue = OC.Util.computerFileSize(value);
- state.users.find(user => user.id == userid)[key][key] = humanValue?humanValue:value;
+ state.users.find(user => user.id == userid)[key][key] = humanValue!==null ? humanValue : value;
} else {
state.users.find(user => user.id == userid)[key] = value;
}
diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue
index 17fe1bb9a56..8c59532c34e 100644
--- a/settings/src/views/Users.vue
+++ b/settings/src/views/Users.vue
@@ -63,8 +63,8 @@ export default {
},
data() {
return {
- // default quota is unlimited
- unlimitedQuota: {id:'default', label:t('settings', 'Unlimited')},
+ // default quota is set to unlimited
+ unlimitedQuota: {id: 'none', label: t('settings', 'Unlimited')},
// temporary value used for multiselect change
selectedQuota: false,
showConfig: {