summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2024-01-15 11:51:46 -0800
committerGitHub <noreply@github.com>2024-01-15 11:51:46 -0800
commit6c55500dbb0d616df7f8e61755b04d0607f640e0 (patch)
tree452d0994ebaeab4c4b84fa49a53fd457af998d3f /apps
parentb8aa466b0ebe6dc415669bc81a902f732a8b1713 (diff)
parenta9be93e4bb65faaa1d7e033ae9dcac6ff348cc19 (diff)
downloadnextcloud-server-6c55500dbb0d616df7f8e61755b04d0607f640e0.tar.gz
nextcloud-server-6c55500dbb0d616df7f8e61755b04d0607f640e0.zip
Merge pull request #42766 from nextcloud/backport/42723/stable28
[stable28] fix(settings): set default or unlimited user quota
Diffstat (limited to 'apps')
-rw-r--r--apps/settings/src/components/Users/UserRow.vue13
1 files changed, 8 insertions, 5 deletions
diff --git a/apps/settings/src/components/Users/UserRow.vue b/apps/settings/src/components/Users/UserRow.vue
index 868bc21de14..a27b41e11a6 100644
--- a/apps/settings/src/components/Users/UserRow.vue
+++ b/apps/settings/src/components/Users/UserRow.vue
@@ -2,7 +2,7 @@
- @copyright Copyright (c) 2019 Gary Kim <gary@garykim.dev>
- @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
-
- - @author Christopher Ng <chrng8@gmail.com>
+ - @author Christopher Ng <chrng8@gmail.com>
- @author Gary Kim <gary@garykim.dev>
- @author John Molakvoæ <skjnldsv@protonmail.com>
-
@@ -294,6 +294,7 @@
</template>
<script>
+import { formatFileSize, parseFileSize } from '@nextcloud/files'
import { getCurrentUser } from '@nextcloud/auth'
import { showSuccess, showError } from '@nextcloud/dialogs'
@@ -306,8 +307,7 @@ import NcTextField from '@nextcloud/vue/dist/Components/NcTextField.js'
import UserRowActions from './UserRowActions.vue'
import UserRowMixin from '../../mixins/UserRowMixin.js'
-import { isObfuscated, unlimitedQuota } from '../../utils/userUtils.ts'
-import {formatFileSize, parseFileSize} from "@nextcloud/files";
+import { isObfuscated, unlimitedQuota } from '../../utils/userUtils.ts';
export default {
name: 'UserRow',
@@ -828,15 +828,18 @@ export default {
quota = unlimitedQuota
}
this.loading.quota = true
+
// ensure we only send the preset id
quota = quota.id ? quota.id : quota
try {
+ // If human readable format, convert to raw float format
+ // Else just send the raw string
+ const value = (parseFileSize(quota, true) || quota).toString()
await this.$store.dispatch('setUserData', {
userid: this.user.id,
key: 'quota',
- // translate from locale string format to raw float format so backend can read it
- value: '' + parseFileSize(quota, true)
+ value,
})
} catch (error) {
console.error(error)