2020-03-06 13:33:07 +01:00
|
|
|
// NOTE TO PLUGINS DEVELOPERS:
|
|
|
|
// If you modify this file by adding new options to the plugin entry point
|
2021-03-05 10:37:33 +01:00
|
|
|
// Here's the file: strapi/docs/3.x/plugin-development/frontend-field-api.md
|
|
|
|
// Here's the file: strapi/docs/3.x/guides/registering-a-field-in-admin.md
|
2020-03-06 13:33:07 +01:00
|
|
|
// Also the strapi-generate-plugins/files/admin/src/index.js needs to be updated
|
|
|
|
// IF THE DOC IS NOT UPDATED THE PULL REQUEST WILL NOT BE MERGED
|
|
|
|
|
2021-06-08 09:37:14 +02:00
|
|
|
import React from 'react';
|
|
|
|
import { CheckPagePermissions } from '@strapi/helper-plugin';
|
2019-04-16 16:55:53 +02:00
|
|
|
import pluginPkg from '../../package.json';
|
|
|
|
import pluginId from './pluginId';
|
2020-02-11 17:15:53 +01:00
|
|
|
import pluginLogo from './assets/images/logo.svg';
|
2021-03-05 10:37:33 +01:00
|
|
|
import pluginPermissions from './permissions';
|
2020-05-14 01:54:36 +02:00
|
|
|
import trads from './translations';
|
2021-03-05 10:37:33 +01:00
|
|
|
import getTrad from './utils/getTrad';
|
2021-05-26 14:43:01 +02:00
|
|
|
import SettingsPage from './pages/Settings';
|
2019-04-16 16:55:53 +02:00
|
|
|
|
2021-05-10 14:18:30 +02:00
|
|
|
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
|
|
|
|
const icon = pluginPkg.strapi.icon;
|
|
|
|
const name = pluginPkg.strapi.name;
|
2019-04-16 16:55:53 +02:00
|
|
|
|
2021-05-10 14:18:30 +02:00
|
|
|
export default {
|
|
|
|
register(app) {
|
2021-06-08 09:02:20 +02:00
|
|
|
// Create the email settings section
|
|
|
|
app.createSection(
|
|
|
|
{
|
|
|
|
id: pluginId,
|
|
|
|
intlLabel: { id: getTrad('SettingsNav.section-label'), defaultMessage: 'Email Plugin' },
|
|
|
|
},
|
|
|
|
[
|
|
|
|
{
|
|
|
|
intlLabel: {
|
|
|
|
id: getTrad('SettingsNav.link.settings'),
|
|
|
|
defaultMessage: 'Settings',
|
|
|
|
},
|
|
|
|
id: 'settings',
|
|
|
|
to: `/settings/${pluginId}`,
|
2021-06-08 09:37:14 +02:00
|
|
|
Component: () => (
|
|
|
|
<CheckPagePermissions permissions={pluginPermissions.settings}>
|
|
|
|
<SettingsPage />
|
|
|
|
</CheckPagePermissions>
|
|
|
|
),
|
|
|
|
|
2021-06-08 09:02:20 +02:00
|
|
|
permissions: pluginPermissions.settings,
|
|
|
|
},
|
|
|
|
]
|
|
|
|
);
|
2021-05-10 14:18:30 +02:00
|
|
|
app.registerPlugin({
|
|
|
|
description: pluginDescription,
|
|
|
|
icon,
|
|
|
|
id: pluginId,
|
|
|
|
isReady: true,
|
|
|
|
isRequired: pluginPkg.strapi.required || false,
|
|
|
|
name,
|
|
|
|
pluginLogo,
|
|
|
|
trads,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
boot() {},
|
2019-04-16 16:55:53 +02:00
|
|
|
};
|