Fix shortcuts for top nav redesign
- Requirements (issue)
- Tasks (epic)
- Full Context Spike MR (permanent draft)
- All MR parts ...
What does this MR do?
In a separate MR !61831 (merged) we are migrating the feature specs to support the top nav redesign. This revealed that there was a bug recently introduced because we didn't move over the hidden shortcut links yet.
What do you mean hidden shortcut links?
- A number of our shortcuts are implemented with a
findAndFollowLink
which implies that the selector has to exist on the page. - Since we haven't moved over these selectors yet (example), when the
:combined_menu
feature flag is on, the shortcuts no longer work😞
So what does this MR actually do?
This MR, updates our view model builder to support easily adding shortcuts, moves over the missing shortcuts from _dashboard.html.haml
and _explore.html.haml
to the top_nav_helper.rb
. These shortcuts are then rendered in the top_nav.html.haml
so that they aren't dependent on the dropdown being open (which could be lazy loaded in the future).
Screenshots (strongly suggested)
How do I test this?
- You will first want to enable the
:combined_menu
feature flag in a rails console. - Then try hitting one of the "Go to X" shortcuts, such as
SHIFT+P
orSHIFT+G
Demo:
20210518_fix_shortcuts_combined_menu
Does this MR meet the acceptance criteria?
Conformity
-
[ ] I have included a changelog entry, or it's not needed. (Does this MR need a changelog?)Not needed since behind feature flag -
I have added/updated documentation, or it's not needed. (Is documentation required?) -
I have properly separated EE content from FOSS, or this MR is FOSS only. (Where should EE code go?) -
I have self-reviewed this MR per code review guidelines. -
This MR does not harm performance, or I have asked a reviewer to help assess the performance impact. (Merge request performance guidelines) -
I have followed the style guides.
Availability and Testing
-
I have added/updated tests following the Testing Guide, or it's not needed. (Consider all test levels. See the Test Planning Process.)
References
Related to #301143 (closed)
Edited by Paul Slaughter