From f83062a9dd3d97bc9834d93073dffb4480bb586d Mon Sep 17 00:00:00 2001 From: Vaidehi Joshi Date: Tue, 6 Oct 2020 12:46:04 -0700 Subject: [PATCH] Remove community_action from SiteConfig (#10678) --- app/controllers/admin/configs_controller.rb | 1 - app/controllers/concerns/verify_setup_completed.rb | 1 - app/lib/constants/site_config.rb | 4 ---- app/models/site_config.rb | 1 - app/views/admin/configs/show.html.erb | 9 --------- app/views/mailers/digest_mailer/digest_email.html.erb | 4 ++-- .../mailers/notify_mailer/trusted_role_email.html.erb | 2 -- .../mailers/notify_mailer/trusted_role_email.text.erb | 2 -- spec/requests/admin/configs_spec.rb | 7 ------- spec/system/admin/admin_manages_configuration_spec.rb | 3 +-- 10 files changed, 3 insertions(+), 31 deletions(-) diff --git a/app/controllers/admin/configs_controller.rb b/app/controllers/admin/configs_controller.rb index 44f58e9f6..4e6703d2d 100644 --- a/app/controllers/admin/configs_controller.rb +++ b/app/controllers/admin/configs_controller.rb @@ -141,7 +141,6 @@ module Admin community_name community_description community_member_label - community_action community_copyright_start_year staff_user_id tagline diff --git a/app/controllers/concerns/verify_setup_completed.rb b/app/controllers/concerns/verify_setup_completed.rb index b7cba402b..2348d641a 100644 --- a/app/controllers/concerns/verify_setup_completed.rb +++ b/app/controllers/concerns/verify_setup_completed.rb @@ -6,7 +6,6 @@ module VerifySetupCompleted MANDATORY_CONFIGS = %i[ community_name community_description - community_action main_social_image logo_png diff --git a/app/lib/constants/site_config.rb b/app/lib/constants/site_config.rb index 8295ee485..cf90423e2 100644 --- a/app/lib/constants/site_config.rb +++ b/app/lib/constants/site_config.rb @@ -33,10 +33,6 @@ module Constants description: "https://url.com/lander", placeholder: "URL campaign sidebar image will link to" }, - community_action: { - description: "Used to determine the action of community e.g coding, reading, training etc.", - placeholder: "coding" - }, community_copyright_start_year: { description: "Used to mark the year this forem was started.", placeholder: Time.zone.today.year.to_s diff --git a/app/models/site_config.rb b/app/models/site_config.rb index b00760238..ca0a13d49 100644 --- a/app/models/site_config.rb +++ b/app/models/site_config.rb @@ -42,7 +42,6 @@ class SiteConfig < RailsSettings::Base field :community_name, type: :string, default: ApplicationConfig["COMMUNITY_NAME"] || "New Forem" field :community_description, type: :string field :community_member_label, type: :string, default: "user" - field :community_action, type: :string field :tagline, type: :string field :community_copyright_start_year, type: :integer, default: ApplicationConfig["COMMUNITY_COPYRIGHT_START_YEAR"] || diff --git a/app/views/admin/configs/show.html.erb b/app/views/admin/configs/show.html.erb index 17210ff5a..711be300f 100644 --- a/app/views/admin/configs/show.html.erb +++ b/app/views/admin/configs/show.html.erb @@ -299,15 +299,6 @@
<%= Constants::SiteConfig::DETAILS[:community_member_label][:description] %>
-
- <%= admin_config_label :community_action %> - <%= f.text_field :community_action, - class: "form-control", - value: SiteConfig.community_action, - placeholder: Constants::SiteConfig::DETAILS[:community_action][:placeholder] %> -
<%= Constants::SiteConfig::DETAILS[:community_action][:description] %>
-
-
<%= admin_config_label :community_copyright_start_year %> <%= f.text_field :community_copyright_start_year, diff --git a/app/views/mailers/digest_mailer/digest_email.html.erb b/app/views/mailers/digest_mailer/digest_email.html.erb index f8bf851cb..60ec596bf 100644 --- a/app/views/mailers/digest_mailer/digest_email.html.erb +++ b/app/views/mailers/digest_mailer/digest_email.html.erb @@ -21,12 +21,12 @@ <% if @user.experience_level == nil %> - You can now add your <%= SiteConfig.community_action %> experience level to your account in order to receive more relevant content. + You can now add your experience level to your account in order to receive more relevant content.

Visit your settings to enter your experience level on a scale of 1-10.

- You can change it any time in the future. Happy <%= SiteConfig.community_action %>! + You can change it any time in the future. <% elsif @user.following_users_count == 0 %> <%= community_name %> Digest is a new periodic email featuring the best posts from our community of <%= community_members_label %>. diff --git a/app/views/mailers/notify_mailer/trusted_role_email.html.erb b/app/views/mailers/notify_mailer/trusted_role_email.html.erb index d3641ae5e..26aa84735 100644 --- a/app/views/mailers/notify_mailer/trusted_role_email.html.erb +++ b/app/views/mailers/notify_mailer/trusted_role_email.html.erb @@ -15,7 +15,5 @@ ">Click here for full details about basic mod privileges.

- Happy <%= SiteConfig.community_action %>! -
- <%= community_name %> Team

diff --git a/app/views/mailers/notify_mailer/trusted_role_email.text.erb b/app/views/mailers/notify_mailer/trusted_role_email.text.erb index 60c122a5a..16d925af9 100644 --- a/app/views/mailers/notify_mailer/trusted_role_email.text.erb +++ b/app/views/mailers/notify_mailer/trusted_role_email.text.erb @@ -8,6 +8,4 @@ You'll occasionally get on-site notifications asking you to take an action. You Visit <%= app_url("/community-moderation") %> for full details of what you can do with these new privileges. -Happy <%= SiteConfig.community_action %>! - - <%= community_name %> Team diff --git a/spec/requests/admin/configs_spec.rb b/spec/requests/admin/configs_spec.rb index 3180b2292..902678547 100644 --- a/spec/requests/admin/configs_spec.rb +++ b/spec/requests/admin/configs_spec.rb @@ -103,13 +103,6 @@ RSpec.describe "/admin/config", type: :request do expect(SiteConfig.community_member_label).to eq(name) end - it "updates the community_action" do - action = "reading" - post "/admin/config", params: { site_config: { community_member_label: action }, - confirmation: confirmation_message } - expect(SiteConfig.community_member_label).to eq(action) - end - it "updates the community_copyright_start_year" do year = "2018" post "/admin/config", params: { site_config: { community_copyright_start_year: year }, diff --git a/spec/system/admin/admin_manages_configuration_spec.rb b/spec/system/admin/admin_manages_configuration_spec.rb index a5384a05f..ab4f96cc3 100644 --- a/spec/system/admin/admin_manages_configuration_spec.rb +++ b/spec/system/admin/admin_manages_configuration_spec.rb @@ -33,9 +33,8 @@ RSpec.describe "Admin manages configuration", type: :system do allow(SiteConfig).to receive(:tagline).and_return(nil) allow(SiteConfig).to receive(:suggested_users).and_return(nil) allow(SiteConfig).to receive(:suggested_tags).and_return(nil) - allow(SiteConfig).to receive(:community_action).and_return(nil) visit root_path - expect(page.body).to match(/Setup not completed yet, missing(.*)community action(.*), and others/) + expect(page.body).to match(/Setup not completed yet, missing(.*)main social image(.*), and others/) end end end