DEV: Resolve router deprecation and only load assets for admin (#180)
This commit is contained in:
parent
3860d82625
commit
bd9bf836ad
|
@ -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
|
||||
);
|
|
@ -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" },
|
||||
});
|
||||
}
|
Loading…
Reference in New Issue