mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 14:35:05 +08:00
DEV: Move admin sidebar out of initializer (#25396)
Having the admin sidebar code in an instance initializer is not ideal because: * It runs during app boot which may not even be necessary based on site settings * It makes it hard for plugins to register additional links in time without resorting to before/after initializer gymnastics This PR moves the admin sidebar into a lib and creates the panel in custom-sections.js, then the sections and links are loaded when the main sidebar component is rendered, which leaves plugins enough time to add additional links in an initializer. --------- Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
import { ADMIN_PANEL, MAIN_PANEL } from "discourse/services/sidebar-state";
|
||||
import { ADMIN_PANEL, MAIN_PANEL } from "discourse/lib/sidebar/panels";
|
||||
import { getUserChatSeparateSidebarMode } from "discourse/plugins/chat/discourse/lib/get-user-chat-separate-sidebar-mode";
|
||||
|
||||
export const CHAT_PANEL = "chat";
|
||||
|
@ -2,9 +2,9 @@ import { tracked } from "@glimmer/tracking";
|
||||
import Service, { inject as service } from "@ember/service";
|
||||
import KeyValueStore from "discourse/lib/key-value-store";
|
||||
import { withPluginApi } from "discourse/lib/plugin-api";
|
||||
import { MAIN_PANEL } from "discourse/lib/sidebar/panels";
|
||||
import { defaultHomepage } from "discourse/lib/utilities";
|
||||
import Site from "discourse/models/site";
|
||||
import { MAIN_PANEL } from "discourse/services/sidebar-state";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import { getUserChatSeparateSidebarMode } from "discourse/plugins/chat/discourse/lib/get-user-chat-separate-sidebar-mode";
|
||||
|
||||
|
Reference in New Issue
Block a user