Skip to content

Breadcrumb project picker shows only the sandbox name on the project settings page #4769

@elias-ba

Description

@elias-ba

Problem

The breadcrumb project picker on the project settings page shows only the current project's name. When the current project is a sandbox, the picker collapses to the sandbox's own name (e.g. feature-x) instead of the full ancestor path (e.g. dhis2-project/feature-x), even though the user has access to the parent.

Every other page (workflows, runs, channels, dataclips, sandboxes list) shows the full path correctly. Settings is the outlier.

Root cause

LightningWeb.LayoutComponents.breadcrumb_project_picker/1 accepts project, current_user, and access_root. When neither current_user nor access_root is passed, it falls back silently to treating the project itself as the access root, which produces the truncated label.

project_live/settings.html.heex:13 calls the picker with only project={@project}, hitting that fallback. The other call sites pass current_user={@current_user} access_root={@access_root}.

Suggested fix

Two parts, since the bug class is broader than the one missed call site:

  1. Precompute the picker label once per request. The :project_scope hook already computes access_root; add a project_label assign there. Then every page can pass label={@project_label} to the picker without each one having to know about access_root.
  2. Remove the silent fallback. The picker should require a precomputed label attr and raise (or fail the Phoenix attr check) if it isn't passed. The current code also does a DB query (access_root_for_user/2) inside a render component, which should move upstream.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions