From fefd93852058fec8f32b263dfe7568ff16dfc18a Mon Sep 17 00:00:00 2001 From: Blake Erickson Date: Tue, 1 Nov 2022 16:17:17 -0600 Subject: [PATCH] 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. --- lib/topic_query_params.rb | 1 - spec/requests/list_controller_spec.rb | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/topic_query_params.rb b/lib/topic_query_params.rb index 7081513c3f..5c0175a8ba 100644 --- a/lib/topic_query_params.rb +++ b/lib/topic_query_params.rb @@ -30,7 +30,6 @@ module TopicQueryParams def hide_welcome_topic? return false if !SiteSetting.bootstrap_mode_enabled - return false if @guardian.is_admin? Site.welcome_topic_exists_and_is_not_edited? end end diff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rb index 7b08772566..60ea55c524 100644 --- a/spec/requests/list_controller_spec.rb +++ b/spec/requests/list_controller_spec.rb @@ -1003,14 +1003,14 @@ RSpec.describe ListController do expect(parsed["topic_list"]["topics"].first["id"]).to eq(welcome_topic.id) end - it "is shown to admins" do + it "is hidden to admins" do sign_in(admin) get "/latest.json" expect(response.status).to eq(200) parsed = response.parsed_body - expect(parsed["topic_list"]["topics"].length).to eq(2) - expect(parsed["topic_list"]["topics"].first["id"]).to eq(welcome_topic.id) + expect(parsed["topic_list"]["topics"].length).to eq(1) + expect(parsed["topic_list"]["topics"].first["id"]).not_to eq(welcome_topic.id) end it "is shown to users when bootstrap mode is disabled" do