From fa2cf8d80538348b9a9c969f350ae49e2260b80c Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Wed, 6 Dec 2023 14:09:09 +0100 Subject: [PATCH] fix(Users/Quota setting): Prevent floating point value from getting truncated in locales other than english fixes #18468 Signed-off-by: Marcel Klehr --- apps/settings/src/components/UserList.vue | 5 +- .../src/components/UserList/UserRow.vue | 7 +- apps/settings/src/store/users.js | 3 +- .../src/components/UserMenu/UserMenuEntry.vue | 4 +- package-lock.json | 184 ++++++++---------- package.json | 2 +- 6 files changed, 97 insertions(+), 108 deletions(-) diff --git a/apps/settings/src/components/UserList.vue b/apps/settings/src/components/UserList.vue index 9a97aff085f..f9553445e13 100644 --- a/apps/settings/src/components/UserList.vue +++ b/apps/settings/src/components/UserList.vue @@ -262,6 +262,7 @@ import Vue from 'vue' import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcMultiselect from '@nextcloud/vue/dist/Components/NcMultiselect.js' +import { formatFileSize, parseFileSize } from '@nextcloud/files' import userRow from './UserList/UserRow.vue' @@ -486,10 +487,10 @@ export default { */ validateQuota(quota) { // only used for new presets sent through @Tag - const validQuota = OC.Util.computerFileSize(quota) + const validQuota = parseFileSize(quota, true) if (validQuota !== null && validQuota >= 0) { // unify format output - quota = OC.Util.humanFileSize(OC.Util.computerFileSize(quota)) + quota = formatFileSize(parseFileSize(quota, true)) this.newUser.quota = { id: quota, label: quota } return this.newUser.quota } diff --git a/apps/settings/src/components/UserList/UserRow.vue b/apps/settings/src/components/UserList/UserRow.vue index dddf5abef8a..2e507107b73 100644 --- a/apps/settings/src/components/UserList/UserRow.vue +++ b/apps/settings/src/components/UserList/UserRow.vue @@ -268,6 +268,7 @@