Fix Roadmap not loading when epics have inaccessible parents
What does this MR do and why?
Fixes a bug where Roadmap breaks during loading if any epic has a parent that's inaccessible to the current user to due permissions. Additionally, it also fixes an issue where number of epics shown on Roadmap are too few such that there's an empty space below the roadmap instead of having a proper empty row (see before/after screenshots).
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Notice the whitespace below Roadmap timeline;
Before | After |
---|---|
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Take two groups containing epics;
A
andB
. - Make sure all the epics of both the groups have at least start or due date set.
- Make sure both
A
andB
groups are Private. - Take a user in your GDK, eg;
foo
and make them member ofA
(with role beingDeveloper
), make sure they're not member ofB
though. - Take any Epic from group
B
and add a child epic from groupA
. - Login as user
foo
, you can alternatively impersonate them from Admin area, see https://docs.gitlab.com/ee/administration/admin_area.html#user-impersonation - Go to Roadmap of group
A
, it will break with JS errors without fixes made in this MR, but on this MR's branch, it will load without issues.
Related to #474167 (closed)