-
Notifications
You must be signed in to change notification settings - Fork 5
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
1171 cookie consent clean up #1199
Conversation
✅ Deploy Preview for veda-ui ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I noticed an issue when navigating between routes: the cookie consent temporarily disappears and then again reappears. Is this related to the relocation of the cookie functionality? The issue persists when reloading the page as well (without any interaction with the cookie banner). I've recorded a video with the behavior below: Screen.Recording.2024-10-24.at.13.50.32.mov |
app/scripts/components/common/cookie-consent/cookieConsent.spec.js
Outdated
Show resolved
Hide resolved
👋 Apologies for the review being late. I am somehow having trouble running this branch locally. I doubt that it is something this pr iontroduced since our dev environment has been unstable time to time. But in case, can you confirm me that you have no problem running this branch on local ? |
Hey @hanbyul-here no problem, odd I was able to run it previously but now the system is getting hung up on the bundling step locally. Actually rebasing seemed to have corrected the issue. |
554e330
to
85742bc
Compare
@snmln I did rebase main, but I still have a problem running a local instance. trying to figure out what is going on now. - When I comment out CookieContent related logic, I can run it - something is getting infinitely re-rendered. |
This pr fixes infinite rerendering issue (it was from the parsing error of cookie value - so I added a unit test to make sure this works. - I used the solution from this post, feel free to edit if you see any improvement https://stackoverflow.com/questions/5142337/read-a-javascript-cookie-by-name) - also feel free to edit the test, I mainly put it for my dev purpose. I removed currenwindowurl logic, replaced it with pathname passed from the layout root. I started making this change and then realized that this is not the cause of infinite rendering problem, but I think it is probably safer to depend on the pathname change than location.href since href can include so many things like query parameters?
First of all, I apologize that I could not make this suggestion as a part of review. It is still challenging for me to make a suggestion without actually touching the code. This PR handles several things. The first to fix is cookieconsent form gradually disappears on the first page load. The second is not depending on session storage - mainly because I feel like it was diverging the logic flow - but if I am missing anything, please feel free to close this. The third is moving out the utility function outside of the component, so it doesn't have to be declared as a dependency of useEffect hook.
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.
🙇 thanks for working on it!
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.
Re-tested the cookie consent across routes and page reloads: it renders as expected.
## 🎉 Features * Card image/description independent of hero image/description by @dzole0311 in #1244 ## 🚀 Improvements * Cookie consent code cleanup by @snmln in #1199 , and @hanbyul-here in #1240 , and @hanbyul-here in #1241 * Add ADR about design system change by @j08lue in #890 * Update condition to run playwright tests on release branches by @dzole0311 in #1228 * Update STYLE_GUIDE.md by @AliceR in #1227 * Fix lint configuration by @AliceR in #1219 * Add tests for the AOI feature specification by @AliceR in #1216 * Set data catalog filters to be closed by default by @vgeorge in #1243 * Update tsconfig and make nav interfaces exposable for consumption by @sandrahoang686 in #1223 ## 🐛 Fixes * Hotfix to hide the external link badge from cards by @dzole0311 in #1231 ## New Contributors * @vgeorge made their first contribution in #1243 **Full Changelog**: v5.9.0...v5.10.0
Related Ticket: #1171
Description of Changes
layoutRoot
tocookieConsentForm
session item
to track when a session has begun for each individual user and only run validation and retrieval functionality on session start and when a response has not been recorded.Notes & Questions About Changes
Validation / Testing
Clear out all cookies in your local machine to do so: open
dev tools
-> navigate toapplication tab
-> navigate tocookies
in the left panel -> right clickclear