From 5df77b23d9c8a40bc2903a8059f0f24933c837a9 Mon Sep 17 00:00:00 2001 From: Martha Thompson <437455+MothOnMars@users.noreply.github.com> Date: Tue, 18 May 2021 11:02:00 -0400 Subject: [PATCH] SRCH-2150 remove legacy "advanced" header/footer (#726) - remove admin center controls for the advanced header/footer - bump simplecov - remove unused gems - bundle updated gems --- .simplecov | 2 +- Gemfile | 13 +- Gemfile.lock | 120 +++-- .../sites/validate_display_html.js.coffee | 18 - app/controllers/application_controller.rb | 16 +- app/controllers/image_searches_controller.rb | 1 - app/controllers/searches_controller.rb | 3 +- .../sites/header_and_footers_controller.rb | 65 +-- app/controllers/sites/sites_controller.rb | 1 - app/helpers/affiliate_helper.rb | 68 +-- app/helpers/header_and_footer_helper.rb | 27 +- app/mailers/emailer.rb | 7 - app/models/affiliate.rb | 183 +------- app/models/email_template.rb | 2 - app/views/layouts/searches.html.haml | 4 +- .../_advanced_mode_action_bar_items.html.haml | 13 - .../_advanced_mode_form.html.haml | 12 - ...le_mode_form.html.haml => _form.html.haml} | 0 .../_simple_mode_action_bar_items.html.haml | 3 - .../_validate_html_form.html.haml | 5 - .../sites/header_and_footers/edit.html.haml | 8 +- .../affiliate_header_footer_change.html.erb | 31 -- features/admin_center_manage_display.feature | 86 +--- features/legacy_search.feature | 9 - features/searches.feature | 9 - features/step_definitions/within_steps.rb | 2 - features/support/paths.rb | 2 - ...r_Footer.yml => Editing_Header_Footer.yml} | 181 ++++---- lib/renderers/css_to_nested_css.rb | 24 - lib/xml_processor.rb | 15 - spec/controllers/searches_controller_spec.rb | 10 +- .../sites/sites_controller_spec.rb | 1 - spec/helpers/affiliate_helper_spec.rb | 42 -- spec/models/affiliate_spec.rb | 425 +----------------- 34 files changed, 193 insertions(+), 1215 deletions(-) delete mode 100644 app/assets/javascripts/sites/validate_display_html.js.coffee delete mode 100644 app/views/sites/header_and_footers/_advanced_mode_action_bar_items.html.haml delete mode 100644 app/views/sites/header_and_footers/_advanced_mode_form.html.haml rename app/views/sites/header_and_footers/{_simple_mode_form.html.haml => _form.html.haml} (100%) delete mode 100644 app/views/sites/header_and_footers/_simple_mode_action_bar_items.html.haml delete mode 100644 app/views/sites/header_and_footers/_validate_html_form.html.haml delete mode 100644 db/email_templates/affiliate_header_footer_change.html.erb rename features/vcr_cassettes/Manage_Display/{Editing_Managed_Header_Footer.yml => Editing_Header_Footer.yml} (51%) delete mode 100644 lib/renderers/css_to_nested_css.rb delete mode 100644 lib/xml_processor.rb diff --git a/.simplecov b/.simplecov index 1b10520ba7..e25b9581d0 100644 --- a/.simplecov +++ b/.simplecov @@ -18,7 +18,7 @@ SimpleCov.start 'rails' do add_filter '/.bundler/' add_filter '/app/helpers/admin/' add_filter '/lib/i14y_collections.rb' - add_filter '/app/.*/.*azure.*.rb' + add_filter 'azure' add_filter '/lib/setup_resque.rb' add_group 'Engines', 'app/engines' diff --git a/Gemfile b/Gemfile index e0da1bfe56..95901a3079 100644 --- a/Gemfile +++ b/Gemfile @@ -18,7 +18,6 @@ gem 'omniauth_login_dot_gov', git: 'https://github.com/18f/omniauth_login_dot_go ref: '08ce9b5322efb2d82b2df3f6d774308c4028ee6c' gem 'omniauth-rails_csrf_protection', '~> 0.1.2' gem 'airbrake', '~> 7.1.1' -gem 'yajl-ruby', '~> 1.3.1', :require => 'yajl' gem 'redis', '~> 4.0.1' gem 'redis-namespace', '~> 1.6.0' gem 'redis-rails', '~> 5.0.2' @@ -27,7 +26,6 @@ gem 'resque-priority', :git => 'https://github.com/GSA/resque-priority.git' gem 'resque-timeout', '~> 1.0.0' gem 'resque-lock-timeout', '~> 0.4.5' gem 'resque-scheduler', '~> 4.3.1' -gem 'cocaine', '~> 0.5.8' gem 'paperclip', '~> 5.2.0' gem 'googlecharts', '~> 1.6.12' gem 'tweetstream', '~> 2.6.1' # no longer maintained? @@ -35,8 +33,7 @@ gem 'twitter', git: 'https://github.com/GSA/twitter.git', branch: '5-stable' gem 'flickraw', '~> 0.9.9' gem 'active_scaffold', '~> 3.5.0' gem 'active_scaffold_export', git: 'https://github.com/naaano/active_scaffold_export' -gem 'us_states_select', '~> 1.2.0', :git => 'https://github.com/jeremydurham/us-state-select-plugin.git', :require => 'us_states_select' -gem 'mobile-fu', '~> 1.4.0' +gem 'mobile-fu', '~> 1.4.0' # deprecated - legacy SERP gem "recaptcha", '~> 4.6.3', :require => "recaptcha/rails" gem 'newrelic_rpm', '~> 5.0.0' gem 'american_date', '~> 1.1.1' @@ -46,13 +43,11 @@ gem 'sass-rails', '~> 5.0.7' gem 'google_visualr', git: 'https://github.com/winston/google_visualr', ref: '17b97114a345baadd011e7b442b9a6c91a2b7ab5' -gem 'oj', '~> 3.3.10' gem 'faraday_middleware', '~> 0.12.2' gem 'net-http-persistent', '~> 2.9.3' gem 'rash_alt', git: 'https://github.com/MothOnMars/rash_alt', ref: 'bbd107061fbb066709523c68de4a217a76a8a945', require: 'rash' gem 'geoip', '~> 1.6.3' -gem 'us_states', '~> 0.1.1' -gem 'htmlentities', '~> 4.3.4' +gem 'htmlentities', '~> 4.3.4' # deprecated - only used in Google web search gem 'html_truncator', '~> 0.4.2' gem 'addressable', '~> 2.5.2' gem 'select2-rails', '~> 4.0.3' @@ -73,6 +68,7 @@ gem 'sitelink_generator', git: 'https://github.com/GSA/sitelink_generator', ref: gem 'typhoeus', '~> 1.3.0' gem 'activerecord-validate_unique_child_attribute', require: 'active_record/validate_unique_child_attribute' +# deprecated - jwt, grape, and grape-entity are only used by Search Consumer gem 'jwt', '~> 1.5.6' gem 'grape', '~> 1.1' gem 'grape-entity', '~> 0.6.0' @@ -82,7 +78,6 @@ gem 'retry_block', '~> 1.2.0' gem 'aws-sdk', '< 3.0' gem 'colorize', '~> 0.8.1' gem 'dogstatsd-ruby', '~> 3.2.0' -gem 'test-unit', '~> 3.2.7' gem 'http', '~> 1.0' gem 'robots_tag_parser', '~> 0.1.0', git: 'https://github.com/GSA/robots_tag_parser' gem 'loofah', '~> 2.9.0' @@ -159,7 +154,7 @@ end group :test do gem 'capybara-screenshot' - gem 'simplecov', '~> 0.15.1', require: false + gem 'simplecov', '~> 0.17.0', require: false # Limiting the cucumber version until v4 is compatible with VCR # https://github.com/vcr/vcr/issues/825 gem 'cucumber', '~> 3.0', require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9ad9ff44d6..1915dce295 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,13 +88,6 @@ GIT font-awesome-grunticon-rails (0.2.0) railties (>= 3.2) -GIT - remote: https://github.com/jeremydurham/us-state-select-plugin.git - revision: aa69cc1f23eea7cadd5acdcda74a0333d41852c1 - specs: - us_states_select (1.2.0) - rails (>= 1.2) - GIT remote: https://github.com/naaano/active_scaffold_export revision: 879ceb549b871ebb597ae5339a2e67498beb70d1 @@ -114,25 +107,25 @@ GEM specs: aasm (4.12.3) concurrent-ruby (~> 1.0) - actioncable (5.2.5) - actionpack (= 5.2.5) + actioncable (5.2.6) + actionpack (= 5.2.6) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.5) - actionpack (= 5.2.5) - actionview (= 5.2.5) - activejob (= 5.2.5) + actionmailer (5.2.6) + actionpack (= 5.2.6) + actionview (= 5.2.6) + activejob (= 5.2.6) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.5) - actionview (= 5.2.5) - activesupport (= 5.2.5) + actionpack (5.2.6) + actionview (= 5.2.6) + activesupport (= 5.2.6) rack (~> 2.0, >= 2.0.8) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.5) - activesupport (= 5.2.5) + actionview (5.2.6) + activesupport (= 5.2.6) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) @@ -143,24 +136,24 @@ GEM active_scheduler (0.5.0) activejob (>= 4.2.0) rake - activejob (5.2.5) - activesupport (= 5.2.5) + activejob (5.2.6) + activesupport (= 5.2.6) globalid (>= 0.3.6) - activemodel (5.2.5) - activesupport (= 5.2.5) - activerecord (5.2.5) - activemodel (= 5.2.5) - activesupport (= 5.2.5) + activemodel (5.2.6) + activesupport (= 5.2.6) + activerecord (5.2.6) + activemodel (= 5.2.6) + activesupport (= 5.2.6) arel (>= 9.0) activerecord-validate_unique_child_attribute (0.0.1) activemodel (>= 3.2.0) activerecord (>= 3.2.0) activesupport (>= 3.2.0) - activestorage (5.2.5) - actionpack (= 5.2.5) - activerecord (= 5.2.5) + activestorage (5.2.6) + actionpack (= 5.2.6) + activerecord (= 5.2.6) marcel (~> 1.0.0) - activesupport (5.2.5) + activesupport (5.2.6) concurrent-ruby (~> 1.0, >= 1.0.2) i18n (>= 0.7, < 2) minitest (~> 5.1) @@ -285,13 +278,13 @@ GEM cucumber-tag_expressions (1.1.1) cucumber-wire (0.0.1) curb (0.9.11) - daemons (1.3.1) + daemons (1.4.0) database_cleaner (1.7.0) declarative (0.0.20) descendants_tracker (0.0.4) thread_safe (~> 0.3, >= 0.3.1) diff-lcs (1.4.4) - docile (1.1.5) + docile (1.4.0) dogstatsd-ruby (3.2.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -488,7 +481,7 @@ GEM mobile-fu (1.4.0) rack-mobile-detect rails - moneta (1.4.1) + moneta (1.4.2) mono_logger (1.1.1) multi_json (1.15.0) multi_test (0.1.2) @@ -506,7 +499,6 @@ GEM nokogiri (1.11.3) mini_portile2 (~> 2.5.0) racc (~> 1.4) - oj (3.3.10) omniauth (1.4.3) hashie (>= 1.2, < 4) rack (>= 1.6.2, < 3) @@ -522,13 +514,12 @@ GEM mime-types mimemagic (~> 0.3.0) parallel (1.20.1) - parser (3.0.1.0) + parser (3.0.1.1) ast (~> 2.4.1) poltergeist (1.18.1) capybara (>= 2.1, < 4) cliver (~> 0.3.1) websocket-driver (>= 0.2.0) - power_assert (2.0.0) pry (0.13.1) coderay (~> 1.1) method_source (~> 1.0) @@ -554,18 +545,18 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.5) - actioncable (= 5.2.5) - actionmailer (= 5.2.5) - actionpack (= 5.2.5) - actionview (= 5.2.5) - activejob (= 5.2.5) - activemodel (= 5.2.5) - activerecord (= 5.2.5) - activestorage (= 5.2.5) - activesupport (= 5.2.5) + rails (5.2.6) + actioncable (= 5.2.6) + actionmailer (= 5.2.6) + actionpack (= 5.2.6) + actionview (= 5.2.6) + activejob (= 5.2.6) + activemodel (= 5.2.6) + activerecord (= 5.2.6) + activestorage (= 5.2.6) + activesupport (= 5.2.6) bundler (>= 1.3.0) - railties (= 5.2.5) + railties (= 5.2.6) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -581,15 +572,15 @@ GEM railties (>= 5.0, < 6) rails-observers (0.1.5) activemodel (>= 4.0) - railties (5.2.5) - actionpack (= 5.2.5) - activesupport (= 5.2.5) + railties (5.2.6) + actionpack (= 5.2.6) + activesupport (= 5.2.6) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rainbow (3.0.0) rake (12.3.3) - rb-fsevent (0.10.4) + rb-fsevent (0.11.0) rb-inotify (0.10.1) ffi (~> 1.0) recaptcha (4.6.6) @@ -683,15 +674,15 @@ GEM rubocop-ast (>= 1.2.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.4.1) - parser (>= 2.7.1.5) - rubocop-performance (1.11.0) + rubocop-ast (1.5.0) + parser (>= 3.0.1.1) + rubocop-performance (1.11.3) rubocop (>= 1.7.0, < 2.0) rubocop-ast (>= 0.4.0) - rubocop-rails (2.9.1) + rubocop-rails (2.10.1) activesupport (>= 4.2.0) rack (>= 1.1) - rubocop (>= 0.90.0, < 2.0) + rubocop (>= 1.7.0, < 2.0) rubocop-rake (0.5.1) rubocop rubocop-rspec (2.3.0) @@ -733,8 +724,8 @@ GEM jwt (>= 1.5, < 3.0) multi_json (~> 1.10) simple_oauth (0.3.1) - simplecov (0.15.1) - docile (~> 1.1.0) + simplecov (0.17.1) + docile (~> 1.1) json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) @@ -752,9 +743,8 @@ GEM activesupport (>= 4.0) sprockets (>= 3.0.0) temple (0.8.2) - terminal-table (1.6.0) - test-unit (3.2.9) - power_assert + terminal-table (3.0.1) + unicode-display_width (>= 1.1.1, < 3) therubyracer (0.12.3) libv8 (~> 3.16.14.15) ref @@ -788,7 +778,6 @@ GEM unf_ext unf_ext (0.0.7.7) unicode-display_width (2.0.0) - us_states (0.1.1) validate_url (0.2.0) activemodel (>= 3.0.0) vcr (4.0.0) @@ -815,7 +804,6 @@ GEM will_paginate (>= 3.0.3) xpath (3.2.0) nokogiri (~> 1.8) - yajl-ruby (1.3.1) yui-compressor (0.12.0) PLATFORMS @@ -837,7 +825,6 @@ DEPENDENCIES capybara (~> 2.18.0) capybara-screenshot cld3 (~> 3.2.3) - cocaine (~> 0.5.8) coffee-rails (~> 4.2.2) colorize (~> 0.8.1) compass-blueprint (~> 1.0.0) @@ -887,7 +874,6 @@ DEPENDENCIES net-http-persistent (~> 2.9.3) newrelic_rpm (~> 5.0.0) nokogiri (~> 1.11.1) - oj (~> 3.3.10) omniauth-rails_csrf_protection (~> 0.1.2) omniauth_login_dot_gov! paperclip (~> 5.2.0) @@ -929,10 +915,9 @@ DEPENDENCIES select2-rails (~> 4.0.3) shoulda-kept-assign-to (~> 1.1.0) shoulda-matchers (~> 4.1.1) - simplecov (~> 0.15.1) + simplecov (~> 0.17.0) sitelink_generator! spring (~> 2.0) - test-unit (~> 3.2.7) therubyracer (~> 0.12.3) truncator (~> 0.1.7) turbolinks (~> 5.0.1) @@ -941,8 +926,6 @@ DEPENDENCIES twitter-typeahead-rails (~> 0.11.1) typhoeus (~> 1.3.0) uglifier (~> 4.1.2) - us_states (~> 0.1.1) - us_states_select (~> 1.2.0)! validate_url (= 0.2.0) vcr (~> 4.0) virtus (~> 1.0.5) @@ -950,7 +933,6 @@ DEPENDENCIES webmock (~> 3.8.3) will_paginate (~> 3.1.6) will_paginate-bootstrap (~> 1.0.1) - yajl-ruby (~> 1.3.1) yui-compressor (~> 0.12.0) BUNDLED WITH diff --git a/app/assets/javascripts/sites/validate_display_html.js.coffee b/app/assets/javascripts/sites/validate_display_html.js.coffee deleted file mode 100644 index 22110061cb..0000000000 --- a/app/assets/javascripts/sites/validate_display_html.js.coffee +++ /dev/null @@ -1,18 +0,0 @@ -generateFullHtmlDocument = (targetId, content) -> - docType = '' - docPrefix = "