DEV: Resolve router deprecation and only load assets for admin (#180)

This commit is contained in:
David Taylor 2023-11-27 12:45:21 +00:00 committed by GitHub
parent 3860d82625
commit bd9bf836ad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
28 changed files with 8 additions and 2 deletions

View File

@ -1,9 +1,12 @@
import DiscourseRoute from "discourse/routes/discourse";
import { inject as service } from "@ember/service";
export default class AdminPluginsChatIntegrationIndex extends DiscourseRoute {
@service router;
afterModel(model) {
if (model.totalRows > 0) {
this.transitionTo(
this.router.transitionTo(
"adminPlugins.chat-integration.provider",
model.get("firstObject").name
);

View File

@ -1,14 +1,17 @@
import DiscourseRoute from "discourse/routes/discourse";
import { action } from "@ember/object";
import { inject as service } from "@ember/service";
export default class AdminPluginsChatIntegration extends DiscourseRoute {
@service router;
model() {
return this.store.findAll("provider");
}
@action
showSettings() {
this.transitionTo("adminSiteSettingsCategory", "plugins", {
this.router.transitionTo("adminSiteSettingsCategory", "plugins", {
queryParams: { filter: "chat_integration" },
});
}