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

Bug 1879792 - Add a cookie banner to BMO #2306

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

dklawren
Copy link
Collaborator

@dklawren dklawren commented Aug 30, 2024

From bug:
We should include a Cookie Banner on BMO to reduce our exposure to legal risks from changes in EU and US privacy law of the last several years.
BMO has a number of non-essential cookies that improve the UX of the site. Even though these non-essential cookies are not used for tracking purposes, Legal have advised that a cookie banner is still warranted.

  • This pull request uses JS code written by the web team for use in Mozilla web properties that I have vendored into the codebase since we do not use webpack.
  • I updated the BMO JS to also not set keys in localStorage if cookie consent is rejected.
  • The changes also look at a special header that is already included by CloudOps which has the region code for the client. If the region is in the whitelist then it will show the banner, otherwise all works as before.
  • GoogleAnalytics code is removed completely as we do not use it anymore.
  • There is a new input in the user preferences to turn on or off cookie consent even after clicking the banner.

Let me know if you have any questions

@dklawren dklawren requested a review from cgsheeh November 27, 2024 23:42
Copy link
Collaborator

@cgsheeh cgsheeh left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, just have a few questions and want to make sure that JSON.parse removal is expected.

Bugzilla/CGI.pm Outdated Show resolved Hide resolved
Bugzilla/Constants.pm Outdated Show resolved Hide resolved
userprefs.cgi Show resolved Hide resolved
extensions/BugModal/web/bug_modal.js Show resolved Hide resolved
extensions/BugModal/web/bug_modal.js Show resolved Hide resolved
…s. This doesn't require authenticated sessions.

- Added a cookie settings link to the user drop down below preferences and also a cookie settings link on the home page.
@dklawren dklawren requested a review from cgsheeh December 6, 2024 23:42
Bugzilla/Config/Admin.pm Show resolved Hide resolved
if (key.match(/^bug-modal-saved-comment-/)) {
let value = JSON.parse(localStorage.getItem(key));
let value = Bugzilla.Storage.get(key);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out-of-scope nit: I don't really love the implicit JSON handling, it would be better to have a get_json method that handles JSON values instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not sure why this is an issue as the Bugzilla.Storage class is handling the JSON parsing and stringification behind the scenes now. So the caller will use Bugzilla.Storage.get and the value returned will be a valid JSON object or a single value. So the caller will just need to check of value is typeof object if it is not sure. Bugzilla.Storage.set looks to see if the value passed is and object and if so, it will stringify it as JSON before storing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants