From aad63d92d263e0ffb4c8856584b15fb7f857e0da Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 27 Dec 2022 20:56:26 +0100 Subject: [PATCH] FIX: removes missed chat_channels legacy paths (#19634) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - chat-channel-by-name is no longer supported - chat_channels_controller doesn’t exist anymore --- .../javascripts/discourse/chat-route-map.js | 1 - .../discourse/routes/chat-channel-by-name.js | 28 ------------------- plugins/chat/plugin.rb | 6 ---- 3 files changed, 35 deletions(-) delete mode 100644 plugins/chat/assets/javascripts/discourse/routes/chat-channel-by-name.js diff --git a/plugins/chat/assets/javascripts/discourse/chat-route-map.js b/plugins/chat/assets/javascripts/discourse/chat-route-map.js index a4e03558a2d..582253f65b5 100644 --- a/plugins/chat/assets/javascripts/discourse/chat-route-map.js +++ b/plugins/chat/assets/javascripts/discourse/chat-route-map.js @@ -20,6 +20,5 @@ export default function () { this.route("archived", { path: "/archived" }); }); this.route("message", { path: "/message/:messageId" }); - this.route("channelByName", { path: "/chat_channels/:channelName" }); }); } diff --git a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-by-name.js b/plugins/chat/assets/javascripts/discourse/routes/chat-channel-by-name.js deleted file mode 100644 index ba6c91c245e..00000000000 --- a/plugins/chat/assets/javascripts/discourse/routes/chat-channel-by-name.js +++ /dev/null @@ -1,28 +0,0 @@ -import DiscourseRoute from "discourse/routes/discourse"; -import { defaultHomepage } from "discourse/lib/utilities"; -import { ajax } from "discourse/lib/ajax"; -import { inject as service } from "@ember/service"; - -export default class ChatChannelByNameRoute extends DiscourseRoute { - @service chat; - - async model(params) { - return ajax( - `/chat/chat_channels/${encodeURIComponent(params.channelName)}.json` - ) - .then((response) => { - this.transitionTo( - "chat.channel", - response.channel.id, - response.channel.title - ); - }) - .catch(() => this.replaceWith("/404")); - } - - beforeModel() { - if (!this.chat.userCanChat) { - return this.transitionTo(`discovery.${defaultHomepage()}`); - } - } -} diff --git a/plugins/chat/plugin.rb b/plugins/chat/plugin.rb index dd379b2152e..ba5e2d29171 100644 --- a/plugins/chat/plugin.rb +++ b/plugins/chat/plugin.rb @@ -627,12 +627,6 @@ after_initialize do # incoming_webhooks_controller routes post "/hooks/:key/slack" => "incoming_chat_webhooks#create_message_slack_compatible" - # chat_channel_controller routes - get "/chat_channels" => "chat_channels#index" - post "/chat_channels/:chat_channel_id/notification_settings" => - "chat_channels#notification_settings" - get "/chat_channels/:chat_channel_id" => "chat_channels#show" - # chat_controller routes get "/" => "chat#respond" get "/browse" => "chat#respond"