FEATURE: filter additional keywords for the sidebar (#26148)

With the new admin sidebar restructure, we have a link to "Installed plugins". We would like to ensure that when the admin is searching for a plugin name like "akismet" or "automation" this link will be visible. Also when entering the plugins page, related plugins should be highlighted.
This commit is contained in:
Krzysztof Kotlarek
2024-03-14 12:28:08 +11:00
committed by GitHub
parent bbb18fa2ce
commit 9afb0b29f8
15 changed files with 150 additions and 44 deletions

View File

@@ -1,5 +1,6 @@
import { tracked } from "@glimmer/tracking";
import { service } from "@ember/service";
import PreloadStore from "discourse/lib/preload-store";
import { ADMIN_PANEL, MAIN_PANEL } from "discourse/lib/sidebar/panels";
import DiscourseRoute from "discourse/routes/discourse";
import I18n from "discourse-i18n";
@@ -7,7 +8,9 @@ import I18n from "discourse-i18n";
export default class AdminRoute extends DiscourseRoute {
@service sidebarState;
@service siteSettings;
@service store;
@service currentUser;
@service adminSidebarStateManager;
@tracked initialSidebarState;
titleToken() {
@@ -24,6 +27,13 @@ export default class AdminRoute extends DiscourseRoute {
this.controllerFor("application").setProperties({
showTop: false,
});
const visiblePlugins = PreloadStore.get("visiblePlugins");
if (visiblePlugins) {
this.adminSidebarStateManager.keywords.admin_installed_plugins = {
navigation: visiblePlugins.mapBy("name"),
};
}
}
deactivate(transition) {