Skip to content

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

FIX: Chat webhook channel chooser filter always returns no matches (#38427)

Régis Hanol6db0935960f8
diff --git a/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js b/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
index 9328ce61bb0..1e9c8bd85b8 100644
--- a/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
+++ b/plugins/chat/assets/javascripts/discourse/components/chat-channel-chooser.js
@@ -13,6 +13,8 @@ import ChatChannelChooserRow from "./chat-channel-chooser-row";
})
@pluginApiIdentifiers("chat-channel-chooser")
export default class ChatChannelChooser extends ComboBoxComponent {
+ nameProperty = "title";
+
modifyComponentForRow() {
return ChatChannelChooserRow;
}
diff --git a/plugins/chat/spec/system/admin/incoming_webhooks_spec.rb b/plugins/chat/spec/system/admin/incoming_webhooks_spec.rb
index d8653d10462..ef9e04ce7e2 100644
--- a/plugins/chat/spec/system/admin/incoming_webhooks_spec.rb
+++ b/plugins/chat/spec/system/admin/incoming_webhooks_spec.rb
@@ -13,6 +13,21 @@ describe "Admin Chat Incoming Webhooks", type: :system do
sign_in(current_user)
end
+ it "can filter channels in the channel chooser" do
+ other_channel = Fabricate(:chat_channel)
+ Fabricate.times(9, :chat_channel)
+
+ admin_incoming_webhooks_page.visit
+ admin_incoming_webhooks_page.click_new
+
+ chooser = admin_incoming_webhooks_page.channel_chooser
+ chooser.expand
+ chooser.search(chat_channel_1.title)
+
+ expect(chooser).to have_no_option_value(other_channel.id)
+ expect(chooser).to have_option_value(chat_channel_1.id)
+ end
+
it "can create incoming webhooks" do
admin_incoming_webhooks_page.visit