-
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
CORE-671 CookieYes #2703
base: main
Are you sure you want to change the base?
CORE-671 CookieYes #2703
Conversation
Tested on dev.openstax.org and it seems to work just fine. |
src/index.html
Outdated
} else { | ||
Sentry.captureMessage(`Failed to save cookie consent (HTTP status code: ${response.status})`); | ||
} | ||
}, (error) => Sentry.captureException(error) |
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.
i'm pretty sure these sentry calls are the ones triggering the "undefined variable sentry" errors
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.
Good point, I guess I should add a guard and ignore the errors otherwise? I think Sentry is not guaranteed to be accessible when GTM scripts run either.
src/index.html
Outdated
<link rel="stylesheet" href="https://ram.openstax.org/osano/osano.css"> | ||
<script src="https://cmp.osano.com/AzZqbXTbzhHsU3cv1/68d8e8ae-4024-4489-a000-72766ad284a6/osano.js"></script> | ||
<script> | ||
fetch('/accounts/api/user', { credentials: 'include' }).then((userResponse) => { |
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.
osweb also fetches the user, is this gonna make it fetch the user twice on every page load?
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.
Yes... I can have both this and the app code write the user to the window (only if not already present), I suppose
…able to prevent multiple loads
…the cached load function
} | ||
|
||
document.body.classList.add('hide-osano'); | ||
function CookieYesToggle() { |
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.
I should move this to ui-components and use it in Rex
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.
It wasn't done in a shared way before because Roy didn't want to add styled components to osweb
You could pretty much copy/paste though. Maybe rex and assignable could share a component
This should be ready for another look |
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.
A couple of lint errors (it's not part of the check in checks). I have suggested the fixes.
Co-authored-by: Roy Johnson <roy.e.johnson@rice.edu>
Co-authored-by: Roy Johnson <roy.e.johnson@rice.edu>
Tom wants to move this snippet into GTM, so he requested that it be able to run without app code.