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 disabling Notice Toggles with override option #5872

Merged
merged 10 commits into from
Mar 20, 2025

Conversation

gilluminate
Copy link
Contributor

@gilluminate gilluminate commented Mar 12, 2025

Closes LJ-487

Description Of Changes

Adds support for disabling specific notice toggles in the CMP overlay via a new fides_disabled_notices configuration option. This allows clients to prevent users from toggling certain privacy notices while preserving their current consent state.

Code Changes

  • Added new fides_disabled_notices option to FidesOptions interface that accepts a comma-separated string of notice keys
  • Implemented parseFidesDisabledNotices utility to parse the disabled notices string into an array
  • Modified NoticeOverlay and TcfOverlay components to respect disabled notices:
    • Preserves consent state for disabled notices during accept/reject all actions
    • Disables toggle UI elements for specified notices
    • Updates consent handling logic to maintain disabled notice states
    • preserves existing disabling of Notice Only notices
  • Updated type definitions to support new option and validator maps
  • Added comprehensive tests for parseFidesDisabledNotices utility

Steps to Confirm

  1. Initialize an experience with notices in Admin UI
  2. Visit demo page with appropriate geolocation and the override as a query param (eg. /fides-js-demo.html?geolocation=us-ut&fides_disabled_notices=analytics,marketing)
  3. Verify disabled notices cannot be toggled in the CMP overlay
  4. Confirm "Accept All" and "Reject All" preserve the state of disabled notices
  5. Test with various combinations of disabled notices and consent mechanisms
  6. Test with both TCF and non-TCF experiences that have custom notices applied.

Pre-Merge Checklist

  • Issue requirements met
  • All CI pipelines succeeded
  • CHANGELOG.md updated
    • Add a db-migration This indicates that a change includes a database migration label to the entry if your change includes a DB migration
    • Add a high-risk This issue suggests changes that have a high-probability of breaking existing code label to the entry if your change includes a high-risk change (i.e. potential for performance impact or unexpected regression) that should be flagged
  • Followup issues:
    • Followup issues created (include link)
    • No followup issues
  • Database migrations:
    • Ensure that your downrev is up to date with the latest revision on main
    • Ensure that your downgrade() migration is correct and works
      • If a downgrade migration is not possible for this change, please call this out in the PR description!
    • No migrations
  • Documentation:
    • Documentation complete, PR opened in fidesdocs
    • Documentation issue created in fidesdocs
    • If there are any new client scopes created as part of the pull request, remember to update public-facing documentation that references our scope registry
    • No documentation updates required

Copy link

vercel bot commented Mar 12, 2025

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

Name Status Preview Comments Updated (UTC)
fides-privacy-center ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 20, 2025 4:20pm
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
fides-plus-nightly ⬜️ Ignored (Inspect) Visit Preview Mar 20, 2025 4:20pm

Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Great work here! I've tested this and it's working great, except for one issue I found in TCF where for a custom notice it looks like the Save All buttons are being applied to the disable toggle as well. When testing non-tcf I see that even if I click the save all buttons the original disabled toggle value is preserved. Loom: https://www.loom.com/share/a09de36f60cb4b0f895093bb2a7ca2e1

@gilluminate
Copy link
Contributor Author

@lucanovera I've done quite a bit of refactor on this now and feel much more confident about the solution. Would you mind reviewing again now?

Copy link
Contributor

@lucanovera lucanovera left a comment

Choose a reason for hiding this comment

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

Great work! I just re-tested all the use cases and didn't found any issues. The code changes looked good. Just left you a comment about a eslint disable that I think you can remove. Approved!

@gilluminate gilluminate merged commit 8f999bf into main Mar 20, 2025
17 checks passed
@gilluminate gilluminate deleted the gill/LJ-487/haven-support-disabling-notices branch March 20, 2025 16:24
Copy link

cypress bot commented Mar 20, 2025

fides    Run #12696

Run Properties:  status check passed Passed #12696  •  git commit 8f999bf87a: Support disabling Notice Toggles with override option (#5872)
Project fides
Branch Review main
Run status status check passed Passed #12696
Run duration 00m 49s
Commit git commit 8f999bf87a: Support disabling Notice Toggles with override option (#5872)
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 5
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