Skip to content

fix(web-pkg): show resource table columns if any resource has the field - #3512

Merged
AlexAndBear merged 1 commit into
mainfrom
fix/resource-table-columns-of-all-resources
Oct 1, 2026
Merged

AlexAndBear merged 1 commit into
mainfrom
fix/resource-table-columns-of-all-resources

Conversation

@AlexAndBear

@AlexAndBear AlexAndBear commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Description

The ResourceTable decided which columns to show by looking at the first resource only. Resources of the same type can still differ in their fields. Disabled spaces, for example, come with spaceQuota.total but without spaceQuota.used and spaceQuota.remaining. When a disabled space was sorted to the top of the list, the "Used quota" and "Remaining quota" columns were dropped for all spaces.

A column is now shown if any resource has the field. The sort fields still come from the first resource, because they only depend on the resource type, which is the same for all rows.

Steps to reproduce (before this fix)

  1. Log in as an admin and create a project space whose name sorts first (e.g. 1 disabled).
  2. Disable that space (context menu → "Disable").
  3. Open the files app → "Spaces" and switch to the table view.
  4. With "Show disabled spaces" off, the "Total quota", "Used quota" and "Remaining quota" columns are shown.
  5. Turn "Show disabled spaces" on: the disabled space is now the first row and the "Used quota" and "Remaining quota" columns disappear for all spaces.

Expected: the quota columns stay visible; the disabled space shows - for the used and remaining quota.

Related Issue

  • No issue, the steps to reproduce are in the description above.

How Has This Been Tested?

  • test environment: unit tests with Vitest, type check, lint and format
  • test case 1: new unit test in ResourceTable.spec.ts: a disabled space without used quota as the first row, followed by an enabled space, still shows all quota columns (fails without the fix)
  • test case 2: unit tests of web-pkg, web-app-files and web-app-admin-settings pass
  • test case 3: pnpm check:types, 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 merged commit 4ed1c28 into main Oct 1, 2026
32 checks passed
@AlexAndBear
AlexAndBear deleted the fix/resource-table-columns-of-all-resources branch October 1, 2026 07:40
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenCloud Team Board Oct 1, 2026
@openclouders openclouders mentioned this pull request Oct 1, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants