Repository navigation
USWDS - Header: Consistent nav data is passed in Header - #5311
Merged
Merged
Conversation
The megamenu boolean is set inside of nav data object. This updates the stories and templates to keep it consistent.
mejiaj
marked this pull request as ready for review
May 31, 2023 13:21
mahoneycm
approved these changes
May 31, 2023
mahoneycm
left a comment
Contributor
There was a problem hiding this comment.
Looking good!
- Confirmed missing
usa-megamenuclass on component markup - Confirmed no visual regression on fix
- Confirmed class present after
npm run build:html - Installed branch on site and confirmed code markup updated correctly
amyleadem
approved these changes
May 31, 2023
amyleadem
left a comment
Contributor
There was a problem hiding this comment.
- Confirm that the
usa-megamenuclass appears in the HTML of both megamenu templates when runningbuild:html - Confirm no visual regressions in headers in Storybook
- Confirmed that
megamenuis consistently included as a child ofnav
23 of 24 tasks
mejiaj
marked this pull request as draft
June 5, 2023 16:55
Contributor
Author
|
Issues affected all variants. Updated testing instructions. Missing logo prefixThe logo prefix was being passed in Storybook, but not on compile. Primary nav hrefSetting a default value via twig filter. |
mejiaj
marked this pull request as ready for review
June 5, 2023 17:14
mahoneycm
reviewed
Jun 6, 2023
mahoneycm
left a comment
Contributor
There was a problem hiding this comment.
Leaving my notes here to keep track of them.
We briefly discussed removing the usa-logo ID because it seemed to be unnecessary. If we keep it, we should discuss changing the prefix to basic- (what it is currently on site) or keeping the updated ID's for each variant from this PR.
- Confirmed no visual regression across variants
- Confirmed markup is correct
-
usa-megamenuclass present on submenu items - usa-logo ID matches what is in JSON data
- Nav link
href's are not empty
-
Contributor
|
@mejiaj @mahoneycm Opened #5319 to:
Let me know if you have any questions! |
thisisdano
approved these changes
Jun 6, 2023
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Summary
Fixed an issue with inconsistent megamenu data being passed to navigation component. This was causing issues on compiling templates with
npm run build:htmland the markup in Site's code examples.Breaking change
This is not a breaking change.
Related issue
Closes #5305.
Related pull requests
Changelog entry PR - uswds/uswds-site#2111.
Preview link
Preview link:
Problem statement
The
megamenuboolean was sometimes passed as top-level setting and other times nested innavobject. This was displaying properly in StorybookJS, but broke onnpm run build:htmlbecause storybook functionality is separate from twig compile for site.Solution
The
megamenusetting is now nested innavobject consistently. Any overrides to toggle will need to be done inside ofnavobject.Major changes
Megamenu is no longer a top-level setting for header (this can be changed, but most templates already had nested setting).
Testing and review
npm run build:htmland ensure the rendered markup is correct. For example,usa-header--extended-megamenu.htmlsubmenu's should have these classesusa-nav__submenu usa-megamenu.href's aren't empty.