mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-26 12:37:54 +08:00
This change updates the Automation plugin to make use of the `use_new_show_route` plugin flag, as well as generally updating the UI to match current admin UI guidelines. Notable changes include: - Moving template/router/controller files to make use of the `admin.adminPlugins.show` route. - Changing the URIs from `/admin/plugins/discourse-automation` to `/admin/plugins/automation`, to match the `PLUGIN_NAME`. - Adding UI wrappers around the New/Edit forms, and polishing the list of defined automations.
21 lines
512 B
JavaScript
Vendored
21 lines
512 B
JavaScript
Vendored
import { withPluginApi } from "discourse/lib/plugin-api";
|
|
|
|
export default {
|
|
name: "automation-admin-plugin-configuration-nav",
|
|
|
|
initialize(container) {
|
|
const currentUser = container.lookup("service:current-user");
|
|
if (!currentUser?.admin) {
|
|
return;
|
|
}
|
|
|
|
withPluginApi("1.1.0", (api) => {
|
|
api.addAdminPluginConfigurationNav("automation", [
|
|
{
|
|
label: "discourse_automation.title",
|
|
route: "adminPlugins.show.automation",
|
|
},
|
|
]);
|
|
});
|
|
},
|
|
};
|