A platform for community discussion. Free, open, simple.
FIX: Unpinning topics in glimmer topic list (#30342)
Jarek Radosz5747b910e61d
diff --git a/app/assets/javascripts/discourse/app/components/topic-list/item.gjs b/app/assets/javascripts/discourse/app/components/topic-list/item.gjsindex ae3b44cb6b5..cd18330c1dd 100644--- a/app/assets/javascripts/discourse/app/components/topic-list/item.gjs+++ b/app/assets/javascripts/discourse/app/components/topic-list/item.gjs@@ -166,15 +166,6 @@ export default class Item extends Component {this.navigateToTopic(this.args.topic, this.args.topic.lastUnreadUrl);return;}-- if (- e.target.classList.contains("d-icon-thumbtack") &&- e.target.closest("a.topic-status")- ) {- e.preventDefault();- this.args.topic.togglePinnedForUser();- return;- }}@actiondiff --git a/spec/system/topic_list/glimmer_spec.rb b/spec/system/topic_list/glimmer_spec.rbindex c29881f8757..40a8e35bd9d 100644--- a/spec/system/topic_list/glimmer_spec.rb+++ b/spec/system/topic_list/glimmer_spec.rb@@ -128,4 +128,17 @@ describe "glimmer topic list", type: :system doendendend++ it "unpins globally pinned topics on click" do+ topic = Fabricate(:topic, pinned_globally: true, pinned_at: Time.current)+ visit("/latest")++ expect(page).to have_css(".topic-list-item .d-icon-thumbtack:not(.unpinned)")++ find(".topic-list-item .d-icon-thumbtack").click+ expect(page).to have_css(".topic-list-item .d-icon-thumbtack.unpinned")++ wait_for { TopicUser.exists?(topic:, user:) }+ expect(TopicUser.find_by(topic:, user:).cleared_pinned_at).to_not be_nil+ endend