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

UHF-10738 Cookie policy #821

Merged
merged 53 commits into from
Oct 10, 2024
Merged

UHF-10738 Cookie policy #821

merged 53 commits into from
Oct 10, 2024

Conversation

khalima
Copy link
Contributor

@khalima khalima commented Oct 7, 2024

UHF-10738

What was done

  • Added JS libraries for the HDS cookie consent and HDBT Cookie banner javascripts and necessary variables to Drupal Settings.
  • Added default settings for the cookie banner, schema definitions for the configuration variables and new variables for the cookie banner settings form.
  • Added deprecation comments to EU cookie compliance related code.
  • Added install hook for the hdbt_cookie_banner to uninstall eu_cookie_compliance module.
  • Added theme hook and a template for the new cookie policy settings page.
  • New route and controller for the cookie policy page.

How to install

  • Make sure your instance is up and running on latest dev branch.
    • git pull origin dev
    • make fresh
  • Update the Helfi Platform config
    • composer require drupal/helfi_platform_config:dev-UHF-10738 drupal/hdbt:dev-UHF-10738 -W
  • Run make drush-updb drush-cr
  • Go to shell and install the hdbt_cookie_banner module
    • make shell
    • drush en -y hdbt_cookie_banner
  • Uninstall the eu_cookie_compliance and helfi_eu_cookie_compliance modules
    • drush pmu -y eu_cookie_compliance

How to test

  • Log in to drupal and go to /admin/structure/hdbt-cookie-banner
  • Select "Use instance specific cookie settings" checkbox.
    • This will make the Drupal use the instance specific cookie settings and cookie banner javascript
  • Copy the contents of this file to Site settings textarea: sitesettings.json
  • Save the changes
  • Refresh the page and check that the cookie banner appears
    image
  •  Try to change f.e. the Website name and save the settings, reload the page and check that the cookie banner website name has changed.

How to test the workflow with helfi etusivu

  • Do the same installation tasks for helfi etusivu
    • Log in to helfi-etusivu drupal and go to /admin/structure/hdbt-cookie-banner
    • Select "Use instance specific cookie settings" checkbox.
    • Copy the contents of this file to Site settings textarea: sitesettings.json and save the changes
  • Switch back to the instance you were testing before and head to /admin/structure/hdbt-cookie-banner
  • Unselect the "Use instance specific cookie settings" checkbox and save the changes
  • Clear the caches and check that the Cookie banner still works
  • Check that code follows our standards

Translations

  • Translations have been added to .po -files and included in this PR

Other PRs

Copy link
Contributor

@teroelonen teroelonen left a comment

Choose a reason for hiding this comment

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

Approve from me! Works really nicely 🦖

Copy link

sonarcloud bot commented Oct 10, 2024

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 14.97%. Comparing base (bb50a52) to head (8f5dd4a).
Report is 61 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main     #821      +/-   ##
============================================
- Coverage     15.29%   14.97%   -0.32%     
+ Complexity      259      255       -4     
============================================
  Files            31       29       -2     
  Lines           981      968      -13     
============================================
- Hits            150      145       -5     
+ Misses          831      823       -8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

4 participants