Skip to content

Fix PSS side nav highlight issue#16462

Merged
momesgin merged 3 commits intorancher:masterfrom
momesgin:14780-pss-highlight
Jan 30, 2026
Merged

Fix PSS side nav highlight issue#16462
momesgin merged 3 commits intorancher:masterfrom
momesgin:14780-pss-highlight

Conversation

@momesgin
Copy link
Copy Markdown
Member

Summary

Fixes #14780

Occurred changes and/or fixed issues

  • Introduced a new ProjectSecretProxy component (shell/edit/projectsecret.vue) to handle Create/Edit views for the projectsecret resource by wrapping the standard Secret edit component. This ensures the correct component is loaded while preserving the route context required for sidebar highlighting.
  • Fixed an issue where editing a Project Secret would cause the sidebar navigation to close and lose highlighting by ensuring the correct route is used.

Technical notes summary

  • Updated createLocation in shell/list/projectsecret.vue to target VIRTUAL_TYPES.PROJECT_SECRETS.
  • Removed exact: true from the Project Secrets menu definition in shell/config/product/explorer.js to allow the menu item to remain active for sub-routes (create/edit).
  • Added shell/edit/projectsecret.vue which wraps @shell/edit/secret/index.vue. This component is required because the resource loader searches for an editor based on the route's resource name (projectsecret).
  • Updated detailLocation in shell/models/secret.js to use the correct generic route c-cluster-product-resource-namespace-id. This fixes the sidebar losing state after going to edit config or detail page of a PSS.
  • Added unit tests.

Areas or cases that should be tested

  • Navigate to Explorer > Storage > Project Secrets. Click "Create". Verify the URL uses the projectsecret resource and the "Project Secrets" sidebar item remains highlighted.
  • Edit an existing Project Secret. Verify the sidebar item remains highlighted.

Areas which could experience regressions

  • Project Secret creation and editing flows.
  • Sidebar highlighting behaviour for Secrets.
  • Verify that creating and editing Project Secrets and standard secrets work exactly as before.

Screenshot/Video

psshl.mov

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

@momesgin momesgin added this to the v2.14.0 milestone Jan 24, 2026
@momesgin momesgin requested a review from Copilot January 24, 2026 00:36
@momesgin momesgin self-assigned this Jan 24, 2026
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.

Pull request overview

This PR refines routing and component wiring for project-scoped secrets so that the “Project Secrets” item in the Explorer sidebar stays open and highlighted when creating, viewing, or editing project-scoped secrets.

Changes:

  • Updated routing for project-scoped secrets to use the generic c-cluster-product-resource-namespace-id route with resource: VIRTUAL_TYPES.PROJECT_SECRETS, so navigation remains consistent and the sidebar highlight persists.
  • Added a ProjectSecretProxy edit component and associated unit tests to bridge the projectsecret virtual type to the standard Secret editor while maintaining the correct route context.
  • Adjusted Explorer product configuration and the Project Secrets list view so that list/create flows use the project-secrets virtual type and the menu item remains active on sub-routes.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
shell/models/secret.js Adjusts detailLocation for project-scoped secrets to use the generic c-cluster-product-resource-namespace-id route with resource: VIRTUAL_TYPES.PROJECT_SECRETS, aligning navigation with the Explorer sidebar highlighting expectations.
shell/list/projectsecret.vue Updates createLocation() so Project Secret creation uses the projectsecret virtual type route (with appropriate query scope) while still favoriting the Project Secrets list in the masthead.
shell/edit/projectsecret.vue Introduces ProjectSecretProxy, a thin wrapper that forwards all attrs to the standard Secret editor, allowing the router to resolve an edit component for projectsecret without changing list behavior.
shell/edit/__tests__/projectsecret.test.ts Adds unit tests validating that ProjectSecretProxy renders the Secret component and correctly forwards attributes and listeners, guarding against regressions in the proxy behavior.
shell/config/product/explorer.js Configures VIRTUAL_TYPES.PROJECT_SECRETS to use the Secret schema (resource: SECRET) and removes exact: true from the Project Secrets virtual nav item so that the sidebar item stays active across create/edit/detail routes.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@momesgin momesgin requested a review from richard-cox January 26, 2026 19:08
@momesgin momesgin merged commit bdba557 into rancher:master Jan 30, 2026
151 of 160 checks passed
@momesgin momesgin deleted the 14780-pss-highlight branch January 30, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Project Scoped Secrets: When viewing or editing a pss the side nav does not highlight the correct resource

3 participants