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

Support the “minimal” TCF experience API and dynamically fetch “full” API response after banner is shown #5230

Merged
merged 24 commits into from
Aug 28, 2024

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Aug 23, 2024

Closes PROD-2608 and PROD-2611

Description Of Changes

  • fetch “minimal” TCF experience API in privacy center when bundling FidesJS
  • modify TCF banner to render only using the minimal API response fields
  • remove display of “stacks” entirely, and render purposes & special features from the minimal API
  • New method for stubbing TCF in Cypress tests to mimic the "minimal" behavior.

Steps to Confirm

  • Full regression test on FidesJS is recommended.
  • Initial TCF banner UI should match new designs
    • Note: banner no longer has accordions for the right column list and the heading is entirely different
  • Otherwise, no real change to functionality other than the speed in which the banner appears. Modal should look/behave the same. Non-TCF banner should look/behave the same.
  • Be sure to check TCF banner UI in both desktop and mobile views.

Pre-Merge Checklist

  • All CI Pipelines Succeeded
  • Issue Requirements are Met
  • Relevant Follow-Up Issues Created
  • Update CHANGELOG.md

Copy link

vercel bot commented Aug 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Aug 28, 2024 5:20pm

@gilluminate gilluminate changed the title Prod 2608 fides js support the minimal Support the “minimal” TCF experience API and dynamically fetch “full” API response after banner is shown Aug 23, 2024
@gilluminate gilluminate force-pushed the PROD-2608-fides-js-support-the-minimal branch from 57ddce1 to a51633d Compare August 23, 2024 22:25
Copy link

cypress bot commented Aug 23, 2024

fides    Run #9716

Run Properties:  status check passed Passed #9716  •  git commit ffb8d1d00a ℹ️: Merge 4cb5277ef6358adc95c5811a5a7119fcaa7e237f into edb36c77d0585185863d565ec7f6...
Project fides
Branch Review refs/pull/5230/merge
Run status status check passed Passed #9716
Run duration 00m 38s
Commit git commit ffb8d1d00a ℹ️: Merge 4cb5277ef6358adc95c5811a5a7119fcaa7e237f into edb36c77d0585185863d565ec7f6...
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

@gilluminate gilluminate force-pushed the PROD-2608-fides-js-support-the-minimal branch 2 times, most recently from 3e6ed7b to c6087d5 Compare August 23, 2024 23:05
@gilluminate gilluminate force-pushed the PROD-2608-fides-js-support-the-minimal branch from c6087d5 to d68376a Compare August 24, 2024 02:34
Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

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

Nice work so far @gilluminate - I've added some suggestions / questions but mostly looking for a test that checks:

  • banner renders minimal response fields initially
  • follow-up API call is made after banner renders for full experience
  • banner updates to render full experience response

In addition, I'd like clarification around whether or not this is scoped to just TCF. It seems to me that this minimal API call is made across the board, not just for TCF experiences, right?

clients/fides-js/src/services/api.ts Show resolved Hide resolved
// the user's preferred language, otherwise use the "accept-language" header
// provided by the browser. If all else fails, use the default.
const fidesLocale =
(req.query.fides_locale as string) || req.cookies?.fides_locale;
Copy link
Contributor

Choose a reason for hiding this comment

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

do we set fides_locale anywhere across our ecosystem? Who uses this that we know of?

Copy link
Contributor Author

@gilluminate gilluminate Aug 27, 2024

Choose a reason for hiding this comment

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

I believe MV is using it on a few of their sites that are language specific. Is there a specific concern you are considering here?

Copy link
Contributor

Choose a reason for hiding this comment

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

nope, just curious about the wider implications across the ecosystem ✔️

clients/privacy-center/pages/api/fides-js.ts Outdated Show resolved Hide resolved
const fidesLocale =
(req.query.fides_locale as string) || req.cookies?.fides_locale;
const userLanguageString =
fidesLocale || req.headers["accept-language"] || DEFAULT_LOCALE;
Copy link
Contributor

Choose a reason for hiding this comment

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

what is the default locale set to?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

default is "en"

@@ -1118,8 +1100,6 @@ button.fides-banner-button.fides-menu-item:not([aria-pressed="true"]):hover {
}

div#fides-banner-inner-container {
display: flex;
flex-direction: column;
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why these CSS changes were needed or generally what these changes do?

We're also making some CSS changes here that we need to eval to see if there are any conflicts- clients/fides-js-extensions/nytimes/src/ext.css

Copy link
Contributor Author

Choose a reason for hiding this comment

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

all CSS changes are being made as part of this layout update ticket https://ethyca.atlassian.net/browse/PROD-2611 which is pretty heavily tied to the other TCF updates so I'm including them in this PR. All of these affect TCF only, and they affect the banner only. No style updates for modal at all and no updates for non-TCF banner.

Comment on lines +46 to +49
{!onVendorPageClick && !!vendorCount && (
<span className="fides-vendor-count">{vendorCount}</span>
)}
{onVendorPageClick && vendorCount && (
{onVendorPageClick && !!vendorCount && (
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this change ensures that 0 vendors causes this not to render

@@ -1118,8 +1100,6 @@ button.fides-banner-button.fides-menu-item:not([aria-pressed="true"]):hover {
}

div#fides-banner-inner-container {
display: flex;
flex-direction: column;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

all CSS changes are being made as part of this layout update ticket https://ethyca.atlassian.net/browse/PROD-2611 which is pretty heavily tied to the other TCF updates so I'm including them in this PR. All of these affect TCF only, and they affect the banner only. No style updates for modal at all and no updates for non-TCF banner.

// the user's preferred language, otherwise use the "accept-language" header
// provided by the browser. If all else fails, use the default.
const fidesLocale =
(req.query.fides_locale as string) || req.cookies?.fides_locale;
Copy link
Contributor Author

@gilluminate gilluminate Aug 27, 2024

Choose a reason for hiding this comment

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

I believe MV is using it on a few of their sites that are language specific. Is there a specific concern you are considering here?

const fidesLocale =
(req.query.fides_locale as string) || req.cookies?.fides_locale;
const userLanguageString =
fidesLocale || req.headers["accept-language"] || DEFAULT_LOCALE;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

default is "en"

@gilluminate
Copy link
Contributor Author

gilluminate commented Aug 27, 2024

In addition, I'd like clarification around whether or not this is scoped to just TCF. It seems to me that this minimal API call is made across the board, not just for TCF experiences, right?

@eastandwestwind Since we don't know what the experience will be when the initial call is made, so we do supply the minimal request to the api endpoint with the understanding that if TCF is being returned, we want the minimal version. It will be ignored otherwise. I'll add this as a comment in the code.

@gilluminate gilluminate force-pushed the PROD-2608-fides-js-support-the-minimal branch 5 times, most recently from 0ed7a4d to cb7903e Compare August 28, 2024 01:37
Copy link
Contributor

@eastandwestwind eastandwestwind left a comment

Choose a reason for hiding this comment

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

Awesome work on the tests! Just want to add a Changelog, and we're good to go here!

if (props.overrideExperience) {
experience = props.overrideExperience(experience);
if (props?.options?.tcfEnabled) {
stubTCFExperience({
Copy link
Contributor

Choose a reason for hiding this comment

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

nice work adding this stub to replicate minimal experience!

@gilluminate gilluminate force-pushed the PROD-2608-fides-js-support-the-minimal branch from a04be3e to 4cb5277 Compare August 28, 2024 17:20
@gilluminate gilluminate merged commit 4a2dc3a into main Aug 28, 2024
13 checks passed
@gilluminate gilluminate deleted the PROD-2608-fides-js-support-the-minimal branch August 28, 2024 17:44
Copy link

cypress bot commented Aug 28, 2024

fides    Run #9719

Run Properties:  status check passed Passed #9719  •  git commit 4a2dc3a958: Support the “minimal” TCF experience API and dynamically fetch “full” API respon...
Project fides
Branch Review main
Run status status check passed Passed #9719
Run duration 00m 38s
Commit git commit 4a2dc3a958: Support the “minimal” TCF experience API and dynamically fetch “full” API respon...
Committer Jason Gill
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 4
⚠️ You've recorded test results over your free plan limit.
Upgrade your plan to view test results.
View all changes introduced in this branch ↗︎

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