From a879938b7fac0450af759d96b4b24dbc7627a1fd Mon Sep 17 00:00:00 2001 From: Romain Derie Date: Fri, 9 Sep 2022 11:36:09 +0000 Subject: [PATCH] [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) --- .../components/fields/res_config_settings.js | 41 ------------------- .../components/fields/res_config_settings.xml | 28 ------------- .../views/res_config_settings_views.xml | 2 +- 3 files changed, 1 insertion(+), 70 deletions(-) delete mode 100644 addons/website/static/src/components/fields/res_config_settings.js delete mode 100644 addons/website/static/src/components/fields/res_config_settings.xml diff --git a/addons/website/static/src/components/fields/res_config_settings.js b/addons/website/static/src/components/fields/res_config_settings.js deleted file mode 100644 index 4b0828097da..00000000000 --- a/addons/website/static/src/components/fields/res_config_settings.js +++ /dev/null @@ -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); diff --git a/addons/website/static/src/components/fields/res_config_settings.xml b/addons/website/static/src/components/fields/res_config_settings.xml deleted file mode 100644 index f298d232ea5..00000000000 --- a/addons/website/static/src/components/fields/res_config_settings.xml +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - -
-

- Cookie bars may significantly impair the experience 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. -

-

- For session cookies, authentification and analytics, - you do not need to ask for the consent (see e.g. Opinion - 04/2012 on Cookie Consent Exemption by the EU Art.29 WP). -

-
-
- - - - -
-
- -
diff --git a/addons/website/views/res_config_settings_views.xml b/addons/website/views/res_config_settings_views.xml index 29d5804b2a2..0e14c11c991 100644 --- a/addons/website/views/res_config_settings_views.xml +++ b/addons/website/views/res_config_settings_views.xml @@ -116,7 +116,7 @@
- +