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

@W-16797872 Add Domain attribute to dw_dnt cookie #2020

Open
wants to merge 8 commits into
base: dnt-feature-branch
Choose a base branch
from

Conversation

jeremy-jung1
Copy link
Collaborator

@jeremy-jung1 jeremy-jung1 commented Sep 20, 2024

Description

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Documentation update
  • Breaking change (could cause existing functionality to not work as expected)
  • Other changes (non-breaking changes that does not fit any of the above)

Breaking changes include:

  • Removing a public function or component or prop
  • Adding a required argument to a function
  • Changing the data type of a function parameter or return value
  • Adding a new peer dependency to package.json

Changes

  • (change1)

How to Test-Drive This PR

The usage of the hook in the UI after this change, to enable subdomain in PWA kit for the DNT cookie is:

// use-dnt-notification.js
const [hostname, setHostname] = useState(undefined)
const {dntStatus, updateDNT} = useDNT(hostname)

useEffect( () => {
        if (window.location.hostname) {
            setHostname(window.location.hostname)
        }
}, [])

const onCloseNotification = () => {
        updateDNT(null, hostname)
        onClose()
}
const onClickAccept = () => {
        updateDNT(true, hostname)
        onClose()
}
const onClickDeny = () => {
        updateDNT(false, hostname)
        onClose()
}

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

@jeremy-jung1 jeremy-jung1 requested a review from a team as a code owner September 20, 2024 21:24
@vcua-mobify
Copy link
Contributor

We might want to test this change on a hybrid environment and ensure that the dw_dnt cookies created in PWA work in SFRA with the domain (they probably do, but it might be good to just make sure). Also do we want to check for the case where the dw_dnt cookie is created in SFRA?

@jeremy-jung1
Copy link
Collaborator Author

jeremy-jung1 commented Oct 7, 2024

This feature is a nice-to-have and won't be released before the holidays, and taking into Hybrid support will need some more discussion, as in SFRA the domain is hardcoded in ECOM. This means that if PWA kit is using a subdomain and SFRA isn't, then the cookie coming from SFRA into PWA kit will not be read by PWA kit, resulting in a total of two cookies in the browser.

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.

3 participants