ebiwd / EBI-Framework

The EMBL-EBI Visual Framework for websites and services.
https://www.ebi.ac.uk/style-lab/websites/
19 stars 16 forks source link

New data protection banner #137

Closed khawkins98 closed 6 years ago

khawkins98 commented 6 years ago

As EMBL-EBI moves to rollout its Data Protection messaging at the end of May, we'll be replacing the old cookie banner with a data protection notice.

We'll begin testing/rolling this out in v1.3, and it will eventually come to v1.2 an v1.1 and some sort of implementation for compliance sites. Though the plan beyond v1.3 is not yet clear, it may be that sites on the older versions need to point to the new JS for the banner.

You can see a test implementation on the dev Style Lab: https://wwwdev.ebi.ac.uk/style-lab/

We still have yet to finalise the code and text messaging.

Further reading/links:

khawkins98 commented 6 years ago

Looks like (message text is a placeholder):

image

Teams can add a custom message/settings by adding a div:

<div id="data-protection-message-configuration" 
 data-message="Your message here." data-link="#" 
 data-service-id="myService" data-data-protection-version="0.1"></div>

The code responsible lives in

<script defer="defer" src="https://dev.ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/script.js"></script> with ebiFrameworkRunDataProtectionBanner()  

khawkins98 commented 6 years ago

A simple way to graft this onto earlier v1.1, 1.2, and compliance sites (proof of concept):

  var localFrameworkVersion = '1.1'; // 1.1 or 1.2 or compliance or other
        // if you select compliance or other we will add some helpful
        // CSS styling, but you may need to add some CSS yourself
    var newDataProtectionNotificationBanner = document.createElement('script');
    newDataProtectionNotificationBanner.src = 'https://dev.ebi.emblstatic.net/web_guidelines/EBI-Framework/v1.3/js/ebi-global-includes/script/5_ebiFrameworkNotificationBanner.js?legacyRequest='+localFrameworkVersion;
    document.head.appendChild(newDataProtectionNotificationBanner);
    newDataProtectionNotificationBanner.onload = function() {
      ebiFrameworkRunDataProtectionBanner(); // invoke the banner
    };
khawkins98 commented 6 years ago

This banner is now live and documentation lives at https://www.ebi.ac.uk/style-lab/websites/patterns/banner-data-protection.html

nclopezo commented 6 years ago

Hi,

In the current ChEMBL web interface the cookie banner is created with this script:

<script defer src="//www.ebi.ac.uk/web_guidelines/js/cookiebanner.js"></script>

I would like to confirm that this script will be updated to generate the new data protection banner.

Thanks

khawkins98 commented 6 years ago

Marking this one as completed.