mirror of
https://github.com/discourse/discourse.git
synced 2024-12-03 04:13:39 +08:00
011ba5b9f6
Per https://deprecations.emberjs.com/v3.x/#toc_routing-transition-methods We are upgrading all `this.transitionTo` calls on routes to directly call the router service (`this.router.transitionTo`)
29 lines
851 B
JavaScript
29 lines
851 B
JavaScript
import { action } from "@ember/object";
|
|
import Route from "@ember/routing/route";
|
|
import { inject as service } from "@ember/service";
|
|
|
|
export default class AdminPluginsRoute extends Route {
|
|
@service router;
|
|
|
|
model() {
|
|
return this.store.findAll("plugin");
|
|
}
|
|
|
|
@action
|
|
showSettings(plugin) {
|
|
const controller = this.controllerFor("adminSiteSettings");
|
|
this.router
|
|
.transitionTo("adminSiteSettingsCategory", "plugins")
|
|
.then(() => {
|
|
if (plugin) {
|
|
// filterContent() is normally on a debounce from typing.
|
|
// Because we don't want the default of "All Results", we tell it
|
|
// to skip the next debounce.
|
|
controller.set("filter", `plugin:${plugin.id}`);
|
|
controller.set("_skipBounce", true);
|
|
controller.filterContentNow("plugins");
|
|
}
|
|
});
|
|
}
|
|
}
|