From ff38e92e111d64a612aec79ad7ae293c4f15eec3 Mon Sep 17 00:00:00 2001 From: Marco Fincato Date: Thu, 19 Mar 2026 18:28:42 +0100 Subject: [PATCH 1/2] feat: move settings section --- admin/src/index.js | 37 +++++++++++++++++++++++-------------- server/bootstrap.js | 5 +++-- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/admin/src/index.js b/admin/src/index.js index 3924897..28ed692 100644 --- a/admin/src/index.js +++ b/admin/src/index.js @@ -2,24 +2,11 @@ import { getTranslation } from './utils/getTranslation'; import pluginPkg from '../../package.json'; import pluginId from './pluginId'; import Initializer from './components/Initializer'; -import PluginIcon from './components/PluginIcon'; const name = pluginPkg.strapi.displayName; export default { register(app) { - app.addMenuLink({ - to: `/plugins/${pluginId}`, - icon: PluginIcon, - intlLabel: { - id: `${pluginId}.plugin.name`, - defaultMessage: name, - }, - Component: async () => { - return await import('./pages/App'); - }, - permissions: [{ action: 'plugin::strapi-plugin-sso.read', subject: null }] - }); app.registerPlugin({ id: pluginId, initializer: Initializer, @@ -27,7 +14,29 @@ export default { }); }, - bootstrap(app) {}, + bootstrap({ addSettingsLink }) { + addSettingsLink( + { + id: pluginId, + intlLabel: { + id: `${pluginId}.plugin.name`, + defaultMessage: 'Single Sign On', + }, + links: [ + { + intlLabel: { + id: `${pluginId}.settings.configuration`, + defaultMessage: 'Configuration', + }, + id: `${pluginId}-configuration`, + to: `/settings/${pluginId}`, + Component: () => import('./pages/HomePage'), + permissions: [{ action: 'plugin::strapi-plugin-sso.read', subject: null }], + }, + ], + } + ); + }, async registerTrads({ locales }) { const importedTrads = await Promise.all( locales.map(locale => { diff --git a/server/bootstrap.js b/server/bootstrap.js index 5ca7231..ad9221b 100644 --- a/server/bootstrap.js +++ b/server/bootstrap.js @@ -1,8 +1,9 @@ export default async ({strapi}) => { const actions = [ { - section: 'plugins', - displayName: 'Read', + section: 'settings', + category: 'single sign on', + displayName: 'Access the SSO settings page', uid: 'read', pluginName: 'strapi-plugin-sso', }, From 98ac87cf756b2852e5d84903837efa2177304d0e Mon Sep 17 00:00:00 2001 From: Marco Fincato Date: Thu, 2 Apr 2026 18:22:29 +0200 Subject: [PATCH 2/2] fix: role changes confirmation Fixes a problem in the error modal, where onClose wasn't populated. Also fixes the role controller to always have a body, to avoid erroring out on empty json response. --- admin/src/components/AlertMessage/index.jsx | 4 ++-- server/controllers/role.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/admin/src/components/AlertMessage/index.jsx b/admin/src/components/AlertMessage/index.jsx index b78ffbe..2ccf905 100644 --- a/admin/src/components/AlertMessage/index.jsx +++ b/admin/src/components/AlertMessage/index.jsx @@ -32,7 +32,7 @@ export function SuccessAlertMessage({onClose}) { ) } -export function ErrorAlertMessage() { +export function ErrorAlertMessage({onClose}) { const {formatMessage} = useIntl(); return ( @@ -49,4 +49,4 @@ export function ErrorAlertMessage() { ) -} \ No newline at end of file +} diff --git a/server/controllers/role.js b/server/controllers/role.js index f2a642a..1ede215 100644 --- a/server/controllers/role.js +++ b/server/controllers/role.js @@ -17,7 +17,7 @@ async function update(ctx) { const {roles} = ctx.request.body const roleService = strapi.plugin('strapi-plugin-sso').service('role') await roleService.update(roles) - ctx.send({}, 204) + ctx.send({ ok: true }) } catch (e) { console.log(e) ctx.send({}, 400)