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/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', }, 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)