Let a route name the parameter its crumb reads

What does this MR do and why?

This change is behind the feature flag :artifact_registry_ui

The artifact registry's dynamic breadcrumb and its document title both read params.id outright. That works while the repository node is the only dynamic route in the SPA, but the version list slice registers an artifact segment nested under it, and the ancestor :id node has already bound that name to the repository.

Both surfaces now read the parameter the route names in meta.idParam, defaulting to id. No registered route declares one, so every route in the SPA renders exactly the crumb and title it does today. This is the seam the version list route consumes; it ships on its own because both files are shared by every artifact registry route.

Changes

  • artifact_registry_breadcrumbs.vue reads params[meta.idParam ?? 'id'] for the dynamic crumb.
  • updateDocumentTitle in utils.js applies the same rule. It read the param once for the whole trail, which cannot answer per route, so the lookup moved inside the fold. meta.title keeps its precedence.
  • Jest coverage for the named-parameter branch and the unchanged default, on both surfaces. The breadcrumbs spec drives a router built in the spec, since no merged route nests a dynamic segment under another one yet.

Screenshots or screen recordings

No visible change. Verified in the GDK that the trail and the title are unchanged on all three dynamic-route surfaces:

Route Breadcrumb trail Document title
/ Default / Repositories Repositories · Default · GitLab
/payment-core Default / Repositories / payment-core payment-core · Repositories · Default · GitLab
/payment-core/edit Default / Repositories / payment-core / Edit Edit hosted repository · payment-core · Repositories · Default · GitLab

How to set up and validate locally

  1. Enable the flag: Feature.enable(:artifact_registry_ui).
  2. Visit /o/<organization>/-/artifact_registry/acme/repositories.
  3. Open a repository, then its Edit form.
  4. Confirm the breadcrumb trail and the browser tab title match the table above — this MR should change neither.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading