Add support for consent mechanism string values and non-applicable notices in FidesJS#6115
Merged
gilluminate merged 17 commits intomainfrom May 7, 2025
Merged
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
|
a3861e4 to
6f663b9
Compare
6f663b9 to
efe6c95
Compare
gilluminate
commented
May 6, 2025
Contributor
Author
There was a problem hiding this comment.
This has been causing problems for a while. Might push this further later.
Comment on lines
+191
to
+195
| if (IS_DEV) { | ||
| rollupOptions.push(...[js, declaration]); | ||
| } else { | ||
| rollupOptions.push(...[js, mjs, declaration]); | ||
| } |
Contributor
Author
There was a problem hiding this comment.
we almost never use mjs during development, so this just speeds things up a bit
Comment on lines
+45
to
+52
| const flagType = | ||
| options?.flag_type ?? | ||
| window.Fides?.options?.fidesConsentFlagType ?? | ||
| ConsentFlagType.BOOLEAN; | ||
| const nonApplicableFlagMode = | ||
| options?.non_applicable_flag_mode ?? | ||
| window.Fides?.options?.fidesConsentNonApplicableFlagMode ?? | ||
| ConsentNonApplicableFlagMode.OMIT; |
Contributor
Author
There was a problem hiding this comment.
Maintains support for legacy GTM flags
Comment on lines
+51
to
+88
|
|
||
| /** | ||
| * Parses a comma-separated string of notice keys into an array of strings. | ||
| * Handles undefined input, trims whitespace, and filters out empty strings. | ||
| */ | ||
| export const parseFidesDisabledNotices = ( | ||
| value: string | undefined, | ||
| ): string[] => { | ||
| if (!value) { | ||
| return []; | ||
| } | ||
|
|
||
| return value | ||
| .split(",") | ||
| .map((key) => key.trim()) | ||
| .filter(Boolean); | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
I moved this here from consent-utils.ts to resolve a circular dependency warning in Rollup.
eastandwestwind
requested changes
May 6, 2025
Contributor
eastandwestwind
left a comment
There was a problem hiding this comment.
I haven't yet tested locally, but code is mostly looking good! Just a couple requests
21b1f9d to
dcdf1d7
Compare
Update .eslintrc.cjs
Update shared-consent-utils.ts
Update events.ts
dcdf1d7 to
28d3187
Compare
eastandwestwind
approved these changes
May 7, 2025
fides
|
||||||||||||||||||||||||||||
| Project |
fides
|
| Branch Review |
main
|
| Run status |
|
| Run duration | 00m 54s |
| Commit |
|
| Committer | Jason Gill |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
5
|
| View all changes introduced in this branch ↗︎ | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes LJ-628
Description Of Changes
Added support for configurable consent flag types and non-applicable notice handling. This introduces two new configuration options:
fidesConsentFlagType(for choosing between boolean or consent mechanism string formats) andfidesConsentNonApplicableFlagMode(for controlling whether non-applicable notices are included or omitted). These changes take what was originally applied only to GTM, and made it available to all externally facing consent objects (Fides.consent, events, browser cookie).Code Changes
NoticeOverlaycomponent to handle string consent valuesSteps to Confirm
fidesConsentFlagType: "consent_mechanism"option and verify values use string format (/fides-js-demo.html?geolocation=us-ca&fides_consent_flag_type=consent_mechanism)fidesConsentNonApplicableFlagMode: "include"and confirm non-applicable notices are included (/fides-js-demo.html?geolocation=us-ut&fides_consent_non_applicable_flag_mode=include)/fides-js-demo.html?geolocation=us-ut&fides_consent_non_applicable_flag_mode=include&fides_consent_flag_type=consent_mechanism)Pre-Merge Checklist
CHANGELOG.mdupdatedmaindowngrade()migration is correct and works