[IMP] website: don't warn people when enabling cookies bar
This was introduced alongside the introduction of the cookies bar in odoo with [1]. It's not something we wanted but for some internal reason, we were not allowed to introduce the cookies bar on the website without that warning when enabling the settings (which also comes with Cancel button as primary button..). The compromise was accepted as having a cookies bar was something we really needed. It has now been accepted to get rid of it. While some internal people still think we should educate people about GDPR and cookies law, I doubt that this settings was the right place to do it. Indeed, it was more leading to bad UX as most people just clicked on "activate anyway" without realizing they still had to save the settings afterward. [1]: https://github.com/odoo/odoo/commit/3028e9a8649ae5d9b23a1bdb989b903645ede5fe closes odoo/odoo#99917 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { BooleanField } from '@web/views/fields/boolean/boolean_field';
|
||||
import { Dialog } from '@web/core/dialog/dialog';
|
||||
import { registry } from "@web/core/registry";
|
||||
import { useService } from "@web/core/utils/hooks";
|
||||
|
||||
const { Component } = owl;
|
||||
|
||||
class CookieBarDialog extends Component {
|
||||
accept() {
|
||||
this.props.accept();
|
||||
this.props.close();
|
||||
}
|
||||
}
|
||||
CookieBarDialog.components = { Dialog };
|
||||
CookieBarDialog.template = 'website.res_config_settings.CookieDialog';
|
||||
|
||||
class WebsiteCookiebarField extends BooleanField {
|
||||
setup() {
|
||||
this.dialog = useService('dialog');
|
||||
}
|
||||
|
||||
onChange(newValue) {
|
||||
if (!newValue) {
|
||||
return this.props.update(newValue);
|
||||
}
|
||||
let value = false;
|
||||
this.dialog.add(CookieBarDialog, {
|
||||
title: "Website Cookie Bar",
|
||||
accept: () => {
|
||||
value = true;
|
||||
},
|
||||
}, {
|
||||
onClose: () => {
|
||||
this.props.update(value);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
registry.category("fields").add("website_cookiesbar_field", WebsiteCookiebarField);
|
||||
@@ -1,28 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates id="template" xml:space="preserve">
|
||||
|
||||
<t t-name="website.res_config_settings.CookieDialog" owl="1">
|
||||
<Dialog title="'Please confirm'" size="'md'">
|
||||
<t t-set-slot="default">
|
||||
<main role="alert">
|
||||
<p>
|
||||
<b>Cookie bars may significantly impair the experience</b> of
|
||||
your visitors. We recommend you avoid them unless you have
|
||||
verified with a legal advisor that you absolutely need cookie
|
||||
consent in your country.
|
||||
</p>
|
||||
<p>
|
||||
For session cookies, authentification and analytics,
|
||||
<b>you do not need to ask for the consent</b> (see e.g. Opinion
|
||||
04/2012 on Cookie Consent Exemption by the EU Art.29 WP).
|
||||
</p>
|
||||
</main>
|
||||
</t>
|
||||
<t t-set-slot="footer">
|
||||
<button class="btn btn-primary" t-on-click="props.close">Do not activate</button>
|
||||
<button class="btn btn-secondary" t-on-click="accept">Activate anyway</button>
|
||||
</t>
|
||||
</Dialog>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
@@ -116,7 +116,7 @@
|
||||
<div class="row mt16 o_settings_container" id="website_settings" attrs="{'invisible': [('website_id', '=', False)]}">
|
||||
<div class="col-12 col-lg-6 o_setting_box" id="website_cookies_bar_setting">
|
||||
<div class="o_setting_left_pane">
|
||||
<field name="website_cookies_bar" widget="website_cookiesbar_field"/>
|
||||
<field name="website_cookies_bar"/>
|
||||
</div>
|
||||
<div class="o_setting_right_pane">
|
||||
<label for="website_cookies_bar"/>
|
||||
|
||||
Reference in New Issue
Block a user