feat(ui): clavis pca get-by-id#838
Conversation
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
|
Warning Review limit reached
More reviews will be available in 40 minutes. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR introduces a new Private Certificate Authority details page under ChangesPCA Detail Page Feature
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
There was a problem hiding this comment.
Pull request overview
This PR adds a PCA (Private Certificate Authority) certificate-authority details page in the Aurora Portal UI and updates the server-side PCA “get by id” endpoint to support the new detail view.
Changes:
- Update
pcaRouter.getByIdto use the"pca"OpenStack service and parse a directCertificateAuthoritypayload. - Add a new PCA details route (
/projects/:projectId/services/pca/:pcaId) plus a details view component and tests. - Add navigation from the PCA list table rows to the new details page and update i18n catalogs.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
| apps/aurora-portal/src/server/Services/routers/pcaRouter.ts | Switch PCA get-by-id to "pca" service + direct schema parsing. |
| apps/aurora-portal/src/server/Services/routers/pcaRouter.test.ts | Adjust get-by-id test payload shape and service naming expectations. |
| apps/aurora-portal/src/locales/en/messages.ts | Regenerated compiled EN catalog for new PCA strings. |
| apps/aurora-portal/src/locales/en/messages.po | Add EN strings for PCA details page. |
| apps/aurora-portal/src/locales/de/messages.ts | Regenerated compiled DE catalog for new PCA strings. |
| apps/aurora-portal/src/locales/de/messages.po | Add DE msgids for PCA details page (translations currently empty). |
| apps/aurora-portal/src/client/routeTree.gen.ts | Add generated route entries for PCA details route. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/index.tsx | Use shared ContentHeader on PCA list page. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/index.tsx | New route: fetch and render PCA by id with loading/error/empty states. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/PcaDetailsView.tsx | New PCA details UI (basic info + CSR/cert card + delete action). |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/PcaDetailsView.test.tsx | Tests for details view rendering and delete flow navigation. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-table/PcaTableRow.tsx | Make PCA table rows navigable to the details route. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-table/PcaTableRow.test.tsx | Add test coverage for row-click navigation. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-modals/DeletePcaModal.tsx | Add optional onSuccess callback for post-delete navigation. |
| apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-modals/DeletePcaModal.test.tsx | Test new onSuccess callback behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-table/PcaTableRow.test.tsx (1)
10-18: ⚡ Quick winReset shared
mockNavigatebetween tests.
mockNavigateis module-scoped; add a reset hook to keep test outcomes independent as this suite grows.Suggested patch
import { describe, expect, it, vi } from "vitest" @@ const mockNavigate = vi.fn() + +beforeEach(() => { + mockNavigate.mockClear() +})🤖 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 `@apps/aurora-portal/src/client/routes/_auth/projects/`$projectId/services/pca/-components/-table/PcaTableRow.test.tsx around lines 10 - 18, The module-scoped mockNavigate (created as const mockNavigate = vi.fn()) is reused across tests causing state leakage; add a test lifecycle hook (e.g., beforeEach or afterEach) in PcaTableRow.test.tsx to reset/clear the mock (call mockNavigate.mockReset() or use vi.clearAllMocks()/vi.resetAllMocks()) so each test starts with a fresh mock; keep the existing vi.mock for useNavigate unchanged but ensure the reset hook references the mockNavigate symbol.
🤖 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
`@apps/aurora-portal/src/client/routes/_auth/projects/`$projectId/services/pca/$pcaId/-components/PcaDetailsView.tsx:
- Around line 42-47: The certificate validity duration calculation in
PcaDetailsView.tsx uses new Date(...) on Unix seconds
(pca.certificate.validity.not_before / not_after) which expects milliseconds,
producing wrong day counts; update the duration compute (where
pca.certificate?.validity.not_before and pca.certificate?.validity.not_after are
used) to multiply the seconds by 1000 before creating Date objects (or otherwise
convert to milliseconds) and also adjust PcaDetailsView.test.tsx fixtures to
provide Unix seconds (remove any * 1000) so tests match the real model.
In `@apps/aurora-portal/src/locales/de/messages.po`:
- Around line 298-299: Several new PCA-related msgid entries (e.g., "Back to
Certificate Authorities", "CA ID", "Certificate Authority not found", "Delete
Certificate Authority", "Duration/validity", "Error loading Certificate
Authority", "Loading Certificate Authority Details...", "Manage your Private
Certificate Authority infrastructure", "Subject") in messages.po have empty
msgstr values; populate each corresponding msgstr with the correct German
translation (or, if intentional, add a TODO comment and reference a tracking
issue ID) so German users see localized text; update the msgstr for each listed
msgid in apps/aurora-portal/src/locales/de/messages.po and ensure
consistency/grammar across entries before merging.
---
Nitpick comments:
In
`@apps/aurora-portal/src/client/routes/_auth/projects/`$projectId/services/pca/-components/-table/PcaTableRow.test.tsx:
- Around line 10-18: The module-scoped mockNavigate (created as const
mockNavigate = vi.fn()) is reused across tests causing state leakage; add a test
lifecycle hook (e.g., beforeEach or afterEach) in PcaTableRow.test.tsx to
reset/clear the mock (call mockNavigate.mockReset() or use
vi.clearAllMocks()/vi.resetAllMocks()) so each test starts with a fresh mock;
keep the existing vi.mock for useNavigate unchanged but ensure the reset hook
references the mockNavigate symbol.
🪄 Autofix (Beta)
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: defaults
Review profile: CHILL
Plan: Pro
Run ID: aa5fbb7b-8cb1-4a92-88ec-bd8c0d106b0c
📒 Files selected for processing (15)
apps/aurora-portal/src/client/routeTree.gen.tsapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/PcaDetailsView.test.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/PcaDetailsView.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/index.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-modals/DeletePcaModal.test.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-modals/DeletePcaModal.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-table/PcaTableRow.test.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/-components/-table/PcaTableRow.tsxapps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/index.tsxapps/aurora-portal/src/locales/de/messages.poapps/aurora-portal/src/locales/de/messages.tsapps/aurora-portal/src/locales/en/messages.poapps/aurora-portal/src/locales/en/messages.tsapps/aurora-portal/src/server/Services/routers/pcaRouter.test.tsapps/aurora-portal/src/server/Services/routers/pcaRouter.ts
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
Summary
Implemented details page, connected bff endpoint, showing ca-information(csr, project/pca ids, subject etc), connected delete modal to details page with redirect/invalidation to the list page.
Changes Made
Related Issues
Testing Instructions
pnpm ipnpm run testChecklist
Summary by CodeRabbit
Release Notes