2023-03-15 09:17:51 -04:00
|
|
|
import { action } from "@ember/object";
|
2019-10-23 12:39:32 -04:00
|
|
|
import Route from "@ember/routing/route";
|
2023-07-18 15:52:55 -04:00
|
|
|
import { inject as service } from "@ember/service";
|
2023-03-15 09:17:51 -04:00
|
|
|
|
|
|
|
export default class AdminPluginsRoute extends Route {
|
2023-07-18 15:52:55 -04:00
|
|
|
@service router;
|
|
|
|
|
2015-02-06 17:32:59 -05:00
|
|
|
model() {
|
2015-02-10 12:14:23 -05:00
|
|
|
return this.store.findAll("plugin");
|
2023-03-15 09:17:51 -04:00
|
|
|
}
|
2015-02-06 17:32:59 -05:00
|
|
|
|
2023-03-15 09:17:51 -04:00
|
|
|
@action
|
|
|
|
showSettings(plugin) {
|
|
|
|
const controller = this.controllerFor("adminSiteSettings");
|
2023-07-18 15:52:55 -04:00
|
|
|
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");
|
|
|
|
}
|
|
|
|
});
|
2023-03-15 09:17:51 -04:00
|
|
|
}
|
|
|
|
}
|