diff --git a/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes.md b/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes.md index 4c5a40931d..34fb94096c 100644 --- a/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes.md +++ b/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes.md @@ -50,14 +50,15 @@ This page lists all the breaking changes introduced in Strapi 5. - [Only the `better-sqlite3` package is supported for the SQLite client](/dev-docs/migration/v4-to-v5/breaking-changes/only-better-sqlite3-for-sqlite) - [Only the `mysql2` package is supported for the MySQL client](/dev-docs/migration/v4-to-v5/breaking-changes/only-mysql2-package-for-mysql) -## Plugins and providers +## Plugins, providers, and admin panel customization - [Users & Permissions `register.allowedFields` defaults to `[]`](/dev-docs/migration/v4-to-v5/breaking-changes/register-allowed-fields) - [The `helper-plugin` is deprecated](/dev-docs/migration/v4-to-v5/breaking-changes/helper-plugin-deprecated) - [`injectContentManagerComponent()` is removed in favor of `getPlugin('content-manager').injectComponent()`](/dev-docs/migration/v4-to-v5/breaking-changes/inject-content-manager-component) - [Some Mailgun provider legacy variables are not supported](/dev-docs/migration/v4-to-v5/breaking-changes/mailgun-provider-variables) +- [The `lockIcon` property has been replaced by `licenseOnly`](/dev-docs/migration/v4-to-v5/breaking-changes/license-only) -## Strapi objects, methods, and packages +## Strapi objects, methods, packages, and back-end customization - [`strapi.fetch` uses the native `fetch()` API](/dev-docs/migration/v4-to-v5/breaking-changes/fetch) - [strapi factories import have changed](/dev-docs/migration/v4-to-v5/breaking-changes/strapi-imports) @@ -65,6 +66,7 @@ This page lists all the breaking changes introduced in Strapi 5. - [The `isSupportedImage` method is removed in Strapi 5](/dev-docs/migration/v4-to-v5/breaking-changes/is-supported-image-removed) - [`strapi-utils` has been refactored](/dev-docs/migration/v4-to-v5/breaking-changes/strapi-utils-refactored) - [Core service methods use the Document Service API](/dev-docs/migration/v4-to-v5/breaking-changes/core-service-methods-use-document-service) +* [i18n is now part of the strapi core](/dev-docs/migration/v4-to-v5/breaking-changes/i18n-content-manager-locale) ## Content Manager @@ -79,9 +81,3 @@ This page lists all the breaking changes introduced in Strapi 5. - [Strapi 5 uses `koa-body` v6](/dev-docs/migration/v4-to-v5/breaking-changes/koa-body-v6) - [Webpack Aliases are removed in Strapi 5](/dev-docs/migration/v4-to-v5/breaking-changes/webpack-aliases-removed) - [Apollo Server v3 upgraded to Apollo Server v4](/dev-docs/migration/v4-to-v5/breaking-changes/upgrade-to-apollov4) - -## Internal changes - -The following changes should only affect users who deeply customize Strapi. - -* [i18n is now part of the strapi core](/dev-docs/migration/v4-to-v5/breaking-changes/i18n-content-manager-locale) diff --git a/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes/license-only.md b/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes/license-only.md new file mode 100644 index 0000000000..8d709ae13f --- /dev/null +++ b/docusaurus/docs/dev-docs/migration/v4-to-v5/breaking-changes/license-only.md @@ -0,0 +1,66 @@ +--- +title: lockIcon replaced by licenseOnly +description: In Strapi 5, +sidebar_label: lockIcon replaced by licenseOnly +displayed_sidebar: devDocsMigrationV5Sidebar +tags: + - breaking changes + - plugins development + - admin panel API +--- + +import Intro from '/docs/snippets/breaking-change-page-intro.md' +import MigrationIntro from '/docs/snippets/breaking-change-page-migration-intro.md' +import YesPlugins from '/docs/snippets/breaking-change-affecting-plugins.md' +import NoCodemods from '/docs/snippets/breaking-change-not-handled-by-codemod.md' + +# `lockIcon` property replaced by `licenseOnly` + +Strapi 5 adds a new `licenseOnly` boolean property to pass in the `addMenuLink`, in the `addSettingsLink` and in the `addSettingsLinks` actions. Adding this property shows a lightning ⚡️ icon near the link, and indicates paid features. + +A similar result can be achieved in Strapi v4 by adding the `lockIcon` property. + + + + + + +## Breaking change description + + + + + +**In Strapi v4** + +* The `lockIcon` property is used in the `addMenuLink()`, `addSettingsLink`, and `addSettingsLinks()` methods of the Admin Panel API. +* The property adds a lock icon. + + + + + +**In Strapi 5** + +* The `licenseOnly` property is used in the `addMenuLink()`, `addSettingsLink`, and `addSettingsLinks()` methods of the Admin Panel API. +* The property adds a lightning icon ⚡️. + + + + + +## Migration + +### Notes + +* Passing `licenseOnly: true` will add a lightning icon ⚡️, so that: + + - a menu icon will look like the following: ![](/img/assets/plugins/lightning-icon-menu.png) + + - a settings menu item will look like the following: ![](/img/assets/plugins/lightning-icon-settings.png) + +* Additional information and examples on how to use the `licenseOnly` property can be found in the [`addMenuLink()`](/dev-docs/plugins/admin-panel-api#menu-api), [`addSettingsLink()`](/dev-docs/plugins/admin-panel-api#addsettingslink), and [`addSettingsLinks()`](/dev-docs/plugins/admin-panel-api#addsettingslinks) methods sections of the Admin Panel API documentation. + +### Manual migration + +If your custom Strapi v4 code uses the `lockIcon` property to highlight a paid feature that requires an license, search and replace `lockIcon: true` by `licenseOnly: true`. diff --git a/docusaurus/docs/dev-docs/plugins/admin-panel-api.md b/docusaurus/docs/dev-docs/plugins/admin-panel-api.md index c5108dee4c..d03ea7bfd8 100644 --- a/docusaurus/docs/dev-docs/plugins/admin-panel-api.md +++ b/docusaurus/docs/dev-docs/plugins/admin-panel-api.md @@ -202,6 +202,7 @@ The Admin Panel API allows a plugin to take advantage of several small APIs to p | Inject a Component in an injection zone | [Injection Zones API](#injection-zones-api) | [`injectComponent()`](#injection-zones-api) | [`bootstrap()`](#register) | | Register a hook | [Hooks API](#hooks-api) | [`registerHook()`](#hooks-api) | [`bootstrap()`](#bootstrap) | + :::tip Replacing the WYSIWYG The WYSIWYG editor can be replaced by taking advantage of [custom fields](/dev-docs/custom-fields), for instance using the [CKEditor custom field plugin](https://market.strapi.io/plugins/@ckeditor-strapi-plugin-ckeditor). ::: @@ -223,6 +224,8 @@ The Menu API allows a plugin to add a new link to the main navigation through th | `intlLabel` | Object | Label for the link, following the [React Int'l](https://formatjs.io/docs/react-intl) convention, with:
  • `id`: id used to insert the localized label
  • `defaultMessage`: default label for the link
| | `Component` | Async function | Returns a dynamic import of the plugin entry point | | `permissions` | Array of Objects | Permissions declared in the `permissions.js` file of the plugin | +| `position` | Integer | Position in the menu | +| `licenseOnly` | Boolean | If set to `true`, adds a lightning ⚡️ icon next to the icon or menu entry to indicate that the feature or plugin requires a paid license.
(Defaults to `false`) | :::note `intlLabel.id` are ids used in translation files (`[plugin-name]/admin/src/translations/[language].json`) @@ -244,6 +247,8 @@ export default { }, Component: () => 'My plugin', permissions: [], // permissions to apply to the link + position: 3, // position in the menu + licenseOnly: true, // mark the feature as a paid one not available in your license }); app.registerPlugin({ ... }); }, @@ -271,6 +276,7 @@ All functions accept links as objects with the following parameters: | `intlLabel` | Object | Label for the link, following the [React Int'l](https://formatjs.io/docs/react-intl) convention, with:
  • `id`: id used to insert the localized label
  • `defaultMessage`: default label for the link
| | `Component` | Async function | Returns a dynamic import of the plugin entry point | | `permissions` | Array of Objects | Permissions declared in the `permissions.js` file of the plugin | +| `licenseOnly` | Boolean | If set to `true`, adds a lightning ⚡️ icon next to the icon or menu entry to indicate that the feature or plugin requires a paid license.
(Defaults to `false`) | #### createSettingSection() @@ -348,7 +354,8 @@ export default { id: String, to: String, Component: myComponent, - permissions: Object[] + permissions: Object[], + licenseOnly: true, // mark the feature as a paid one not available in your license } ) } @@ -383,7 +390,8 @@ export default { id: String, to: String, Component: myComponent, - permissions: Object[] + permissions: Object[], + licenseOnly: true, // mark the feature as a paid one not available in your license }] ) } diff --git a/docusaurus/sidebars.js b/docusaurus/sidebars.js index 47b881b2a6..22f03e0166 100644 --- a/docusaurus/sidebars.js +++ b/docusaurus/sidebars.js @@ -1192,7 +1192,7 @@ const sidebars = { { type: "category", collapsed: false, - label: "Plugins and providers", + label: "Plugins, providers, and admin panel customization", link: { type: 'doc', id: "dev-docs/migration/v4-to-v5/breaking-changes" @@ -1202,11 +1202,12 @@ const sidebars = { 'dev-docs/migration/v4-to-v5/breaking-changes/helper-plugin-deprecated', 'dev-docs/migration/v4-to-v5/breaking-changes/inject-content-manager-component', 'dev-docs/migration/v4-to-v5/breaking-changes/mailgun-provider-variables', + 'dev-docs/migration/v4-to-v5/breaking-changes/license-only', ] }, { type: "category", - label: "Strapi objects, methods, and packages", + label: "Strapi objects, methods, packages, and back-end cutomization", collapsed: false, items: [ 'dev-docs/migration/v4-to-v5/breaking-changes/fetch', @@ -1215,6 +1216,7 @@ const sidebars = { 'dev-docs/migration/v4-to-v5/breaking-changes/strapi-utils-refactored', // 'dev-docs/migration/v4-to-v5/breaking-changes/strapi-container', // might change 'dev-docs/migration/v4-to-v5/breaking-changes/core-service-methods-use-document-service', + 'dev-docs/migration/v4-to-v5/breaking-changes/i18n-content-manager-locale', ] }, { @@ -1243,14 +1245,6 @@ const sidebars = { 'dev-docs/migration/v4-to-v5/breaking-changes/upgrade-to-apollov4', ] }, - { - type: "category", - label: "Internal changes", - collapsed: false, - items: [ - 'dev-docs/migration/v4-to-v5/breaking-changes/i18n-content-manager-locale', - ] - }, ] }, { diff --git a/docusaurus/static/img/assets/plugins/lightning-icon-menu.png b/docusaurus/static/img/assets/plugins/lightning-icon-menu.png new file mode 100644 index 0000000000..c4568ae9b7 Binary files /dev/null and b/docusaurus/static/img/assets/plugins/lightning-icon-menu.png differ diff --git a/docusaurus/static/img/assets/plugins/lightning-icon-settings.png b/docusaurus/static/img/assets/plugins/lightning-icon-settings.png new file mode 100644 index 0000000000..bf87ede203 Binary files /dev/null and b/docusaurus/static/img/assets/plugins/lightning-icon-settings.png differ