mirror of
https://github.com/discourse/discourse.git
synced 2025-05-30 04:18:27 +08:00
FEATURE: Convert chat plugin UI to new show plugin and admin UI guidelines (#28632)
This commit converts the current chat plugin UI into the new "show plugin" UI already followed by AI and Gamification. In the process, I also: * Made a dedicated /new route to create new webhooks * Converted the webhook form to FormKit * Made some fixes and improvements to the `AdminPluginConfigPage`, `AdminPageHeader`, and `AdminPageSubheader` generic components, so more plugins can adopt the UI guidelines too. This includes adding a header outlet so plugins can add action buttons to the plugin show page header. * Fixes the submit button loading state for FormKit (by Joffrey) --------- Co-authored-by: Joffrey JAFFEUX <j.jaffeux@gmail.com>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
# name: chat
|
||||
# about: Adds chat functionality.
|
||||
# about: Adds chat functionality to your site so it can natively support both long-form and short-form communication needs of your online community.
|
||||
# meta_topic_id: 230881
|
||||
# version: 0.4
|
||||
# authors: Kane York, Mark VanLandingham, Martin Brennan, Joffrey Jaffeux
|
||||
@ -27,7 +27,7 @@ register_svg_icon "file-image"
|
||||
register_svg_icon "stop-circle"
|
||||
|
||||
# route: /admin/plugins/chat
|
||||
add_admin_route "chat.admin.title", "chat"
|
||||
add_admin_route "chat.admin.title", "chat", use_new_show_route: true
|
||||
|
||||
GlobalSetting.add_default(:allow_unsecure_chat_uploads, false)
|
||||
|
||||
@ -443,6 +443,11 @@ after_initialize do
|
||||
put "/admin/plugins/chat/hooks/:incoming_chat_webhook_id" =>
|
||||
"chat/admin/incoming_webhooks#update",
|
||||
:constraints => StaffConstraint.new
|
||||
get "/admin/plugins/chat/hooks/new" => "chat/admin/incoming_webhooks#new",
|
||||
:constraints => StaffConstraint.new
|
||||
get "/admin/plugins/chat/hooks/:incoming_chat_webhook_id" =>
|
||||
"chat/admin/incoming_webhooks#show",
|
||||
:constraints => StaffConstraint.new
|
||||
delete "/admin/plugins/chat/hooks/:incoming_chat_webhook_id" =>
|
||||
"chat/admin/incoming_webhooks#destroy",
|
||||
:constraints => StaffConstraint.new
|
||||
|
Reference in New Issue
Block a user