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

Fix useNavigate() runtime issue, thereby re-enabling cookie banner and policies modelled popup #867

Merged
merged 25 commits into from
Nov 28, 2023

Conversation

anth-volk
Copy link
Collaborator

@anth-volk anth-volk commented Nov 23, 2023

This commit fixes an error with the deployment of useNavigate(), re-enabling all interstitials. It also adds the cookie consent component back into the app, alters some styling on the old component, and adds tests. Finally, it re-enables the PoliciesModelledPopup and adds a test for it, as well.

Note: This also disables a test that currently always fails, as part of issue #836, until further planning can make the test more robust to back-end variable changes.

Fixes #762, #775, #866, and #817. If you'd prefer these broken into multiple PRs, happy to do so; I've lumped them together because each depends upon the other in the following order: solve useNavigate() -> refactor buttons -> re-style cookie banner in accordance with refactored buttons -> solve #775 using refactored buttons

🤖[deprecated] Generated by Copilot at 9a5f053

Summary

🧪🎨🍪

This pull request refactors the navigation and button components, adds new components for cookie consent and arrow buttons, adds new test files for buttons and dialogs, and fixes a test and a console.log statement. The overall purpose is to improve the user interface, the code quality, and the test coverage of the app.

We're refactoring the buttons, we're changing the props and styles
We're testing the components, we're using the latest tools
We're navigating the pages, we're linking to the resources
We're coding with the fire, we're the masters of the Button!

Walkthrough

  • Add new dependencies for private class fields and custom jest matchers (link)
  • Refactor Button component to use HoverBox, accept different types, and simplify props and styles (link)
  • Create ArrowButton component for navigation with arrow icons and hover effects (link)
  • Create LinkButton component for linking to internal or external pages (link)
  • Rename NavigationButton component to SearchParamNavButton and use ArrowButton instead of ActionButton (link, link)
  • Replace NavigationButton with SearchParamNavButton and adjust props and styles in various components (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)
  • Create CookieConsent component for displaying cookie consent pop-up and setting consent cookie (link)
  • Use type prop instead of primary prop for Button component in CookieConsent component (link)
  • Add test files for Button, LinkButton, CookieConsent, and PoliciesModelledPopup components (link, link)
  • Disable and re-enable a test in HouseholdPage.test.js that needs improvement (link, link)
  • Remove unnecessary console.log statement from BaselineAndReformChartWithToggle function (link)
  • Add margin style to Button component in various components, as it was removed in the refactoring (link)

Copy link
Contributor

@nikhilwoodruff nikhilwoodruff left a comment

Choose a reason for hiding this comment

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

Amazing thanks!

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.

useNavigate() error when testing other changes
2 participants