Postponed on #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts

Problem/Motivation

Currently, the Cookies Overlay text is created through

$textbox.text(Drupal.t('This content is blocked because @service cookies have not been accepted.',
              {'@service': serviceName}));

in javascript. Instead, we should let the admin define the cookies overlay message on creation of a cookies service. This has the advantage, that the admin can exactly define, what the user accepts, if he opts in to the cookie service. This could be relevant for the user rights in some countries.

Proposed resolution

Let the admin define the cookies overlay message on creation of a cookies service.

Issue fork cookies-3295271

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Grevil created an issue. See original summary.

anybody’s picture

Title: Cookies overlay message should be defined in the cookies service itself » [PP-1] Cookies overlay message should be defined in the cookies service itself
Issue summary: View changes
Status: Active » Postponed

Thanks @Grevil, indeed I think a custom summary text would help here and if entered, should be shown instead of the default text in the cookiesOverlay. The cookiesOverlay should get the text based on the service name (pull).

Before implementing this, we should be sure about the label / naming and if the text should also be shown in the cookie layer for the given service, not to clash with the "Documentation" text.

Also we should wait until #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts is finally committed.

grevil’s picture

Ok, so as discussed, we should add a textarea "Summary (for COOKiES Overlay)" in the Cookies Service Form and if that text is empty, we will use the default Cookies text as used before. Also group and describe it, so third parties will easily understand, what the field is for.

osopolar’s picture

Status: Postponed » Needs work

As #3225243: Add cookies input filter for blocking iframes and other relevant external embeds and scripts was added, this probably should be unblocked now.

IMHO the most important thing is to not use the machine name for the cookies overlay message. Currently I get "This content is blocked because Embedded_content cookies have not been accepted." with the button text "Only accept Embedded_content cookies". It will look much better if at least the human name/label is used instead of ucfirst(serviceName).

gilmord made their first commit to this issue’s fork.

gilmord’s picture

Status: Needs work » Needs review

Hi @Grevil @Anybody
Please check the MR attached, provided implementation allows to:
- configure placeholder text (top, "accept all" button and bottom text)
- it force usage of service labels in the placeholder instead of machine name

Placeholder texts configured in the global form, I think having it on the service level will be an overkill.
Having it configurable you can prepare a text to match any service.

If we really need the ability to have it on the service level - I would say we should keep the global one and allow users per-service override
Maybe we should keep it as a separate issue for later, so we can merge the current implementation.

gilmord’s picture

Hi again, updated MR with functionality to override placeholder text per-service with fallback to the default configuration text.

anybody’s picture

Status: Needs review » Needs work

@gilmord tests are failing.

Could you please add screenshots what's the actual / planned result? As there are multiple services, I don't really get your idea here.

gilmord’s picture

StatusFileSize
new15.26 KB
new21.39 KB
new26.48 KB
new13.3 KB
new47.95 KB
new17.22 KB
new45.58 KB

Hi @Anybody, here is what was done in the MR:

Part 1: use the service name instead of the machine name in the placeholder.
We have a service with the label "Some nice Video service label" and with the machine name "video"

Before this patch the placeholder looks like this (capitalized machine name):
before

With the patch (the label is used):
after

Part 2: allow to override of the placeholder texts
The functionality in the merge requests provides two ways to override the text for the placeholder.

Option 1: global settings on the /admin/config/cookies/texts page:
configuration
result

Option 2: each service can override the text for the placeholder:
configuration
result

All the data (texts and labels) passed as drupalSettings:
druplaSettings

gilmord’s picture

@Anybody I will check the tests results, probably the tests have to be updated with this functionality.

gilmord’s picture

Status: Needs work » Needs review

@Anybody I missed adding changes to the cookies.texts schema, added it and tests passed now.

anybody’s picture

Thank you @gilmord, we'll have a closer look asap at the logics and code!

anybody’s picture

Version: 1.0.x-dev » 1.1.x-dev
anybody’s picture

anybody’s picture

Title: [PP-1] Cookies overlay message should be defined in the cookies service itself » [2.x] Cookies overlay message should be defined in the cookies service itself
Parent issue: » #3323524: [META] Improve combination of COOKiES submodules and their services through "Drupal Plugins"

Let's solve this for 2.x together with the other service changes.

Fits in there very well!

anybody’s picture

Title: [2.x] Cookies overlay message should be defined in the cookies service itself » Cookies overlay message should be defined in the cookies service itself
Assigned: Unassigned » grevil
anybody’s picture

Status: Needs review » Needs work
anybody’s picture

Version: 1.1.x-dev » 1.2.x-dev
grevil’s picture

Status: Needs work » Fixed

This will be implemented inside #3324481: Allow for more structured Cookie Service information.

Thanks for the patches @gilmord, I'll change up the code a bit, but the general instinctive is great.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.