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

Consent use dropdown #4251

Merged
merged 12 commits into from
Oct 12, 2023
Merged

Consent use dropdown #4251

merged 12 commits into from
Oct 12, 2023

Conversation

jpople
Copy link
Contributor

@jpople jpople commented Oct 10, 2023

Closes #4055 and #4119

Description Of Changes

Changes "configure consent" view to use a two-part select input for the new consent uses, and filters the view to only show information in the the view relevant to the consent uses.

Screenshot 2023-10-10 at 5 01 15 PM Screenshot 2023-10-10 at 5 01 23 PM Screenshot 2023-10-10 at 5 01 43 PM

Code Changes

  • Changes MinimalPrivacyDeclaration type to have a new consent_use field which holds the higher-level consent use
  • Changes to submission code to generate multiple data uses when "Marketing" is selected, as per the mapping table here
  • Add filters in various places to "Configure consent" page, so it doesn't care about data uses that don't have one of the four consent uses as their top level

Steps to Confirm

  • Go to "configure consent" view
  • Add a vendor
  • Add cookies manually or with the dictionary
  • Edit an existing vendor

Pre-Merge Checklist

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

@cypress
Copy link

cypress bot commented Oct 10, 2023

Passing run #4578 ↗︎

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 108c820 into 37346ea...
Project: fides Commit: 43dfeb7706 ℹ️
Status: Passed Duration: 00:53 💡
Started: Oct 11, 2023 9:26 PM Ended: Oct 11, 2023 9:27 PM

Review all test suite changes for PR #4251 ↗︎

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.

nice job @jpople !! I found one maybe bug (or maybe it already existed?) but it looks good overall!

clients/admin-ui/src/features/common/table/cells.tsx Outdated Show resolved Hide resolved
const DictionaryValidationSchema = Yup.object().shape(
{
// to allow creation/editing of non-dictionary systems even with
// dictionary enabled, only require one of either vendor_id or name
Copy link
Contributor

Choose a reason for hiding this comment

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

hmm I think this change makes it so when you:

  1. have the dictionary
  2. enter a new name for a vendor (one not in the dictionary)
  3. the sparkle icon is enabled, when it shouldn't be.

I'm not sure if this line is exactly the culprit, but I remember something sneaky going on between vendor_id and name

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Gotcha-- I think that's actually by caused by line ~220 in this file, which disabling if the vendor_id was specifically null, so entering anything else meant it was still enabled. I've changed it to check whether the vendor_id is one of the options or not.

privacy_declarations: passedInSystem.privacy_declarations.map(
(dec) => ({
privacy_declarations: passedInSystem.privacy_declarations
.filter((dec) =>
Copy link
Contributor

Choose a reason for hiding this comment

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

just so I understand, this is so that we only ever save data uses which are subsets of the 4 consent use options?

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 makes it so that non-consent-use data uses aren't shown on the form and so they can't be created or edited from this view. If there are some on the vendor (say, if I went in some other time and added one from the data map) they'll still save in the background, that's handled by lines 154-164.

...dec,
name: dec.name ?? "",
cookies: dec.cookies ?? [],
cookieNames: dec.cookies ? dec.cookies.map((c) => c.name) : [],
})
),
consent_use: dec.data_use.split(".")[0],
Copy link
Contributor

Choose a reason for hiding this comment

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

what happens if this is a data use that isn't one of the 4?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Those should all be handled by the filter just above this.

@jpople jpople changed the title 4055 consent use dropdown Consent use dropdown Oct 11, 2023
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.

💥

@jpople jpople merged commit 44100e2 into main Oct 12, 2023
11 checks passed
@jpople jpople deleted the 4055-consent-use-dropdown branch October 12, 2023 14:50
jpople added a commit that referenced this pull request Oct 12, 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.

Build new data use dropdown component
2 participants