mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Remove deprecated plugin config nav mode option (#31157)
In #31012 we deprecated this nav mode option when registering a plugin in a backwards compatible way. We have now removed its use in all relevant plugins and should be ready to completely remove it from core.
This commit is contained in:
parent
5ccd6391d8
commit
f01c0c9740
@ -1,5 +1,3 @@
|
||||
export const PLUGIN_NAV_MODE_SIDEBAR = "sidebar";
|
||||
export const PLUGIN_NAV_MODE_TOP = "top";
|
||||
let pluginConfigNav = {};
|
||||
export function registerAdminPluginConfigNav(pluginId, links) {
|
||||
pluginConfigNav[pluginId] = { links };
|
||||
|
@ -55,11 +55,7 @@ import {
|
||||
import { addUsernameSelectorDecorator } from "discourse/helpers/decorate-username-selector";
|
||||
import { registerCustomAvatarHelper } from "discourse/helpers/user-avatar";
|
||||
import { addBeforeAuthCompleteCallback } from "discourse/instance-initializers/auth-complete";
|
||||
import {
|
||||
PLUGIN_NAV_MODE_SIDEBAR,
|
||||
PLUGIN_NAV_MODE_TOP,
|
||||
registerAdminPluginConfigNav,
|
||||
} from "discourse/lib/admin-plugin-config-nav";
|
||||
import { registerAdminPluginConfigNav } from "discourse/lib/admin-plugin-config-nav";
|
||||
import { registerPluginHeaderActionComponent } from "discourse/lib/admin-plugin-header-actions";
|
||||
import { registerReportModeComponent } from "discourse/lib/admin-report-additional-modes";
|
||||
import classPrepend, {
|
||||
@ -3256,24 +3252,15 @@ class PluginApi {
|
||||
*
|
||||
* * route
|
||||
* * label OR text
|
||||
*
|
||||
* And the mode must be one of "sidebar" or "top", which controls
|
||||
* where in the admin plugin show UI the links will be displayed.
|
||||
*/
|
||||
addAdminPluginConfigurationNav(pluginId, ...links) {
|
||||
addAdminPluginConfigurationNav(pluginId, links) {
|
||||
if (!pluginId) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(consolePrefix(), "A pluginId must be provided!");
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO (Ted - 2024-01-27): Remove once usage discontinued in plugins.
|
||||
const validModes = [PLUGIN_NAV_MODE_SIDEBAR, PLUGIN_NAV_MODE_TOP];
|
||||
if (validModes.includes(links[0])) {
|
||||
links.shift();
|
||||
}
|
||||
|
||||
registerAdminPluginConfigNav(pluginId, links.flat());
|
||||
registerAdminPluginConfigNav(pluginId, links);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user