2019-10-10 11:45:26 +02:00
|
|
|
import pluginPkg from '../../package.json';
|
|
|
|
import pluginId from './pluginId';
|
|
|
|
import App from './containers/App';
|
|
|
|
import Initializer from './containers/Initializer';
|
|
|
|
import lifecycles from './lifecycles';
|
|
|
|
import trads from './translations';
|
|
|
|
|
2020-03-05 17:40:40 +01:00
|
|
|
export default strapi => {
|
|
|
|
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
|
2020-06-09 12:05:59 +02:00
|
|
|
const icon = pluginPkg.strapi.icon;
|
|
|
|
const name = pluginPkg.strapi.name;
|
2019-10-10 11:45:26 +02:00
|
|
|
|
2020-03-05 17:40:40 +01:00
|
|
|
const plugin = {
|
|
|
|
blockerComponent: null,
|
|
|
|
blockerComponentProps: {},
|
|
|
|
description: pluginDescription,
|
2020-06-09 12:05:59 +02:00
|
|
|
icon,
|
2020-03-05 17:40:40 +01:00
|
|
|
id: pluginId,
|
|
|
|
initializer: Initializer,
|
|
|
|
injectedComponents: [],
|
|
|
|
isReady: false,
|
|
|
|
isRequired: pluginPkg.strapi.required || false,
|
|
|
|
layout: null,
|
|
|
|
lifecycles,
|
|
|
|
mainComponent: App,
|
2020-06-09 12:05:59 +02:00
|
|
|
name,
|
2020-03-05 17:40:40 +01:00
|
|
|
preventComponentRendering: false,
|
|
|
|
trads,
|
2020-06-09 12:05:59 +02:00
|
|
|
menu: {
|
|
|
|
pluginsSection: [
|
|
|
|
{
|
|
|
|
destination: `/plugins/${pluginId}`,
|
|
|
|
icon,
|
|
|
|
label: {
|
|
|
|
id: `${pluginId}.plugin.name`,
|
|
|
|
defaultMessage: name,
|
|
|
|
},
|
|
|
|
name,
|
|
|
|
permissions: [
|
|
|
|
// Uncomment to set the permissions of the plugin here
|
|
|
|
// {
|
|
|
|
// action: '', // the action name should be plugins::plugin-name.actionType
|
|
|
|
// subject: null,
|
|
|
|
// },
|
|
|
|
],
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
2020-03-05 17:40:40 +01:00
|
|
|
};
|
2019-10-10 11:45:26 +02:00
|
|
|
|
2020-03-05 17:40:40 +01:00
|
|
|
return strapi.registerPlugin(plugin);
|
2019-10-10 11:45:26 +02:00
|
|
|
};
|