mirror of
https://github.com/discourse/discourse.git
synced 2025-01-16 07:52:41 +08:00
6740a340ca
The chat emoji picker is renamed emoji-picker, and the old emoji-picker is removed. This commit doesn't attempt to fully rework a new emoji-picker but instead tries to migrate everything to one picker (the chat one) and add small changes. Other notable changes: - all the favorite emojis code has been mixed into one service which is able to store one state per context, favorites emojis will be stored for all topics, and for each chat channel. Meaning that if you always use a specific emoji in a channel, it will only show as favorite emoji in this channel. - a lot of static code has been removed which should improve initial load perf of discourse. Initially this code was around to improve the performance of the emoji picker rendering. - the emojis are now stored, once the full list has been loaded, if you close and reopen the picker it won't have to load them again. List of components: - `<EmojiPicker />` will render a button which will open a dropdown - `<EmojiPickerContent />` represents the content of the dropdown alone, it's useful when you want to render a picker from an action which is not the default picker button - `<EmojiPickerDetached />` just a simple wrapper over `<EmojiPickerContent />` to make it easier to use it with `this.menu.show(...)` --------- Co-authored-by: Renato Atilio <renatoat@gmail.com>
117 lines
5.7 KiB
Ruby
117 lines
5.7 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
Chat::Engine.routes.draw do
|
|
namespace :api, defaults: { format: :json } do
|
|
get "/chatables" => "chatables#index"
|
|
get "/channels" => "channels#index"
|
|
get "/me/channels" => "current_user_channels#index"
|
|
get "/me/threads" => "current_user_threads#index"
|
|
post "/channels" => "channels#create"
|
|
put "/channels/read" => "channels_read#update_all"
|
|
put "/channels/:channel_id/read" => "channels_read#update"
|
|
post "/channels/:channel_id/messages/:message_id/flags" => "channels_messages_flags#create"
|
|
post "/channels/:channel_id/drafts" => "channels_drafts#create"
|
|
post "/channels/:channel_id/messages/:message_id/interactions" =>
|
|
"channels_messages_interactions#create"
|
|
delete "/channels/:channel_id" => "channels#destroy"
|
|
put "/channels/:channel_id" => "channels#update"
|
|
get "/channels/:channel_id" => "channels#show"
|
|
put "/channels/:channel_id/status" => "channels_status#update"
|
|
get "/channels/:channel_id/messages" => "channel_messages#index"
|
|
put "/channels/:channel_id/messages/:message_id" => "channel_messages#update"
|
|
post "/channels/:channel_id/messages/moves" => "channels_messages_moves#create"
|
|
delete "/channels/:channel_id/messages/:message_id/streaming" =>
|
|
"channels_messages_streaming#destroy"
|
|
post "/channels/:channel_id/invites" => "channels_invites#create"
|
|
post "/channels/:channel_id/archives" => "channels_archives#create"
|
|
get "/channels/:channel_id/memberships" => "channels_memberships#index"
|
|
post "/channels/:channel_id/memberships" => "channels_memberships#create"
|
|
delete "/channels/:channel_id/memberships/me" => "channels_current_user_membership#destroy"
|
|
delete "/channels/:channel_id/memberships/me/follows" =>
|
|
"channels_current_user_membership_follows#destroy"
|
|
put "/channels/:channel_id/memberships/me" => "channels_current_user_membership#update"
|
|
post "/channels/:channel_id/memberships/me" => "channels_current_user_membership#create"
|
|
put "/channels/:channel_id/notifications-settings/me" =>
|
|
"channels_current_user_notifications_settings#update"
|
|
|
|
# Category chatables controller hints. Only used by staff members, we don't want to leak category permissions.
|
|
get "/category-chatables/:id/permissions" => "category_chatables#permissions",
|
|
:format => :json,
|
|
:constraints => StaffConstraint.new
|
|
|
|
# Hints for JIT warnings.
|
|
get "/mentions/groups" => "hints#check_group_mentions", :format => :json
|
|
|
|
get "/channels/:channel_id/threads" => "channel_threads#index"
|
|
post "/channels/:channel_id/threads" => "channel_threads#create"
|
|
put "/channels/:channel_id/threads/:thread_id" => "channel_threads#update"
|
|
get "/channels/:channel_id/threads/:thread_id" => "channel_threads#show"
|
|
get "/channels/:channel_id/threads/:thread_id/messages" => "channel_thread_messages#index"
|
|
put "/channels/:channel_id/threads/:thread_id/read" => "channels_threads_read#update"
|
|
post "/channels/:channel_id/threads/:thread_id/drafts" => "channels_threads_drafts#create"
|
|
put "/channels/:channel_id/threads/:thread_id/notifications-settings/me" =>
|
|
"channel_threads_current_user_notifications_settings#update"
|
|
post "/channels/:channel_id/threads/:thread_id/mark-thread-title-prompt-seen/me" =>
|
|
"channel_threads_current_user_title_prompt_seen#update"
|
|
post "/direct-message-channels" => "direct_messages#create"
|
|
|
|
put "/channels/:channel_id/messages/:message_id/restore" => "channel_messages#restore"
|
|
delete "/channels/:channel_id/messages/:message_id" => "channel_messages#destroy"
|
|
delete "/channels/:channel_id/messages" => "channel_messages#bulk_destroy"
|
|
end
|
|
|
|
namespace :admin, defaults: { format: :json, constraints: StaffConstraint.new } do
|
|
post "export/messages" => "export#export_messages"
|
|
end
|
|
|
|
# direct_messages_controller routes
|
|
get "/direct_messages" => "direct_messages#index"
|
|
|
|
# incoming_webhooks_controller routes
|
|
post "/hooks/:key" => "incoming_webhooks#create_message"
|
|
|
|
# incoming_webhooks_controller routes
|
|
post "/hooks/:key/slack" => "incoming_webhooks#create_message_slack_compatible"
|
|
|
|
# chat_controller routes
|
|
get "/" => "chat#respond"
|
|
get "/new-message" => "chat#respond"
|
|
get "/direct-messages" => "chat#respond"
|
|
get "/channels" => "chat#respond"
|
|
get "/threads" => "chat#respond"
|
|
get "/browse" => "chat#respond"
|
|
get "/browse/all" => "chat#respond"
|
|
get "/browse/closed" => "chat#respond"
|
|
get "/browse/open" => "chat#respond"
|
|
get "/browse/archived" => "chat#respond"
|
|
post "/dismiss-retention-reminder" => "chat#dismiss_retention_reminder"
|
|
put ":chat_channel_id/react/:message_id" => "chat#react"
|
|
put "/:chat_channel_id/:message_id/rebake" => "chat#rebake"
|
|
post "/:chat_channel_id/quote" => "chat#quote_messages"
|
|
put "/user_chat_enabled/:user_id" => "chat#set_user_chat_status"
|
|
post "/:chat_channel_id" => "api/channel_messages#create"
|
|
|
|
base_c_route = "/c/:channel_title/:channel_id"
|
|
get base_c_route => "chat#respond", :as => "channel"
|
|
get "#{base_c_route}/:message_id" => "chat#respond"
|
|
|
|
%w[info info/about info/members info/settings].each do |route|
|
|
get "#{base_c_route}/#{route}" => "chat#respond"
|
|
end
|
|
|
|
# /channel -> /c redirects
|
|
get "/channel/:channel_id", to: redirect("/chat/c/-/%{channel_id}")
|
|
|
|
get "#{base_c_route}/t/:thread_id" => "chat#respond"
|
|
get "#{base_c_route}/t/:thread_id/:message_id" => "chat#respond"
|
|
|
|
base_channel_route = "/channel/:channel_id/:channel_title"
|
|
redirect_base = "/chat/c/%{channel_title}/%{channel_id}"
|
|
|
|
get base_channel_route, to: redirect(redirect_base)
|
|
|
|
%w[info info/about info/members info/settings].each do |route|
|
|
get "#{base_channel_route}/#{route}", to: redirect("#{redirect_base}/#{route}")
|
|
end
|
|
end
|