diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-04-19 10:30:09 +0200 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2018-05-16 09:50:22 +0200 |
commit | 0e5b0fcef0d63b4d4c6e3c5f0125b76d8c0088aa (patch) | |
tree | d2f60572022e7f347e0bcbdc756b324ae7c34254 /settings/src/views | |
parent | ff2c23d9e2230960c1712318f452592079b5d2e8 (diff) | |
download | nextcloud-server-0e5b0fcef0d63b4d4c6e3c5f0125b76d8c0088aa.tar.gz nextcloud-server-0e5b0fcef0d63b4d4c6e3c5f0125b76d8c0088aa.zip |
new OC api and default quota fixes
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'settings/src/views')
-rw-r--r-- | settings/src/views/Users.vue | 35 |
1 files changed, 27 insertions, 8 deletions
diff --git a/settings/src/views/Users.vue b/settings/src/views/Users.vue index 5f666f986f9..d0e5591cd0c 100644 --- a/settings/src/views/Users.vue +++ b/settings/src/views/Users.vue @@ -69,6 +69,8 @@ export default { return { // default quota is unlimited unlimitedQuota: {id:'default', label:t('settings', 'Unlimited')}, + // temporary value used for multiselect change + selectedQuota: false, showConfig: { showStoragePath: false, showUserBackend: false, @@ -110,9 +112,17 @@ export default { * @returns {string} */ setDefaultQuota(quota = 'none') { - // ensure we only send the preset id - quota = quota.id ? quota.id : quota; - api.setAppConfig('files', 'default_quota', quota); + this.$store.dispatch('setAppConfig', { + app: 'files', + key: 'default_quota', + // ensure we only send the preset id + value: quota.id ? quota.id : quota + }).then(() => { + if (typeof quota !== 'object') { + quota = {id: quota, label: quota}; + } + this.defaultQuota = quota; + }); }, /** @@ -190,12 +200,21 @@ export default { return quotaPreset; }, // mapping saved values to objects - defaultQuota() { - if (OC.Util.computerFileSize(this.settings.defaultQuota) > 0) { - // if value is valid, let's map the quotaOptions or return custom quota - return {id:this.settings.defaultQuota, label:this.settings.defaultQuota}; + defaultQuota: { + get: function() { + if (this.selectedQuota !== false) { + return this.selectedQuota; + } + if (OC.Util.computerFileSize(this.settings.defaultQuota) > 0) { + // if value is valid, let's map the quotaOptions or return custom quota + return {id:this.settings.defaultQuota, label:this.settings.defaultQuota}; + } + return this.unlimitedQuota; // unlimited + }, + set: function(quota) { + this.selectedQuota = quota; } - return this.unlimitedQuota; // unlimited + }, // BUILD APP NAVIGATION MENU OBJECT |