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

[stable28] fix(settings): set default or unlimited user quota #42766

Merged
merged 2 commits into from
Jan 15, 2024
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 8 additions & 5 deletions apps/settings/src/components/Users/UserRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
-
Expand Down Expand Up @@ -294,6 +294,7 @@
</template>

<script>
import { formatFileSize, parseFileSize } from '@nextcloud/files'
import { getCurrentUser } from '@nextcloud/auth'
import { showSuccess, showError } from '@nextcloud/dialogs'

Expand All @@ -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',
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions dist/settings-users-8351.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-users-8351.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/settings-vue-settings-apps-users-management.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/settings-vue-settings-apps-users-management.js.map

Large diffs are not rendered by default.