From 3eb6fc058abd746dd47c5e80ab9db4321e0ff623 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Wed, 22 May 2024 11:34:12 +1000 Subject: [PATCH] FEATURE: Use the new plugin show route from the plugin list (#27097) Followup 4e7a75a7ece3205ce9f3f188b5e016bf75a869c0 Several plugins (Gamification, AI) now use the new plugin show route. Any plugins that are using it can now redirect to this page via the Settings button in the plugin list, rather than taking the user to the old site settings page filtered by category. --- .../components/admin-plugins-list-item.gjs | 18 +++++- .../admin/addon/models/admin-plugin.js | 4 ++ .../admin-plugins-list-item-test.js | 59 +++++++++++++++++++ .../stylesheets/common/admin/plugins.scss | 4 ++ 4 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 app/assets/javascripts/discourse/tests/integration/components/admin-plugins-list-item-test.js diff --git a/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs b/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs index 422c92ff82a..04685b07dde 100644 --- a/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs +++ b/app/assets/javascripts/admin/addon/components/admin-plugins-list-item.gjs @@ -38,6 +38,10 @@ export default class AdminPluginsListItem extends Component { return this.args.plugin.nameTitleizedLower.match(this.sidebarState.filter); } + get showPluginSettingsButton() { + return this.currentUser.admin && this.args.plugin.hasSettings; + } +