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

Usagov 1997 mobile menu block #2039

Merged
merged 3 commits into from
Oct 29, 2024
Merged

Usagov 1997 mobile menu block #2039

merged 3 commits into from
Oct 29, 2024

Conversation

omerida
Copy link
Contributor

@omerida omerida commented Oct 25, 2024

Jira Task

https://cm-jira.usa.gov/browse/USAGOV-1997

Description

Moves mobile menu generation to the usagov_menus module and adds the URL as a cache context for each block.
Fixes a race condition bug where the mobile menu on sidebar pages could be exported incomplete by tome.

Type of Changes

  • New Feature
  • Bugfix
  • Frontend (Twig, Sass, JS)
    • Add screenshot showing what it should look like
  • Drupal Config (requires "drush cim")
  • New Modules (requires rebuild)
  • Documentation
  • Infrastructure
    • CMS
    • WAF
    • WWW
    • Egress
    • Tools
    • Cron
  • Other

Testing Instructions

Change Requirements

  • Requires New Documentation (Link: {})
  • Requires New Config
  • Requires New Content

Validation Steps

  • Make two exports for comparison
    • make a tome export of local using the dev branch, rename html/ to html-dev/ Also in the usagov_ssh_postprocessing module, renamed save the published pages CSV for the dev run to compare in the next step.
    • switch to this branch, make a tome export, rename to html-dev
  • Compare HTML(html-tidy config attached)
    • use html-tidy + find command to "normalize" the HTML output in each directory. Use the option to remove indentation. In each HTML folder run a command like:
      find . -name '*.html' -type f -print -exec tidy -config ../tidy-config.txt --warn-proprietary-attributes false -mq '{}' \;
    • use diff + grep to compare the contents of both directories to confirm the HTML is same between branches. Something like this where diff ignores the cache busting query string drupls adds to CSS and JS files will give you a file to review in a text editor..:
      diff -brwd --strip-trailing-cr --exclude=_data -I " rel=\"stylesheet\">" -I "<script src=" -I js-view-dom-id -I mobilemenublock --exclude=themes html-dev/ html/ > html.diff
    • The diff file above should not have any lines starting with angle brackets. If you're dev export didn't have the correct agency mobile menu on some pages, you should see the correct one in this branch's export.
  • Compare number of redirects in each export directory to confirm its the same. Use this command inside each directory:
    grep -r 'http-equiv=\"refresh\"' . | wc -l

Security Review

  • Adds/updates software (including a library or Drupal module)
  • Communication with external service
  • Changes permissions or workflow
  • Requires SSPP updates

Reviewer Reminders

  • Reviewed code changes
  • Reviewed functionality
  • Security review complete or not required

Post PR Approval Instructions

Follow these steps as soon as you merge the new changes.

  1. Go to the USAGov Circle CI project.
  2. Find the commit of this pull request.
  3. Build and deploy the changes.
  4. Update the Jira ticket by changing the ticket status to Review in Test and add a comment. State whether the change is already visible on cms-dev.usa.gov and beta-dev.usa.gov, or if the deployment is still in process.

…agov_menus module.

Fixes a race condition bug where the mobile menu on sidebar pages could be exported incomplete by tome.
@cwacht cwacht self-requested a review October 25, 2024 20:07
Copy link
Contributor

@cwacht cwacht left a comment

Choose a reason for hiding this comment

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

Everything looks good here.

The only oddity I found when testing was that the /where-report-scams mobile nav does not indicate the correct current page, but that is also occurring on prod so it is not caused by this change. The scams wizards are using a different template for the mobile nav, which I would love to incorporate into a unified & simplified template in the future, but that would call for a new ticket.

For this PR, I approve.

@cwacht cwacht merged commit fe95375 into dev Oct 29, 2024
5 of 6 checks passed
@cwacht cwacht deleted the USAGOV-1997-mobile-menu-block branch October 29, 2024 18:51
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.

2 participants