Stop issuable navigation after visiting a URL without a full path
What does this MR do and why?
A click on an item in the dashboard issues list logs TypeError: Cannot read properties of undefined (reading 'push').
IssuableItem#navigateToIssuable has a branch for lists that have no fullPath, such as the dashboard work items list. That branch calls visitUrl, but it has no return. The method then continues to canRouterNav:
- With an empty
fullPath, the project pattern becomes/-/(work_items|issues)(/\d+)?/?$, which matches every issue URL. - So
canRouterNavreturnstrue, and the method callsthis.$router.push. - The dashboard has no Vue Router, so
$routerisundefinedand the call throws.
The page still navigates, because visitUrl ran first. The error only appears in the console. This MR adds the missing return and removes the allowlist entry for this error.
References
- Part of #628901
- Allowlist entry added in !256639 (merged)
Screenshots or screen recordings
The page looks the same before and after. The only change is that the console error is gone. These screenshots show local validation at 9283fb31: a click on the issue in the dashboard list opens the project issue page, and the browser console shows no push error.
Dashboard list (/dashboard/issues) |
After the click |
|---|---|
![]() |
![]() |
How to set up and validate locally
- Go to Issues on your dashboard (
/dashboard/issues). - Select the title of an issue. Before this change, the console shows the
pusherror.
Automated checks:
- The new Jest example in
issuable_item_spec.jsfails onmasterwith the sameTypeErrorand passes with this change. spec/features/dashboard/issues_spec.rb:79passes locally without the allowlist entry.
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.

