Remove community_action from SiteConfig (#10678)

This commit is contained in:
Vaidehi Joshi 2020-10-06 12:46:04 -07:00 committed by GitHub
parent 70bd93d940
commit f83062a9dd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 3 additions and 31 deletions

View file

@ -141,7 +141,6 @@ module Admin
community_name
community_description
community_member_label
community_action
community_copyright_start_year
staff_user_id
tagline

View file

@ -6,7 +6,6 @@ module VerifySetupCompleted
MANDATORY_CONFIGS = %i[
community_name
community_description
community_action
main_social_image
logo_png

View file

@ -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

View file

@ -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"] ||

View file

@ -299,15 +299,6 @@
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:community_member_label][:description] %></div>
</div>
<div class="form-group">
<%= admin_config_label :community_action %>
<%= f.text_field :community_action,
class: "form-control",
value: SiteConfig.community_action,
placeholder: Constants::SiteConfig::DETAILS[:community_action][:placeholder] %>
<div class="alert alert-info"><%= Constants::SiteConfig::DETAILS[:community_action][:description] %></div>
</div>
<div class="form-group">
<%= admin_config_label :community_copyright_start_year %>
<%= f.text_field :community_copyright_start_year,

View file

@ -21,12 +21,12 @@
<em>
<% if @user.experience_level == nil %>
<b>
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.
</b>
<br /><br />
Visit <b><a href="<%= app_url(user_settings_path(:misc)) %>" style="text-decoration: none;">your settings</a></b> to enter your experience level on a scale of 1-10.
<br /><br />
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 %>
<b>
<%= community_name %> Digest is a new periodic email featuring the best posts from our community of <%= community_members_label %>.

View file

@ -15,7 +15,5 @@
<b><a href="<%= app_url("/community-moderation") %>">Click here for full details about basic mod privileges.</b></a>
</p>
<p>
Happy <%= SiteConfig.community_action %>!
<br>
- <%= community_name %> Team
</p>

View file

@ -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

View file

@ -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 },

View file

@ -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