From 03c36dfd7f5ee6cc330befa743b59363a910e63a Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Mon, 5 Apr 2021 13:31:13 +0100 Subject: [PATCH] Remove Bugherd :fire: --- .../admin/general_settings_controller.rb | 2 +- app/models/spree/app_configuration.rb | 1 - app/views/layouts/_bugherd_script.html.haml | 8 ------- app/views/layouts/darkswarm.html.haml | 1 - app/views/layouts/registration.html.haml | 1 - app/views/spree/admin/shared/_head.html.haml | 1 - config/locales/en.yml | 1 - spec/features/admin/external_services_spec.rb | 24 ------------------- 8 files changed, 1 insertion(+), 38 deletions(-) delete mode 100644 app/views/layouts/_bugherd_script.html.haml delete mode 100644 spec/features/admin/external_services_spec.rb diff --git a/app/controllers/spree/admin/general_settings_controller.rb b/app/controllers/spree/admin/general_settings_controller.rb index 7c2ef6e695..dd5fbbc51f 100644 --- a/app/controllers/spree/admin/general_settings_controller.rb +++ b/app/controllers/spree/admin/general_settings_controller.rb @@ -3,7 +3,7 @@ module Spree class GeneralSettingsController < Spree::Admin::BaseController def edit @preferences_general = [:site_name, :default_seo_title, :default_meta_keywords, - :default_meta_description, :site_url, :bugherd_api_key] + :default_meta_description, :site_url] @preferences_security = [:allow_ssl_in_production, :allow_ssl_in_staging, :allow_ssl_in_development_and_test] @preferences_currency = [:display_currency, :hide_cents] diff --git a/app/models/spree/app_configuration.rb b/app/models/spree/app_configuration.rb index d30f0e6215..ce9745a163 100644 --- a/app/models/spree/app_configuration.rb +++ b/app/models/spree/app_configuration.rb @@ -124,7 +124,6 @@ module Spree preference :last_job_queue_heartbeat_at, :string, default: nil # External services - preference :bugherd_api_key, :string, default: nil preference :matomo_url, :string, default: nil preference :matomo_site_id, :string, default: nil preference :matomo_tag_manager_url, :string, default: nil diff --git a/app/views/layouts/_bugherd_script.html.haml b/app/views/layouts/_bugherd_script.html.haml deleted file mode 100644 index 8a04160cfd..0000000000 --- a/app/views/layouts/_bugherd_script.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -- if (Rails.env.staging? || Rails.env.production?) && Spree::Config.bugherd_api_key.present? - :javascript - (function (d, t) { - var bh = d.createElement(t), s = d.getElementsByTagName(t)[0]; - bh.type = 'text/javascript'; - bh.src = '//www.bugherd.com/sidebarv2.js?apikey=#{Spree::Config.bugherd_api_key}'; - s.parentNode.insertBefore(bh, s); - })(document, 'script'); diff --git a/app/views/layouts/darkswarm.html.haml b/app/views/layouts/darkswarm.html.haml index e1ae43cf7a..2ade6f4e86 100644 --- a/app/views/layouts/darkswarm.html.haml +++ b/app/views/layouts/darkswarm.html.haml @@ -61,5 +61,4 @@ = inject_currency_config = yield :injection_data - = render "layouts/bugherd_script" = render "layouts/matomo_tag" diff --git a/app/views/layouts/registration.html.haml b/app/views/layouts/registration.html.haml index e3faffe939..854fed72ca 100644 --- a/app/views/layouts/registration.html.haml +++ b/app/views/layouts/registration.html.haml @@ -35,4 +35,3 @@ = yield :injection_data = render "layouts/i18n_script" - = render "layouts/bugherd_script" diff --git a/app/views/spree/admin/shared/_head.html.haml b/app/views/spree/admin/shared/_head.html.haml index 71e3170e59..e783e2f07e 100644 --- a/app/views/spree/admin/shared/_head.html.haml +++ b/app/views/spree/admin/shared/_head.html.haml @@ -21,7 +21,6 @@ %script = raw "var AUTH_TOKEN = \"#{form_authenticity_token}\";" -= render "layouts/bugherd_script" %link{'data-require' => "font-awesome@*", 'data-semver'=>"4.2.0", 'rel' => "stylesheet", 'href' => "//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.2.0/css/font-awesome.css"} = render "layouts/auth_token_script" diff --git a/config/locales/en.yml b/config/locales/en.yml index 0e4c11fd9a..fcbdedb960 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -3094,7 +3094,6 @@ See the %{link} to find out more about %{sitename}'s features and to start using back_to_adjustments_list: "Back to adjustments" back_to_users_list: "Back to users" back_to_zones_list: "Back to zones" - bugherd_api_key: "Bugherd API key" card_code: "Card code" card_number: "Card number" category: "Category" diff --git a/spec/features/admin/external_services_spec.rb b/spec/features/admin/external_services_spec.rb deleted file mode 100644 index e4ec773840..0000000000 --- a/spec/features/admin/external_services_spec.rb +++ /dev/null @@ -1,24 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -feature 'External services' do - include AuthenticationHelper - - describe "bugherd" do - before do - Spree::Config.bugherd_api_key = nil - login_to_admin_section - end - - it "lets me set an API key" do - visit spree.edit_admin_general_settings_path - - fill_in 'bugherd_api_key', with: 'abc123' - click_button 'Update' - - expect(page).to have_content 'General Settings has been successfully updated!' - expect(Spree::Config.bugherd_api_key).to eq 'abc123' - end - end -end