Skip to content

OSAC-3604: Storage Tiers list page - #128

Merged
openshift-merge-bot[bot] merged 11 commits into
osac-project:mainfrom
ElayAharoni:OSAC-3604-storage-tiers-list-page
Aug 10, 2026
Merged

OSAC-3604: Storage Tiers list page#128
openshift-merge-bot[bot] merged 11 commits into
osac-project:mainfrom
ElayAharoni:OSAC-3604-storage-tiers-list-page

Conversation

@ElayAharoni

@ElayAharoni ElayAharoni commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

OSAC-3604: Storage Tiers list page

Jira: https://redhat.atlassian.net/browse/OSAC-3604
Story type: [UI]

Summary

Replaces the Tiers tab's placeholder (added by OSAC-3598) with a real list page: a table of existing storage tiers with resolved backend names, protocols, and lifecycle state, plus Create/Edit/Delete actions. Backend name resolution is scoped to exactly the backend IDs referenced on the rendered page via the existing storageBackendIdsFilter, not an unbounded fetch of every registered backend. No backend/API changes — this consumes hooks already merged in OSAC-3597/3603.

Changes

New components (libs/ui-components/src/components/Storage/)

  • StorageTierStatusLabel — wraps the shared ResourceStatusLabel for StorageTierState (ACTIVE → green "Active", UNSPECIFIED → grey "Unspecified"). Named StorageTierStatusLabel, not StorageTierStateLabel as the story/design doc say — a deliberate choice to match this codebase's existing *StatusLabel convention (SecurityGroupStatusLabel, TenantStatusLabel, etc.) instead of introducing the first *StateLabel.
  • StorageTierActionsMenu / StorageTierDeleteConfirmModal — row-actions kebab (Edit/Delete) and delete confirmation, structural copies of IdentityProviderActionsMenu/TenantDeleteConfirmModal.

List page (libs/ui-components/src/pages/admin/)

  • StorageTiersListPage — the new list page, wired into StorageManagementPage's Tiers tab in place of the old placeholder.

Routing (apps/app-frontend/src/shell/StorageRoutes.tsx)

  • Added tiers/create and tiers/:id/edit routes (currently pointing at StoragePlaceholder, mirroring the existing backends/create/backends/:id/edit pattern) — the actual create/edit tier forms are separate, later stories.
  • Added mountOnEnter/unmountOnExit to StorageManagementPage's Tabs: PatternFly mounts both tab bodies by default, so without this, visiting the Backends tab was silently mounting and data-fetching through the new Tiers page too.

Test infrastructure (libs/ui-components/src/test-utils/createMockConnectTransport.ts)

  • Added onStorageBackendList/onStorageTierDelete override hooks (needed to test exact backend-id filter scoping and delete-driven row removal).
  • Retyped three MockTransportOverrides fields (onStorageBackendList, onStorageTierList, onStorageTierDelete) from the strict generated Message type to MessageInitShape, fixing a latent type gap no prior test had exercised.

Testing

  • Unit tests: 14 new/updated test cases across StorageTierStatusLabel, StorageTierDeleteConfirmModal, StorageTiersListPage, StorageManagementPage, and StorageRoutes. Covers: row rendering (single and multi-backend-association tiers), the backend-id-fallback path, exact scoping of the backend lookup filter (proven via exclusion of an unreferenced backend), empty state, Create/Edit navigation, delete success (row removal) and delete failure (FAILED_PRECONDITION shown verbatim, row left in place), and that the inactive Backends tab no longer mounts/fetches the Tiers page.
  • Integration tests: N/A — pure frontend change against already-merged private gRPC hooks; no persisted UI-level integration/E2E suite in this repo (owned by osac-test-infra, out of scope per the design doc).
  • Coverage: No coverage tooling configured in this repo; qualitative assessment is that every public behavioral path introduced by this story has direct test coverage. Full validation report: .artifacts/implement/OSAC-3604/05-validation-report.md.

Acceptance Criteria

  • AC-1: The Tiers tab renders a real list page with columns NAME, BACKENDS, PROTOCOL(S), STATE, sourced from usePrivateStorageTiers().
  • AC-2: BACKENDS resolves each tier's spec.backends[].backendId to a name, scoping the lookup to exactly the backend IDs referenced across the rendered page via storageBackendIdsFilter.
  • AC-3: A backendId that fails to resolve falls back to displaying the raw ID rather than breaking the row.
  • AC-4: STATE renders via a state-label component wrapping the shared ResourceStatusLabel (ACTIVE → green "Active", UNSPECIFIED → grey "Unspecified"). Note: implemented as StorageTierStatusLabel, not StorageTierStateLabel as named in the story — see Changes above for rationale.
  • AC-5: /admin/storage/tiers/create and /admin/storage/tiers/:id/edit are added to StorageRoutes.tsx.
  • AC-6: "Create tier" routes to the create page; row Edit routes to the edit page; Delete calls useDeleteStorageTier(), with a FAILED_PRECONDITION response shown verbatim and the row left in place.
image

Summary by CodeRabbit

  • New Features
    • Added a Storage Tiers management view with tier listings, backend details, protocols, and status indicators.
    • Added empty, loading, and error states, including fallback backend identifiers.
    • Added navigation for creating and editing storage tiers.
    • Added tier action menus with edit and delete options, confirmation, and error handling.
  • Bug Fixes
    • Storage management tabs now load and unload content appropriately.
  • Documentation
    • Added translations for storage tier actions, statuses, errors, and related messages.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
…errides

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
MockTransportOverrides declared these fields with the strict generated
Message type, which requires $typeName on every literal returned from
a test override. No existing test exercised onStorageTierList,
onStorageBackendList, or onStorageTierDelete with a literal response
until this story's StorageTiersListPage tests, which is why the gap
was latent. MessageInitShape matches how the rest of the codebase
accepts plain-object message inputs elsewhere (e.g. useCreateStorageTier).

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
StorageManagementPage's Tabs mounted both tab bodies simultaneously
(PatternFly's default, hiding the inactive one via CSS), so every
visit to the Backends tab also mounted StorageTiersListPage and fired
its usePrivateStorageTiers/usePrivateStorageBackends fetches for
content the user never sees. Harmless while both tabs held inert
placeholders, but StorageTiersListPage is now a real, self-fetching
page. Add mountOnEnter/unmountOnExit so only the active tab's content
mounts.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@openshift-ci-robot

openshift-ci-robot commented Aug 9, 2026

Copy link
Copy Markdown

@ElayAharoni: This pull request references OSAC-3604 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set.

Details

In response to this:

OSAC-3604: Storage Tiers list page

Jira: https://redhat.atlassian.net/browse/OSAC-3604
Story type: [UI]

Summary

Replaces the Tiers tab's placeholder (added by OSAC-3598) with a real list page: a table of existing storage tiers with resolved backend names, protocols, and lifecycle state, plus Create/Edit/Delete actions. Backend name resolution is scoped to exactly the backend IDs referenced on the rendered page via the existing storageBackendIdsFilter, not an unbounded fetch of every registered backend. No backend/API changes — this consumes hooks already merged in OSAC-3597/3603.

Changes

New components (libs/ui-components/src/components/Storage/)

  • StorageTierStatusLabel — wraps the shared ResourceStatusLabel for StorageTierState (ACTIVE → green "Active", UNSPECIFIED → grey "Unspecified"). Named StorageTierStatusLabel, not StorageTierStateLabel as the story/design doc say — a deliberate choice to match this codebase's existing *StatusLabel convention (SecurityGroupStatusLabel, TenantStatusLabel, etc.) instead of introducing the first *StateLabel.
  • StorageTierActionsMenu / StorageTierDeleteConfirmModal — row-actions kebab (Edit/Delete) and delete confirmation, structural copies of IdentityProviderActionsMenu/TenantDeleteConfirmModal.

List page (libs/ui-components/src/pages/admin/)

  • StorageTiersListPage — the new list page, wired into StorageManagementPage's Tiers tab in place of the old placeholder.

Routing (apps/app-frontend/src/shell/StorageRoutes.tsx)

  • Added tiers/create and tiers/:id/edit routes (currently pointing at StoragePlaceholder, mirroring the existing backends/create/backends/:id/edit pattern) — the actual create/edit tier forms are separate, later stories.
  • Added mountOnEnter/unmountOnExit to StorageManagementPage's Tabs: PatternFly mounts both tab bodies by default, so without this, visiting the Backends tab was silently mounting and data-fetching through the new Tiers page too.

Test infrastructure (libs/ui-components/src/test-utils/createMockConnectTransport.ts)

  • Added onStorageBackendList/onStorageTierDelete override hooks (needed to test exact backend-id filter scoping and delete-driven row removal).
  • Retyped three MockTransportOverrides fields (onStorageBackendList, onStorageTierList, onStorageTierDelete) from the strict generated Message type to MessageInitShape, fixing a latent type gap no prior test had exercised.

Testing

  • Unit tests: 14 new/updated test cases across StorageTierStatusLabel, StorageTierDeleteConfirmModal, StorageTiersListPage, StorageManagementPage, and StorageRoutes. Covers: row rendering (single and multi-backend-association tiers), the backend-id-fallback path, exact scoping of the backend lookup filter (proven via exclusion of an unreferenced backend), empty state, Create/Edit navigation, delete success (row removal) and delete failure (FAILED_PRECONDITION shown verbatim, row left in place), and that the inactive Backends tab no longer mounts/fetches the Tiers page.
  • Integration tests: N/A — pure frontend change against already-merged private gRPC hooks; no persisted UI-level integration/E2E suite in this repo (owned by osac-test-infra, out of scope per the design doc).
  • Coverage: No coverage tooling configured in this repo; qualitative assessment is that every public behavioral path introduced by this story has direct test coverage. Full validation report: .artifacts/implement/OSAC-3604/05-validation-report.md.

Acceptance Criteria

  • AC-1: The Tiers tab renders a real list page with columns NAME, BACKENDS, PROTOCOL(S), STATE, sourced from usePrivateStorageTiers().
  • AC-2: BACKENDS resolves each tier's spec.backends[].backendId to a name, scoping the lookup to exactly the backend IDs referenced across the rendered page via storageBackendIdsFilter.
  • AC-3: A backendId that fails to resolve falls back to displaying the raw ID rather than breaking the row.
  • AC-4: STATE renders via a state-label component wrapping the shared ResourceStatusLabel (ACTIVE → green "Active", UNSPECIFIED → grey "Unspecified"). Note: implemented as StorageTierStatusLabel, not StorageTierStateLabel as named in the story — see Changes above for rationale.
  • AC-5: /admin/storage/tiers/create and /admin/storage/tiers/:id/edit are added to StorageRoutes.tsx.
  • AC-6: "Create tier" routes to the create page; row Edit routes to the edit page; Delete calls useDeleteStorageTier(), with a FAILED_PRECONDITION response shown verbatim and the row left in place.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ElayAharoni, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 58 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 413782fa-ba6d-46e6-b6bf-9cf290f94261

📥 Commits

Reviewing files that changed from the base of the PR and between 21b95ed and 9e5a198.

📒 Files selected for processing (8)
  • apps/app-frontend/src/shell/StorageRoutes.test.tsx
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/components/Storage/StorageTierActionsMenu.tsx
  • libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageManagementPage.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.tsx
  • libs/ui-components/src/test-utils/createMockConnectTransport.ts

Walkthrough

Changes

Storage tiers administration

Layer / File(s) Summary
Tier listing and backend resolution
libs/ui-components/src/api/v1/private/storage-backends.ts, libs/ui-components/src/components/Storage/*, libs/ui-components/src/pages/admin/StorageTiersListPage.*, libs/i18n/locales/en/translation.json
Adds the storage-tier list, backend-name resolution, status labels, loading and empty states, lookup warnings, and related tests.
Tier actions and deletion
libs/ui-components/src/components/Storage/StorageTier*, libs/ui-components/src/test-utils/createMockConnectTransport.ts, libs/i18n/locales/en/translation.json
Adds edit and delete actions, confirmation behavior, mutation error handling, deletion tests, and configurable mock transport callbacks.
Storage management integration
libs/ui-components/src/pages/admin/StorageManagementPage.*, libs/i18n/locales/en/translation.json
Replaces the Tiers placeholder with StorageTiersListPage and mounts tab content only when its tab is active.
Tier routes and navigation validation
apps/app-frontend/src/shell/StorageRoutes.*, libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx, libs/i18n/locales/en/translation.json
Adds translated create and edit routes and tests create, edit, and row-action navigation.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Admin
  participant StorageTiersListPage
  participant StorageTierActionsMenu
  participant StorageTierDeleteConfirmModal
  participant StorageAPI
  Admin->>StorageTiersListPage: open Tiers tab
  StorageTiersListPage->>StorageAPI: fetch tiers and referenced backends
  StorageAPI-->>StorageTiersListPage: return storage data
  StorageTiersListPage-->>Admin: render tier table
  Admin->>StorageTierActionsMenu: select Delete
  StorageTierActionsMenu->>StorageTierDeleteConfirmModal: open confirmation
  StorageTierDeleteConfirmModal->>StorageAPI: delete tier
  StorageAPI-->>StorageTierDeleteConfirmModal: return result
  StorageTierDeleteConfirmModal-->>StorageTiersListPage: remove deleted row
Loading

Possibly related PRs

Suggested reviewers: rawagner, batzionb

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed The PR diff has no API keys, tokens, passwords, private keys, credential URLs, sensitive-name assignments, or base64/hex blobs; the only match is an empty credentials object in a test fixture.
No-Weak-Crypto ✅ Passed The full PR diff adds no MD5, SHA1, DES, RC4, Blowfish, ECB, crypto API, custom crypto, or secret/token comparison code.
No-Injection-Vectors ✅ Passed No prohibited SQL, shell, eval/exec, pickle, YAML, os.system, or dangerouslySetInnerHTML sink appears in the touched paths; CEL IDs use escapeCelStringLiteral and UI data renders as React text.
Container-Privileges ✅ Passed The PR changes 14 app/library/test files and adds no privilege settings; the existing Containerfile uses root only for build stages and runs production as USER 1001.
No-Sensitive-Data-In-Logs ✅ Passed The full PR diff has no console, logger, telemetry, or error-reporting calls; the only password match is unchanged mock fixture data and is not logged.
Ai-Attribution ✅ Passed OSAC-3604 commits identify Claude Code and include Assisted-by: Claude Code <noreply@anthropic.com>; no AI Co-Authored-By trailers were found.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: adding the Storage Tiers list page.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Gate the Tiers list page's backend-name lookup with an enabled option
on usePrivateStorageBackends (mirroring the existing pattern in
networking.ts), avoiding a wasted this.id in [] request on every page
load. Surface backend-lookup failures as a distinct inline warning
instead of letting them look identical to the per-row deleted-backend
fallback.

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@ElayAharoni
ElayAharoni marked this pull request as ready for review August 9, 2026 14:23
@openshift-ci
openshift-ci Bot requested review from eliorerz and larsks August 9, 2026 14:23
@ElayAharoni
ElayAharoni requested review from batzionb and rawagner and removed request for eliorerz and larsks August 9, 2026 14:23

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
libs/ui-components/src/components/Storage/StorageTierStatusLabel.tsx (1)

9-19: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use a switch for the StorageTierState mapping.

resolveStorageTierStatus translates an enum value to label props. Replace the lookup map and conditional with a switch that has an UNSPECIFIED/default branch. This keeps each supported state in one readable control flow.

Proposed refactor
-const STORAGE_TIER_STATUS_MAP: Record<StorageTierState, { status: StatusKind; text: string }> = {
-  [StorageTierState.UNSPECIFIED]: { status: 'unspecified', text: 'Unspecified' },
-  [StorageTierState.ACTIVE]: { status: 'ready', text: 'Active' },
-};
-
-const resolveStorageTierStatus = (
-  state?: StorageTierState,
-): { status: StatusKind; text: string } =>
-  state !== undefined && state in STORAGE_TIER_STATUS_MAP
-    ? STORAGE_TIER_STATUS_MAP[state]
-    : STORAGE_TIER_STATUS_MAP[StorageTierState.UNSPECIFIED];
+const resolveStorageTierStatus = (
+  state?: StorageTierState,
+): { status: StatusKind; text: string } => {
+  switch (state) {
+    case StorageTierState.ACTIVE:
+      return { status: 'ready', text: 'Active' };
+    case StorageTierState.UNSPECIFIED:
+    default:
+      return { status: 'unspecified', text: 'Unspecified' };
+  }
+};

Based on learnings: prefer a switch statement when translating a discriminant to corresponding component props.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/components/Storage/StorageTierStatusLabel.tsx` around
lines 9 - 19, Replace STORAGE_TIER_STATUS_MAP and the conditional lookup in
resolveStorageTierStatus with a switch on state, returning the existing
status/text props for ACTIVE and an UNSPECIFIED/default branch for undefined or
unsupported values.

Source: Learnings

libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx (1)

52-71: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Test unmounting after leaving the Tiers tab.

This test starts on the Backends tab, so it only verifies mountOnEnter. It does not verify unmountOnExit. Start on /admin/storage/tiers, wait for the tier request, switch to Backends, and assert that the Tiers content is removed and no further tier request occurs.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx` around
lines 52 - 71, Update the test around StorageManagementPage to start at
`/admin/storage/tiers`, wait for the tier request and content, then navigate to
the Backends tab. Assert the Tiers content is removed after switching and that
`onStorageTierList` is not called again, covering unmount-on-exit rather than
only initial mount behavior.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/ui-components/src/pages/admin/StorageTiersListPage.tsx`:
- Around line 60-70: Render the Create tier action independently of the error
state in StorageTiersListPage, removing the !error guard while preserving its
existing navigation behavior. Add a test covering a usePrivateStorageTiers list
error and verify the Create tier button remains available.

---

Nitpick comments:
In `@libs/ui-components/src/components/Storage/StorageTierStatusLabel.tsx`:
- Around line 9-19: Replace STORAGE_TIER_STATUS_MAP and the conditional lookup
in resolveStorageTierStatus with a switch on state, returning the existing
status/text props for ACTIVE and an UNSPECIFIED/default branch for undefined or
unsupported values.

In `@libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx`:
- Around line 52-71: Update the test around StorageManagementPage to start at
`/admin/storage/tiers`, wait for the tier request and content, then navigate to
the Backends tab. Assert the Tiers content is removed after switching and that
`onStorageTierList` is not called again, covering unmount-on-exit rather than
only initial mount behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: d6a3320a-7f4d-41e4-90e8-68ccaa3a6263

📥 Commits

Reviewing files that changed from the base of the PR and between 4d7ae6c and 0920ea6.

📒 Files selected for processing (14)
  • apps/app-frontend/src/shell/StorageRoutes.test.tsx
  • apps/app-frontend/src/shell/StorageRoutes.tsx
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/api/v1/private/storage-backends.ts
  • libs/ui-components/src/components/Storage/StorageTierActionsMenu.tsx
  • libs/ui-components/src/components/Storage/StorageTierDeleteConfirmModal.test.tsx
  • libs/ui-components/src/components/Storage/StorageTierDeleteConfirmModal.tsx
  • libs/ui-components/src/components/Storage/StorageTierStatusLabel.test.tsx
  • libs/ui-components/src/components/Storage/StorageTierStatusLabel.tsx
  • libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageManagementPage.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.tsx
  • libs/ui-components/src/test-utils/createMockConnectTransport.ts

Comment thread libs/ui-components/src/pages/admin/StorageTiersListPage.tsx Outdated
@batzionb

batzionb commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

rename State column to Status and put it after the name column to match most resource tables

- Keep the Create tier action available when the tier list fails to
  load — a failed List doesn't mean creation is broken (CodeRabbit).
- Add a test covering unmountOnExit for the Tiers tab, not just
  mountOnEnter (CodeRabbit).
- Rename the STATE column to Status and move it right after Name, to
  match every other resource table in this codebase (batzionb).

Assisted-by: Claude Code <noreply@anthropic.com>
Signed-off-by: Elay Aharoni <elayaha@gmail.com>
@ElayAharoni

Copy link
Copy Markdown
Contributor Author

@batzionb Done — renamed the column header to Status and moved it right after Name, matching TenantListPage, IdentityProviderListPage, and ClustersTable. Fixed in 21b95ed.

@coderabbitai Also addressed both nitpicks from the review, with one exception:

  • StorageManagementPage.test.tsx unmountOnExit coverage: added a test that starts on the Tiers tab, waits for its fetch, switches to Backends, and asserts the Tiers content is gone and no additional tier request fired. Fixed in 21b95ed.
  • StorageTierStatusLabel.tsx switch vs. Record map: not changing this one. StorageTierStatusLabel was deliberately modeled on SecurityGroupStatusLabel, and the Record-map-plus-lookup shape it uses is also what SubnetStatusLabel, VirtualNetworkStatusLabel, TenantStatusLabel, and IdentityProviderStatusLabel all do — 5 of the 6 existing *StatusLabel components in this codebase follow this pattern (only ClusterStatusLabel uses a switch, and even that one still indexes into a backing Record). Converting just this one to a switch would make it the outlier relative to its own template and most of its siblings, for a 2-value enum where a switch wouldn't add meaningful readability. Keeping it consistent with the majority precedent.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown

Tip

For best results, initiate chat on the files or code changes.

@ElayAharoni The StorageManagementPage.test.tsx coverage change addresses the test concern.

Your StorageTierStatusLabel.tsx rationale is valid. The Record lookup matches the established status-label pattern. I withdraw the switch recommendation.

You are interacting with an AI system.

coderabbitai[bot]
coderabbitai Bot previously requested changes Aug 10, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx (1)

87-93: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Assert the changed column label and order.

This test verifies only the rendered Active labels. It does not verify that the column header is Status or that it appears immediately after Name, which are explicit requirements of this PR.

Suggested assertions
   await waitFor(() => {
     expect(screen.getAllByText('Active')).toHaveLength(2);
   });
+  expect(screen.getByRole('columnheader', { name: 'Status' })).toBeInTheDocument();
+  expect(
+    screen.getAllByRole('columnheader')
+      .slice(0, 4)
+      .map((header) => header.textContent?.trim()),
+  ).toEqual(['Name', 'Status', 'Backends', 'Protocol(s)']);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx` around
lines 87 - 93, Extend the test “renders the STATUS column via
StorageTierStatusLabel” to assert that the table header is labeled “Status” and
that it appears immediately after the “Name” header, while preserving the
existing checks for the two rendered “Active” labels.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx`:
- Around line 91-94: Update the test around the mounted storage-tier query to
use an empty storage tier fixture, then move the onStorageTierList call-count
assertion inside the existing waitFor that waits for the Create tier button.
Keep the assertion at one call so it is synchronized with usePrivateStorageTiers
completion and verifies only the mount-triggered query.

In `@libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx`:
- Around line 186-199: The test around “keeps the Create tier action available
when the tier list fails to load” must first verify that the storage-tier
request was invoked and failed, then assert the “Create tier” button remains
present. Track the onStorageTierList invocation or await the rendered error
state before checking the button, so the assertion cannot pass without
exercising the failure path.

---

Outside diff comments:
In `@libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx`:
- Around line 87-93: Extend the test “renders the STATUS column via
StorageTierStatusLabel” to assert that the table header is labeled “Status” and
that it appears immediately after the “Name” header, while preserving the
existing checks for the two rendered “Active” labels.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: osac-project/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: dadcbaaf-9c29-4a61-9994-7302e917dc19

📥 Commits

Reviewing files that changed from the base of the PR and between 0920ea6 and 21b95ed.

📒 Files selected for processing (4)
  • libs/i18n/locales/en/translation.json
  • libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx
  • libs/ui-components/src/pages/admin/StorageTiersListPage.tsx
💤 Files with no reviewable changes (1)
  • libs/i18n/locales/en/translation.json
🚧 Files skipped from review as they are similar to previous changes (1)
  • libs/ui-components/src/pages/admin/StorageTiersListPage.tsx

Comment thread libs/ui-components/src/pages/admin/StorageManagementPage.test.tsx
Comment thread libs/ui-components/src/pages/admin/StorageTiersListPage.test.tsx

@batzionb batzionb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix routes after #129 is merged

…rs-list-page

# Conflicts:
#	apps/app-frontend/src/shell/StorageRoutes.test.tsx
@openshift-ci openshift-ci Bot added the lgtm label Aug 10, 2026
@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: batzionb, ElayAharoni

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [ElayAharoni,batzionb]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot
openshift-merge-bot Bot merged commit d0cbc5a into osac-project:main Aug 10, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants