Skip to content

A platform for community discussion. Free, open, simple.

FIX: Display new-new selector on glimmer topic list (#27602)

Jarek Radoszfd2713e904de
diff --git a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs
index c4e486413b0..ec6c45065d1 100644
--- a/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs
+++ b/app/assets/javascripts/discourse/app/components/topic-list/topic-list-header-column.gjs
@@ -136,7 +136,7 @@ export default class TopicListHeaderColumn extends Component {
{{/if}}
{{#unless @bulkSelectEnabled}}
- {{#if this.showTopicsAndRepliesToggle}}
+ {{#if @showTopicsAndRepliesToggle}}
<NewListHeaderControls
@current={{@newListSubset}}
@newRepliesCount={{@newRepliesCount}}
diff --git a/spec/fabricators/topic_fabricator.rb b/spec/fabricators/topic_fabricator.rb
index f2ed08be097..f6d737cf092 100644
--- a/spec/fabricators/topic_fabricator.rb
+++ b/spec/fabricators/topic_fabricator.rb
@@ -35,3 +35,23 @@ Fabricator(:group_private_message_topic, from: :topic) do
topic_allowed_users { |t| [Fabricate.build(:topic_allowed_user, user: t[:user])] }
topic_allowed_groups { |t| [Fabricate.build(:topic_allowed_group, group: t[:recipient_group])] }
end
+
+Fabricator(:new_reply_topic, from: :topic) do
+ transient :current_user
+
+ before_create do |topic, transient|
+ if !transient[:current_user]
+ raise "new_reply_topic fabricator requires the `current_user` param"
+ end
+ end
+
+ after_create do |topic, transient|
+ Fabricate.times(2, :post, topic: topic)
+ TopicUser.change(
+ transient[:current_user].id,
+ topic.id,
+ notification_level: TopicUser.notification_levels[:tracking],
+ )
+ TopicUser.update_last_read(transient[:current_user], topic.id, 1, 1, 1)
+ end
+end
diff --git a/spec/system/topic_list/glimmer_spec.rb b/spec/system/topic_list/glimmer_spec.rb
index faab73cca7d..e3db3e7e518 100644
--- a/spec/system/topic_list/glimmer_spec.rb
+++ b/spec/system/topic_list/glimmer_spec.rb
@@ -20,6 +20,23 @@ describe "glimmer topic list", type: :system do
end
end
+ describe "/new" do
+ let(:topic_list) { PageObjects::Components::TopicList.new }
+
+ it "shows the list and the toggle buttons" do
+ SiteSetting.experimental_new_new_view_groups = group.name
+ Fabricate(:topic)
+ Fabricate(:new_reply_topic, current_user: user)
+
+ visit("/new")
+
+ expect(topic_list).to have_topics(count: 2)
+ expect(page).to have_css(".topics-replies-toggle.--all")
+ expect(page).to have_css(".topics-replies-toggle.--topics")
+ expect(page).to have_css(".topics-replies-toggle.--replies")
+ end
+ end
+
describe "categories-with-featured-topics page" do
let(:category_list) { PageObjects::Components::CategoryList.new }