discourse/app/assets/javascripts/admin/addon/routes/admin-plugins.js
Martin Brennan 5fc93b95cc
FIX: Improve admin plugin list and modernize code ()
This commit contains a few improvements:

* Use LinkTo instead of a button with a weird action referencing the
  controller to navigate to the filtered settings for a plugin
* Add an AdminPlugin model with tracked properties and use that when
  toggling the setting on/off and in the templates
* Make it so the Settings button for a plugin navigates to the correct
  site setting category instead of always just going to the generic
  "plugins" one if possible
2023-08-28 10:48:59 +10:00

14 lines
367 B
JavaScript

import Route from "@ember/routing/route";
import AdminPlugin from "admin/models/admin-plugin";
import { inject as service } from "@ember/service";
export default class AdminPluginsRoute extends Route {
@service router;
model() {
return this.store
.findAll("plugin")
.then((plugins) => plugins.map((plugin) => AdminPlugin.create(plugin)));
}
}