Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Use category hashtag instead of link in discourse_welcome_topic.body #22875

Merged
merged 1 commit into from Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/locales/server.en.yml
Expand Up @@ -697,7 +697,7 @@ en:

:handshake: **Contribute** by commenting, sharing your own perspective, asking questions, or offering feedback in the discussion. Before replying or starting new topics, please review the [Community Guidelines](%{base_path}/faq).

> If you need help or have a suggestion, feel free to ask in [#feedback](%{base_path}/c/site-feedback) or [contact the admins](%{base_path}/about).
> If you need help or have a suggestion, feel free to ask in %{feedback_category} or [contact the admins](%{base_path}/about).

admin_quick_start_title: "Admin Guide: Getting Started"

Expand Down
5 changes: 5 additions & 0 deletions lib/seed_data/topics.rb
Expand Up @@ -109,6 +109,10 @@ def topics(site_setting_names: nil, include_welcome_topics: true, include_legal_
""
end

feedback_category = Category.find_by(id: SiteSetting.meta_category_id)
feedback_category_hashtag =
feedback_category ? "##{feedback_category.slug}" : "#site-feedback"

topics << {
site_setting_name: "welcome_topic_id",
title: I18n.t("discourse_welcome_topic.title", site_title: SiteSetting.title),
Expand All @@ -119,6 +123,7 @@ def topics(site_setting_names: nil, include_welcome_topics: true, include_legal_
site_title: SiteSetting.title,
site_description: SiteSetting.site_description,
site_info_quote: site_info_quote,
feedback_category: feedback_category_hashtag,
),
category: general_category,
after_create: proc { |post| post.topic.update_pinned(true, true) },
Expand Down
5 changes: 5 additions & 0 deletions spec/lib/seed_data/topics_spec.rb
Expand Up @@ -16,6 +16,9 @@ def create_topic(name = "welcome_topic_id")

describe "#create" do
it "creates a missing topic" do
staff_category = Fabricate(:category, name: "Feedback")
SiteSetting.meta_category_id = staff_category.id

expect { create_topic }.to change { Topic.count }.by(1).and change { Post.count }.by(1)

topic = Topic.last
Expand All @@ -29,6 +32,7 @@ def create_topic(name = "welcome_topic_id")
site_title: SiteSetting.title,
site_description: SiteSetting.site_description,
site_info_quote: "",
feedback_category: "#feedback",
).rstrip,
)
expect(topic.category_id).to eq(SiteSetting.general_category_id)
Expand Down Expand Up @@ -133,6 +137,7 @@ def update_topic(name = "welcome_topic_id", skip_changed: false)
site_title: SiteSetting.title,
site_description: SiteSetting.site_description,
site_info_quote: "",
feedback_category: "#site-feedback",
).rstrip,
)
end
Expand Down