-
Notifications
You must be signed in to change notification settings - Fork 74
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
Mobile Native POC support work #5541
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
e3541d9
upgrade react & next
gilluminate ca2be22
mobile friendly cookie house
gilluminate cca94e2
add come convenient logging for GPP
gilluminate c126f4e
add fides_reject_all override option
gilluminate 05bd0a5
add fides_accept_all override option
gilluminate 860925f
add tests for accept and reject
gilluminate 4933ba5
rename and consolidate the option
gilluminate 18a0509
add new consent methods for known preference settings
gilluminate 2bdcf7f
rename option and methods as per group discussion
gilluminate b077d02
fix delete cookie script for Safari iOS browsers
gilluminate 463fed0
Update Overlay.tsx
gilluminate 705666c
update comment
gilluminate b7e3529
Merge branch 'main' into gill/HJ-259/poc-prep-work
gilluminate 60dee8c
Update CHANGELOG.md
gilluminate 8753dbf
reusable isConsentOverride util
gilluminate 3ac980d
Update NoticeOverlay.tsx
gilluminate File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
# Clients | ||
|
||
The clients directory houses all front-end packages and shared code amongst clients, and also includes e2e tests. | ||
|
||
See the [UI Contribution Guide](http://localhost:8000/fides/development/ui/overview/) for more information |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ import "../fides.css"; | |
import { FunctionComponent, h } from "preact"; | ||
import { useCallback, useEffect, useMemo, useState } from "preact/hooks"; | ||
|
||
import { isConsentOverride } from "../../lib/common-utils"; | ||
import { getConsentContext } from "../../lib/consent-context"; | ||
import { | ||
ConsentMechanism, | ||
|
@@ -229,6 +230,47 @@ const NoticeOverlay: FunctionComponent<OverlayProps> = ({ | |
], | ||
); | ||
|
||
const handleAcceptAll = useCallback( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. bumped these up to parent to take advantage of them at this level for the automated preference |
||
(wasAutomated?: boolean) => { | ||
handleUpdatePreferences( | ||
wasAutomated ? ConsentMethod.SCRIPT : ConsentMethod.ACCEPT, | ||
privacyNoticeItems.map((n) => n.notice.notice_key), | ||
); | ||
}, | ||
[handleUpdatePreferences, privacyNoticeItems], | ||
); | ||
|
||
const handleRejectAll = useCallback( | ||
(wasAutomated?: boolean) => { | ||
handleUpdatePreferences( | ||
wasAutomated ? ConsentMethod.SCRIPT : ConsentMethod.REJECT, | ||
privacyNoticeItems | ||
.filter( | ||
(n) => n.notice.consent_mechanism === ConsentMechanism.NOTICE_ONLY, | ||
) | ||
.map((n) => n.notice.notice_key), | ||
); | ||
}, | ||
[handleUpdatePreferences, privacyNoticeItems], | ||
); | ||
|
||
useEffect(() => { | ||
if (isConsentOverride(options) && experience.privacy_notices) { | ||
if (options.fidesConsentOverride === ConsentMethod.ACCEPT) { | ||
fidesDebugger( | ||
"Consent automatically accepted by fides_accept_all override!", | ||
); | ||
handleAcceptAll(true); | ||
} else if (options.fidesConsentOverride === ConsentMethod.REJECT) { | ||
fidesDebugger( | ||
"Consent automatically rejected by fides_reject_all override!", | ||
); | ||
handleRejectAll(true); | ||
} | ||
} | ||
// eslint-disable-next-line react-hooks/exhaustive-deps | ||
}, [experience.privacy_notices, options.fidesConsentOverride]); | ||
|
||
const dispatchOpenBannerEvent = useCallback(() => { | ||
dispatchFidesEvent("FidesUIShown", cookie, options.debug, { | ||
servingComponent: ServingComponent.BANNER, | ||
|
@@ -268,7 +310,6 @@ const NoticeOverlay: FunctionComponent<OverlayProps> = ({ | |
isEmbedded, | ||
isOpen, | ||
onClose, | ||
onSave, | ||
onManagePreferencesClick, | ||
}) => { | ||
const isAcknowledge = | ||
|
@@ -290,12 +331,20 @@ const NoticeOverlay: FunctionComponent<OverlayProps> = ({ | |
experience={experience} | ||
onManagePreferencesClick={onManagePreferencesClick} | ||
enabledKeys={draftEnabledNoticeKeys} | ||
onAcceptAll={() => { | ||
handleAcceptAll(); | ||
onClose(); | ||
}} | ||
onRejectAll={() => { | ||
handleRejectAll(); | ||
onClose(); | ||
}} | ||
onSave={( | ||
consentMethod: ConsentMethod, | ||
keys: Array<PrivacyNotice["notice_key"]>, | ||
) => { | ||
handleUpdatePreferences(consentMethod, keys); | ||
onSave(); | ||
onClose(); | ||
}} | ||
isAcknowledge={isAcknowledge} | ||
hideOptInOut={isAcknowledge} | ||
|
@@ -323,6 +372,14 @@ const NoticeOverlay: FunctionComponent<OverlayProps> = ({ | |
<NoticeConsentButtons | ||
experience={experience} | ||
enabledKeys={draftEnabledNoticeKeys} | ||
onAcceptAll={() => { | ||
handleAcceptAll(); | ||
onClose(); | ||
}} | ||
onRejectAll={() => { | ||
handleRejectAll(); | ||
onClose(); | ||
}} | ||
onSave={( | ||
consentMethod: ConsentMethod, | ||
keys: Array<PrivacyNotice["notice_key"]>, | ||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
onSave
was just superfluous and confusing so I removed it in favor ofonClose
everywhere.