Skip to content

feat: show used quota in admin user details - #3492

Merged
AlexAndBear merged 2 commits into
mainfrom
feat/user-details-quota-usage
Sep 30, 2026
Merged

AlexAndBear merged 2 commits into
mainfrom
feat/user-details-quota-usage

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

Description

The user details in the admin settings only showed the total quota of a user (e.g. "2 GB"), so admins couldn't see how much of it was actually used. The details now also show the used quota, in the same way as the space details in the files app: "1.1 GB of 2 GB used (53.69% used)" with a progress bar. The bar turns red when the quota state isn't normal.

The data was already there: when a user is selected, the panel loads the user with $expand=drive, and drive.quota contains used, remaining and state next to total. The panel now passes it to the existing SpaceQuota component instead of only formatting total.

  • Unlimited quota: shows "1.1 GB used (no restriction)" without a progress bar. SpaceQuota now hides the bar when total is 0, which also applies to the space details. Before, it computed used / 0 as the bar width.
  • Users who never logged in: they have no personal drive yet, so the panel keeps showing "-" with the help tooltip.

This PR is based on #3491 (quota progress bar background), so the bar's track is visible in the screenshots. It will be retargeted to main once #3491 is merged.

Screenshots

Before After
before-user-quota after-user-quota

Related Issue

  • Fixes <issue_link>

How Has This Been Tested?

  • test environment: local dev setup (Vite dev server + OpenCloud backend via docker-compose), Chromium; Vitest
  • test case 1: set a 2 GB quota for a user with 1.1 GB used: the details show "1.1 GB of 2 GB used (53.69% used)" with a progress bar, updated right after saving the quota
  • test case 2: set the quota back to "No restriction": the details show "1.1 GB used (no restriction)" without a progress bar
  • test case 3: new unit tests for the progress bar in SpaceQuota (limited and unlimited quota) and for the quota in the user DetailsPanel (with and without a drive); unit tests, type check, lint and format pass

Types of changes

  • Bugfix
  • Enhancement (a change that doesn't break existing code or deployments)
  • Breaking change (a modification that affects current functionality)
  • Technical debt (addressing code that needs refactoring or improvements)
  • Tests (adding or improving tests)
  • Documentation (updates or additions to documentation)
  • Maintenance (like dependency updates or tooling adjustments)

@AlexAndBear AlexAndBear self-assigned this Sep 30, 2026
Base automatically changed from fix/space-quota-progress-background to main September 30, 2026 07:42
@AlexAndBear
AlexAndBear merged commit 67eb145 into main Sep 30, 2026
32 checks passed
@AlexAndBear
AlexAndBear deleted the feat/user-details-quota-usage branch September 30, 2026 09:08
@openclouders openclouders mentioned this pull request Sep 30, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants