diff --git a/Gemfile.lock b/Gemfile.lock index e1577b4037a0..e8f6d48e3ece 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -173,8 +173,6 @@ GEM execjs coffee-script-source (1.12.2) concurrent-ruby (1.2.2) - cookies_eu (1.7.8) - js_cookie_rails (~> 2.2.0) crass (1.0.6) daemons (1.4.1) dalli (3.2.6) @@ -295,8 +293,6 @@ GEM actionpack (>= 3.1) railties (>= 3.1) sassc - js_cookie_rails (2.2.0) - railties (>= 3.1) json (2.6.3) jwt (2.7.1) kaminari (1.2.2) @@ -715,7 +711,6 @@ DEPENDENCIES caxlsx_rails (~> 0.6.3) ckeditor (~> 4.3.0) cocoon (~> 1.2.15) - cookies_eu daemons (~> 1.4.1) dalli (~> 3.2.6) delayed_job_active_record (~> 4.1.7) diff --git a/Gemfile_custom b/Gemfile_custom index 0e5dabf8e687..86bc60cd38ed 100644 --- a/Gemfile_custom +++ b/Gemfile_custom @@ -26,5 +26,4 @@ # Add your custom gem dependencies here gem "ruby-ntlm" -gem "cookies_eu" gem "capistrano-systemd-multiservice", "~> 0.1.0.beta13", require: false diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 88ae5c9a4686..1e4c97167dce 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -4,13 +4,11 @@ // * Spanish: https://github.com/consuldemocracy/consuldemocracy/blob/master/CUSTOMIZE_ES.md#javascript // // -//= require cookies_eu var initialize_modules = function() { "use strict"; App.GoogleSearch.initialize(); - App.ConsentBanner.initialize(); }; $(document).on("turbolinks:load", initialize_modules); diff --git a/app/assets/javascripts/custom/consent_banner.js b/app/assets/javascripts/custom/consent_banner.js deleted file mode 100644 index 53e166e3f6b6..000000000000 --- a/app/assets/javascripts/custom/consent_banner.js +++ /dev/null @@ -1,28 +0,0 @@ -(function() { - "use strict"; - App.ConsentBanner = { - trackConsent: function(google_tag_manager_id) { - document.addEventListener("cookies-eu-acknowledged", function() { - $.ajax({ - url: "https://www.googletagmanager.com/gtag/js?id=" + google_tag_manager_id, - dataType: "script", - success: function() { - window.dataLayer = window.dataLayer || []; - function gtag() { - window.dataLayer.push(arguments); - } - gtag("js", new Date()); - gtag("consent", { "analytics_storage": "allowed" }); - gtag("config", google_tag_manager_id); - } - }); - }); - }, - initialize: function() { - var google_tag_manager_id = $(".cookies-eu").data("google-tag-manager-id"); - if (google_tag_manager_id) { - App.ConsentBanner.trackConsent(google_tag_manager_id); - } - } - }; -}).call(this); diff --git a/app/assets/stylesheets/custom.scss b/app/assets/stylesheets/custom.scss index 5208717cd822..584069f4c10f 100644 --- a/app/assets/stylesheets/custom.scss +++ b/app/assets/stylesheets/custom.scss @@ -1,6 +1,5 @@ // Override and add customized styles in this file. // -@import "cookies_eu"; @import "font-awesome/icons"; // Registration and user account page @@ -334,11 +333,6 @@ } } -// COOKIES BANNER -.cookies-eu-ok { - background-color: $secondary !important; -} - // PAGES .page-title { border-bottom: 4px solid $secondary; diff --git a/app/components/custom/layout/consent_banner_component.html.erb b/app/components/custom/layout/consent_banner_component.html.erb deleted file mode 100644 index a0b14547fea2..000000000000 --- a/app/components/custom/layout/consent_banner_component.html.erb +++ /dev/null @@ -1,18 +0,0 @@ -<% if cookies.kind_of? ActionDispatch::Cookies::CookieJar %> - <% if cookies && cookies["cookie_eu_consented"] != "true" %> -
- data-google-tag-manager-id="<%= Rails.application.secrets.google_tag_manager_id %>"> - - <%= sanitize(t("cookies_eu.cookies_text", cookies_link: link_to(t("cookies_eu.cookies_link"), "/cookies"))) %> - - - - <% if defined?(link).present? %> - "> <%= t("cookies_eu.learn_more") %> - <% end %> - -
- <% end %> -<% else %> - <% raise Exception.new "'cookies' is a reserved Rails class, please rename your method" %> -<% end %> diff --git a/app/components/custom/layout/consent_banner_component.rb b/app/components/custom/layout/consent_banner_component.rb deleted file mode 100644 index ff7b3abf85c3..000000000000 --- a/app/components/custom/layout/consent_banner_component.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Layout::ConsentBannerComponent < ApplicationComponent - delegate :cookies, to: :helpers -end diff --git a/app/views/custom/layouts/application.html.erb b/app/views/custom/layouts/application.html.erb index 0a562d43dc97..1a2aa0256757 100644 --- a/app/views/custom/layouts/application.html.erb +++ b/app/views/custom/layouts/application.html.erb @@ -15,8 +15,6 @@ <%= raw setting["html.per_page_code_body"] %> - <%= render Layout::ConsentBannerComponent.new %> -
<%= render "layouts/header", with_subnavigation: true %> <%= render "layouts/flash" %> diff --git a/config/locales/custom/es/general.yml b/config/locales/custom/es/general.yml index 4e779812a1b6..73b2e3298e2a 100644 --- a/config/locales/custom/es/general.yml +++ b/config/locales/custom/es/general.yml @@ -9,10 +9,6 @@ es: support_title: Atención Ciudadana support_number: 922 239 500 search: Buscar - cookies_eu: - cookies_text: Este sitio web utiliza cookies propias y de terceros para el correcto funcionamiento de la página y para fines analíticos y publicitarios. Puedes aceptar las cookies pulsando el botón “Aceptar” u obtener información adicional para configurarlas o rechazar su uso clicando %{cookies_link}. - cookies_link: AQUÍ - ok: Aceptar layouts: footer: links: diff --git a/spec/system/custom/consent_banner_spec.rb b/spec/system/custom/consent_banner_spec.rb deleted file mode 100644 index 0aa8e4938de7..000000000000 --- a/spec/system/custom/consent_banner_spec.rb +++ /dev/null @@ -1,45 +0,0 @@ -require "rails_helper" - -describe "Consent banner" do - scenario "Is shown in public pages" do - visit root_path - - within ".cookies-eu" do - expect(page).to have_button("OK") - end - - visit debates_path - - within ".cookies-eu" do - expect(page).to have_button("OK") - end - - visit polls_path - - within ".cookies-eu" do - expect(page).to have_button("OK") - end - end - - scenario "Is hidden when accepted and when browsing other pages" do - visit root_path - - within ".cookies-eu" do - click_button "OK" - end - - expect(page).not_to have_css(".cookies-eu") - - visit root_path - - expect(page).not_to have_css(".cookies-eu") - - visit debates_path - - expect(page).not_to have_css(".cookies-eu") - - visit polls_path - - expect(page).not_to have_css(".cookies-eu") - end -end diff --git a/spec/system/legislation/draft_versions_spec.rb b/spec/system/legislation/draft_versions_spec.rb index 10394bc8d69b..1e7c0b3e9d21 100644 --- a/spec/system/legislation/draft_versions_spec.rb +++ b/spec/system/legislation/draft_versions_spec.rb @@ -260,7 +260,6 @@ end scenario "Publish new comment with errors for an existing annotation" do - allow_any_instance_of(Layout::ConsentBannerComponent).to receive(:render?).and_return(false) create(:legislation_annotation, draft_version: draft_version) visit legislation_process_draft_version_path(draft_version.process, draft_version)