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

Add ability to select different locations in the "Cookie House" sample app #3362

Merged
merged 20 commits into from
May 24, 2023

Conversation

NevilleS
Copy link
Contributor

@NevilleS NevilleS commented May 24, 2023

Closes #3277

Code Changes

  • Add a docker-compose.yml and update npm run dev script to spin up a development database
  • Add react-select dependency for a nice select component
  • Add a GeoocationSelect component to the footer which can select between a list of locations
  • Link the GeoLocationSelect to a ?geolocation= URL query param (for power users to set that themselves!)
  • Append the ?geolocation= query param to the fides.js?geolocation= script tag, to force prefetching the geolocation
  • Tweak the home page and footer styles to be delightful ✨
  • Update Privacy Center's location "prefetch" logic to set the geolocation option to match latest fides.js updates

Steps to Confirm

  • Use `nox -s "fides_env(test)" and open the Cookie House sample app at http://localhost:3000
  • In the Javascript console, check window.Fides.geolocation defaults to undefined
  • Select a geolocation from the footer (e.g. "California") and check that the page reloads and window.Fides.geolocation is set to the geolocation data (e.g. US-CA)

image
image
image

Pre-Merge Checklist

Description Of Changes

This adds the ability to "force" a location to the Cookie House sample app, which'll be a killer feature for testing & demoing all our geolocation-specific consent tooling.

@cypress
Copy link

cypress bot commented May 24, 2023

Passing run #2153 ↗︎

0 4 0 0 Flakiness 0
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.

Details:

Merge ddff3a3 into 1014fb4...
Project: fides Commit: 41ef300e2d ℹ️
Status: Passed Duration: 01:01 💡
Started: May 24, 2023 3:35 PM Ended: May 24, 2023 3:36 PM

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@NevilleS
Copy link
Contributor Author

I've got some Cypress tests to update! 😄

But otherwise I think this is looking good.

@NevilleS
Copy link
Contributor Author

OK, updated those tests to make everything line up with @eastandwestwind's updates to the fides.js options. The main difference there was I was assuming the option would be location when it ended up being geolocation - I like the latter, it's very clear. So I just bit the bullet and updated all the related code/tests/comments/docs to say "geolocation" too.

Copy link
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

looks great!

@NevilleS NevilleS merged commit 700d44d into main May 24, 2023
@NevilleS NevilleS deleted the ns-sample-app-location-select-3277 branch May 24, 2023 16:01
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.

Add ability to select different locations in the "Cookie House" sample app
2 participants