59 lines
1.8 KiB
JavaScript
Raw Normal View History

// NOTE TO PLUGINS DEVELOPERS:
// If you modify this file by adding new options to the plugin entry point
// Here's the file: strapi/docs/3.0.0-beta.x/plugin-development/frontend-field-api.md
// Here's the file: strapi/docs/3.0.0-beta.x/guides/registering-a-field-in-admin.md
// 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
2019-04-16 18:23:26 +02:00
import pluginPkg from '../../package.json';
import pluginLogo from './assets/images/logo.svg';
2020-02-13 09:01:32 +01:00
import App from './containers/App';
import SettingsPage from './containers/SettingsPage';
import InputMedia from './components/InputMedia';
import trads from './translations';
2019-04-18 01:10:38 +02:00
import pluginId from './pluginId';
import getTrad from './utils/getTrad';
2019-04-16 18:23:26 +02:00
export default strapi => {
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
const plugin = {
blockerComponent: null,
blockerComponentProps: {},
description: pluginDescription,
icon: pluginPkg.strapi.icon,
id: pluginId,
initializer: null,
injectedComponents: [],
isReady: true,
isRequired: pluginPkg.strapi.required || false,
layout: null,
lifecycles: null,
leftMenuLinks: [],
leftMenuSections: [],
2020-02-13 09:01:32 +01:00
mainComponent: App,
name: pluginPkg.strapi.name,
pluginLogo,
preventComponentRendering: false,
settings: {
global: [
{
title: {
id: getTrad('plugin.name'),
defaultMessage: 'Media Library',
},
name: 'media-library',
to: `${strapi.settingsBaseURL}/media-library`,
// TODO
Component: SettingsPage,
},
],
},
trads,
};
2019-04-16 18:23:26 +02:00
strapi.registerField({ type: 'media', Component: InputMedia });
return strapi.registerPlugin(plugin);
2019-04-16 18:23:26 +02:00
};