UX: Hide welcome topic from admins as well if not edited (#18807)

Depends on: #18806

We have a banner that prompts to edit the welcome topic, so let's not
show it in the topic list until it has been edited. Previously this
banner covered the welcome topic, now the banner will be above the topic
list, so we need to hide the welcome topic.
This commit is contained in:
Blake Erickson 2022-11-01 16:17:17 -06:00 committed by GitHub
parent e79208888c
commit fefd938520
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -30,7 +30,6 @@ module TopicQueryParams
def hide_welcome_topic? def hide_welcome_topic?
return false if !SiteSetting.bootstrap_mode_enabled return false if !SiteSetting.bootstrap_mode_enabled
return false if @guardian.is_admin?
Site.welcome_topic_exists_and_is_not_edited? Site.welcome_topic_exists_and_is_not_edited?
end end
end end

View File

@ -1003,14 +1003,14 @@ RSpec.describe ListController do
expect(parsed["topic_list"]["topics"].first["id"]).to eq(welcome_topic.id) expect(parsed["topic_list"]["topics"].first["id"]).to eq(welcome_topic.id)
end end
it "is shown to admins" do it "is hidden to admins" do
sign_in(admin) sign_in(admin)
get "/latest.json" get "/latest.json"
expect(response.status).to eq(200) expect(response.status).to eq(200)
parsed = response.parsed_body parsed = response.parsed_body
expect(parsed["topic_list"]["topics"].length).to eq(2) expect(parsed["topic_list"]["topics"].length).to eq(1)
expect(parsed["topic_list"]["topics"].first["id"]).to eq(welcome_topic.id) expect(parsed["topic_list"]["topics"].first["id"]).not_to eq(welcome_topic.id)
end end
it "is shown to users when bootstrap mode is disabled" do it "is shown to users when bootstrap mode is disabled" do