Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

mejiaj
Copy link
Contributor

@mejiaj mejiaj commented May 30, 2023

Summary

Fixed an issue with inconsistent megamenu data being passed to navigation component. This was causing issues on compiling templates with npm run build:html and 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 megamenu boolean was sometimes passed as top-level setting and other times nested in nav object. This was displaying properly in StorybookJS, but broke on npm run build:html because storybook functionality is separate from twig compile for site.

Solution

The megamenu setting is now nested in nav object consistently. Any overrides to toggle will need to be done inside of nav object.

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

  1. Ensure there are no visual regressions in Headers
  2. Run npm run build:html and ensure the rendered markup is correct. For example, usa-header--extended-megamenu.html submenu's should have these classes usa-nav__submenu usa-megamenu.
  3. Ensure usa-logo ID has the correct prefix.
  4. Ensure link href's aren't empty.

The megamenu boolean is set inside of nav data object. This updates the stories and templates to keep it consistent.
@mejiaj mejiaj marked this pull request as ready for review May 31, 2023 13:21
@mejiaj mejiaj requested review from amyleadem and mahoneycm May 31, 2023 13:21
Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

Looking good!

  • Confirmed missing usa-megamenu class 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

Copy link
Contributor

@amyleadem amyleadem left a comment

Choose a reason for hiding this comment

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

  • Confirm that the usa-megamenu class appears in the HTML of both megamenu templates when running build:html
  • Confirm no visual regressions in headers in Storybook
  • Confirmed that megamenu is consistently included as a child of nav

@mejiaj mejiaj marked this pull request as draft June 5, 2023 16:55
@mejiaj
Copy link
Contributor Author

mejiaj commented Jun 5, 2023

Moving this to draft to look at additional improvements for:

  • Missing usa-logo ID - fixed in [cca6fba].
  • Missing href in primary nav links - fixed in [1aca030].

Issues affected all variants. Updated testing instructions.


Missing logo prefix

The logo prefix was being passed in Storybook, but not on compile.

Screenshot

image

Primary nav href

Setting a default value via twig filter.

Screenshot

image

@mejiaj mejiaj marked this pull request as ready for review June 5, 2023 17:14
@mejiaj mejiaj requested review from amyleadem and mahoneycm June 5, 2023 17:14
Copy link
Contributor

@mahoneycm mahoneycm left a comment

Choose a reason for hiding this comment

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

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-megamenu class present on submenu items
    • usa-logo ID matches what is in JSON data
    • Nav link href's are not empty

@amyleadem
Copy link
Contributor

@mejiaj @mahoneycm Opened #5319 to:

  1. Test removing the ids (and id_prefix header data items) from site title
  2. Fixed a connection for the site title data for header html

Let me know if you have any questions!

@thisisdano thisisdano merged commit b599fdd into develop Jun 6, 2023
@thisisdano thisisdano deleted the jm-extended-megamenu-bug-5305 branch June 6, 2023 22:42
@thisisdano thisisdano mentioned this pull request Jun 6, 2023
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.

USWDS - Bug: Extended header with megamenu missing class on build

4 participants