Skip to content

feat(ui): clavis pca certitificate get-by-id#844

Merged
vlad-schur-external-sap merged 9 commits into
mainfrom
vlad-clavis-pca-cert-get-by-id
May 28, 2026
Merged

feat(ui): clavis pca certitificate get-by-id#844
vlad-schur-external-sap merged 9 commits into
mainfrom
vlad-clavis-pca-cert-get-by-id

Conversation

@vlad-schur-external-sap
Copy link
Copy Markdown
Contributor

@vlad-schur-external-sap vlad-schur-external-sap commented May 27, 2026

Summary

Implemented details page with all states, connected bff endpoint, showing certificate-information(csr, project/pca/certificate ids, subject etc)

Changes Made

  • Implemented certificate-details route with get-by-id request showing required data (cert/ca/proj ids, subject and validity period)
  • Added navigation from the pcaId-list
  • Added states(loading/error/no-data) for viewing certificate

Related Issues

Testing Instructions

  1. pnpm i
  2. pnpm run test

Checklist

  • I have performed a self-review of my code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.
  • I have made corresponding changes to the documentation (if applicable).
  • My changes generate no new warnings or errors.

Summary by CodeRabbit

  • New Features
    • Added certificate details page displaying certificate ID, CA ID, and validity period
    • Certificate rows in tables are now clickable to navigate to full certificate details
    • Added loading, error, and not-found states for certificate viewing

Review Change Stack

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>
@vlad-schur-external-sap vlad-schur-external-sap requested a review from a team as a code owner May 27, 2026 15:08
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 27, 2026

Warning

Review limit reached

@vlad-schur-external-sap, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 42 minutes and 9 seconds. 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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0915b99e-5323-4ff0-8c55-2d9336dca336

📥 Commits

Reviewing files that changed from the base of the PR and between 1cd5ad8 and 68d815a.

📒 Files selected for processing (2)
  • apps/aurora-portal/docs/0011_clavis.md
  • apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/$certificateId.tsx
📝 Walkthrough

Walkthrough

This PR adds a new certificate details page for PCA certificates, including backend service/schema updates, TanStack Router registration, a React route component with data fetching and UI rendering, table row navigation wiring, and localization strings for English and German languages.

Changes

Certificate Details Page and Navigation

Layer / File(s) Summary
Backend certificate service and schema updates
apps/aurora-portal/src/server/Services/routers/pcaRouter.ts, apps/aurora-portal/src/server/Services/routers/pcaRouter.test.ts
pcaRouter.getByIdCertificate switches service from clavis to pca and parses responses with CertificateSchema instead of CertificateResponseSchema. Test fixtures and error messages are updated accordingly.
Route tree generation and type registry for certificate details
apps/aurora-portal/src/client/routeTree.gen.ts
TanStack Router type registry extended with new route import, instance, and all type mappings (FileRoutesByFullPath, FileRoutesByTo, FileRoutesById, FileRouteTypes unions, module declaration, and parent-route interface/constant) to register /$certificateId.
Certificate details route component and test suite
apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/$certificateId.tsx, apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/$certificateId.test.tsx
New route fetches certificate data via TRPC and renders loading, error, not-found, and success states; includes validity-duration calculation and back-navigation. Test suite mocks TRPC query and router, verifying all UI states and navigation behavior.
Certificate table row click navigation
apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.tsx, apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.test.tsx
Row-click handler uses useNavigate to route to certificate details with certificateId param. Test mocks useNavigate and asserts expected navigation call.
English and German localization for certificate details UI
apps/aurora-portal/src/locales/en/messages.po, apps/aurora-portal/src/locales/de/messages.po
Five new i18n entries for back-navigation label, certificate-not-found error, load-error message, loading status, and manage-certificate call-to-action; German translations are empty placeholders.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related issues

Possibly related PRs

  • cobaltcore-dev/aurora-dashboard#840: Certificate row-click navigation routes to this PR's new $certificateId details route, creating a direct dependency between the listing UI and details view.
  • cobaltcore-dev/aurora-dashboard#770: Both PRs modify pcaRouter.getByIdCertificate; the referenced PR added the initial procedure and schemas, while this PR changes its implementation to use pca service and CertificateSchema parsing.
  • cobaltcore-dev/aurora-dashboard#774: Both PRs interact through CertificateSchema type definitions; this PR uses it for response parsing while the referenced PR updates the schema contract itself.

Suggested reviewers

  • KirylSAP
  • mark-karnaukh-extern-sap
  • andypf

Poem

🐰 A certificate route so bright,
Details page—what a sight!
From table rows to nested views,
With translations in English and blues,
The PCA's secrets now in light!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title partially relates to the changeset. It mentions 'clavis pca certificate get-by-id' but the changes show a migration from clavis to pca service and a UI feature for viewing PCA certificate details. The title should be more specific about the main objective. Consider: 'feat(ui): Add PCA certificate details page' or 'feat: Implement certificate get-by-id route and details view' to better reflect the full scope of UI and API changes.
✅ Passed checks (3 passed)
Check name Status Explanation
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.
Description check ✅ Passed The PR description follows the template structure with all required sections completed: Summary, Changes Made, Related Issues, Testing Instructions, and Checklist all filled in with relevant information.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch vlad-clavis-pca-cert-get-by-id

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 and usage tips.

@vlad-schur-external-sap vlad-schur-external-sap marked this pull request as ready for review May 28, 2026 07:49
Signed-off-by: Vladislav Schur <u.shchur@sap.com>
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.test.tsx (1)

60-64: ⚡ Quick win

Strengthen navigation assertion to verify certificateId mapping.

Current check only validates that params is a function. Assert the function result to catch regressions in route param construction.

✅ Suggested test improvement
     expect(mockNavigate).toHaveBeenCalledWith({
       from: "/projects/$projectId/services/pca/$pcaId/",
       to: "$certificateId",
       params: expect.any(Function),
     })
+
+    const navArg = mockNavigate.mock.calls[0][0]
+    expect(navArg.params({ projectId: "project-1", pcaId: "ca-1" })).toEqual({
+      projectId: "project-1",
+      pcaId: "ca-1",
+      certificateId: "cert-123",
+    })
   })
🤖 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/$pcaId/-components/-table/PcaCertificatesTableRow.test.tsx
around lines 60 - 64, The test currently asserts mockNavigate was called with
params: expect.any(Function) but doesn't verify the function returns the correct
route params; update the assertion to call the captured params function and
assert its return maps the certificate id correctly. Locate the expectation
around mockNavigate (the call using
expect(mockNavigate).toHaveBeenCalledWith({...})) and replace the generic params
check by extracting the params function (from the matched call) and invoking it
with the same input used in the component, then assert the returned object
contains the expected certificateId value (e.g., returnedParams.certificateId
=== "$certificateId") to ensure correct route param construction.
🤖 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/-table/PcaCertificatesTableRow.tsx:
- Around line 28-32: The DataGridRow currently only uses onClick (DataGridRow
with key={certificate.id} and onClick={navigateToCertificateDetailsPage}),
making navigation mouse-only; update the row to be keyboard-accessible by either
moving the navigation into a real interactive element inside a cell (preferred)
or adding tabIndex={0}, role="button", and an onKeyDown handler on DataGridRow
that calls navigateToCertificateDetailsPage when Enter or Space is pressed (use
certificate.id in the test-id/data attributes to keep references consistent).

In
`@apps/aurora-portal/src/client/routes/_auth/projects/`$projectId/services/pca/$pcaId/$certificateId.tsx:
- Line 40: RouteComponent is calling setPageTitle(...) directly during render
(both in the isLoading branch and after certificate is available); move those
calls into a useEffect hook so you don't cause render-phase side effects.
Specifically, remove direct calls to setPageTitle from the render body of
RouteComponent and add a useEffect that depends on [isLoading, certificate]
which sets the title to "Loading..." when isLoading is true and sets the
certificate title when certificate is non-null; reference the existing
setPageTitle function and the isLoading and certificate variables inside that
effect.
- Around line 49-53: Move the Route.useParams() call out of the click handler:
in the RouteComponent body call Route.useParams() once (e.g., const params =
Route.useParams()) and use params.projectId and params.pcaId when building the
navigate call inside handleBack (which currently calls navigate with to and
params). Update handleBack to reference the precomputed params instead of
calling Route.useParams() inline so params are reused and not re-evaluated on
each click.

---

Nitpick comments:
In
`@apps/aurora-portal/src/client/routes/_auth/projects/`$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.test.tsx:
- Around line 60-64: The test currently asserts mockNavigate was called with
params: expect.any(Function) but doesn't verify the function returns the correct
route params; update the assertion to call the captured params function and
assert its return maps the certificate id correctly. Locate the expectation
around mockNavigate (the call using
expect(mockNavigate).toHaveBeenCalledWith({...})) and replace the generic params
check by extracting the params function (from the matched call) and invoking it
with the same input used in the component, then assert the returned object
contains the expected certificateId value (e.g., returnedParams.certificateId
=== "$certificateId") to ensure correct route param construction.
🪄 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: b6c8dc7b-b8f3-4b3d-aba6-a5fde0e61859

📥 Commits

Reviewing files that changed from the base of the PR and between ff1f658 and 1cd5ad8.

📒 Files selected for processing (11)
  • apps/aurora-portal/src/client/routeTree.gen.ts
  • apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/$certificateId.test.tsx
  • apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/$certificateId.tsx
  • apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.test.tsx
  • apps/aurora-portal/src/client/routes/_auth/projects/$projectId/services/pca/$pcaId/-components/-table/PcaCertificatesTableRow.tsx
  • apps/aurora-portal/src/locales/de/messages.po
  • apps/aurora-portal/src/locales/de/messages.ts
  • apps/aurora-portal/src/locales/en/messages.po
  • apps/aurora-portal/src/locales/en/messages.ts
  • apps/aurora-portal/src/server/Services/routers/pcaRouter.test.ts
  • apps/aurora-portal/src/server/Services/routers/pcaRouter.ts

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@vlad-schur-external-sap vlad-schur-external-sap merged commit 977e992 into main May 28, 2026
16 checks passed
@vlad-schur-external-sap vlad-schur-external-sap deleted the vlad-clavis-pca-cert-get-by-id branch May 28, 2026 09:25
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.

[Task](clavis): get-by-id certificate issued by CA

4 participants