Skip to content

Fix shortcuts for top nav redesign

Paul Slaughter requested to merge 301143-fix-shortcuts into master

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 or SHIFT+G

Demo:

20210518_fix_shortcuts_combined_menu

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

References

Related to #301143 (closed)

Edited by Paul Slaughter

Merge request reports

Loading