Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent duplicate highlights in mega menu #6016

Merged
merged 2 commits into from
Sep 21, 2020
Merged

Conversation

chosak
Copy link
Member

@chosak chosak commented Sep 18, 2020

This change modifies the existing mega menu logic to prevent duplicate highlights in the mega menu, for cases where a menu link is duplicated between submenus.

The code now ensures that only at most one submenu and at most one link gets highlighted.

How to test this PR

Edit the mega menu to duplicate a link between two submenus. Internally, see UCP PR deployment for this running live with an example.

Checklist

  • PR has an informative and human-readable title
  • Changes are limited to a single goal (no scope creep)
  • Code follows the standards laid out in the CFPB development guidelines

@chosak chosak marked this pull request as ready for review September 18, 2020 18:20
@chosak chosak force-pushed the fix/mega-menu-single-highlight branch from 8039b25 to 42cdc26 Compare September 18, 2020 18:26
Copy link
Contributor

@schbetsy schbetsy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works for me 👍 . Had a question about the test.

},
])

def test_conversion_output_selection_ignores_query_string(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What are your thoughts about adding a test for the specific behavior that's added in this PR? I might be wrong, but this test seems more like #6012

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, you're totally right. I'll add one.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schbetsy I've added a test for this behavior; would you mind re-reviewing when you get a chance?

This change modifies the existing mega menu logic to prevent duplicate
highlights in the mega menu, for cases where a menu link is duplicated
between submenus.

The code now ensures that only at most one submenu and at most one link
gets highlighted.
@CFPBot CFPBot merged commit 7371988 into main Sep 21, 2020
@CFPBot CFPBot deleted the fix/mega-menu-single-highlight branch September 21, 2020 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants