Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,23 @@ 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)
<!-- - [`Strapi` is a subclass of `Container`](/dev-docs/migration/v4-to-v5/breaking-changes/strapi-container) might change -->
- [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

Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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.

<Intro />

<YesPlugins />
<NoCodemods />

## Breaking change description

<SideBySideContainer>

<SideBySideColumn>

**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.

</SideBySideColumn>

<SideBySideColumn>

**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 ⚡️.

</SideBySideColumn>

</SideBySideContainer>

## 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 <EnterpriseBadge /> license, search and replace `lockIcon: true` by `licenseOnly: true`.
12 changes: 10 additions & 2 deletions docusaurus/docs/dev-docs/plugins/admin-panel-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
:::
Expand All @@ -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:<ul><li>`id`: id used to insert the localized label</li><li>`defaultMessage`: default label for the link</li></ul> |
| `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.<br/>(Defaults to `false`) |

:::note
`intlLabel.id` are ids used in translation files (`[plugin-name]/admin/src/translations/[language].json`)
Expand All @@ -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({ ... });
},
Expand Down Expand Up @@ -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:<ul><li>`id`: id used to insert the localized label</li><li>`defaultMessage`: default label for the link</li></ul> |
| `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.<br/>(Defaults to `false`) |

#### createSettingSection()

Expand Down Expand Up @@ -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
}
)
}
Expand Down Expand Up @@ -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
}]
)
}
Expand Down
14 changes: 4 additions & 10 deletions docusaurus/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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',
Expand All @@ -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',
]
},
{
Expand Down Expand Up @@ -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',
]
},
]
},
{
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.