diff --git a/jest.base-config.front.js b/jest.base-config.front.js index bcf8606912..590563c678 100644 --- a/jest.base-config.front.js +++ b/jest.base-config.front.js @@ -51,6 +51,7 @@ module.exports = { '/packages/admin-test-utils/lib/setup/styled-components.js', '/packages/admin-test-utils/lib/setup/strapi.js', ], + testEnvironment: 'jsdom', transform: { '^.+\\.js$': ['@swc/jest', { jsc: { parser: { jsx: true, dynamicImport: true } } }], '\\.(jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': diff --git a/package.json b/package.json index f21d5c367b..50cf473223 100644 --- a/package.json +++ b/package.json @@ -87,9 +87,10 @@ "husky": "3.1.0", "inquirer": "8.2.4", "istanbul": "~0.4.2", - "jest": "26.6.3", - "jest-circus": "26.6.3", - "jest-cli": "26.6.3", + "jest": "29.0.0", + "jest-circus": "29.0.0", + "jest-cli": "29.0.0", + "jest-environment-jsdom": "29.0.0", "jest-watch-typeahead": "0.6.5", "lerna": "5.4.3", "lint-staged": "10.5.4", diff --git a/packages/core/admin/admin/src/content-manager/components/SelectMany/index.js b/packages/core/admin/admin/src/content-manager/components/SelectMany/index.js index 7d8459a89f..a599f6161f 100644 --- a/packages/core/admin/admin/src/content-manager/components/SelectMany/index.js +++ b/packages/core/admin/admin/src/content-manager/components/SelectMany/index.js @@ -17,6 +17,7 @@ function SelectMany({ name, isDisabled, isLoading, + loadingMessage, onInputChange, onMenuClose, onMenuOpen, @@ -61,6 +62,7 @@ function SelectMany({ }} mainField={mainField} isLoading={isLoading} + loadingMessage={loadingMessage} isMulti isSearchable options={options} @@ -119,6 +121,7 @@ SelectMany.propTypes = { displayNavigationLink: PropTypes.bool.isRequired, isDisabled: PropTypes.bool.isRequired, isLoading: PropTypes.bool.isRequired, + loadingMessage: PropTypes.string.isRequired, mainField: PropTypes.shape({ name: PropTypes.string.isRequired, schema: PropTypes.shape({ diff --git a/packages/core/admin/admin/src/content-manager/components/SelectOne/index.js b/packages/core/admin/admin/src/content-manager/components/SelectOne/index.js index 1bb621a9f1..b5986e4697 100644 --- a/packages/core/admin/admin/src/content-manager/components/SelectOne/index.js +++ b/packages/core/admin/admin/src/content-manager/components/SelectOne/index.js @@ -14,6 +14,7 @@ function SelectOne({ name, isDisabled, isLoading, + loadingMessage, onChange, onInputChange, onMenuClose, @@ -37,6 +38,7 @@ function SelectOne({ isClearable isDisabled={isDisabled} isLoading={isLoading} + loadingMessage={loadingMessage} mainField={mainField} options={options} onChange={onChange} @@ -70,6 +72,7 @@ SelectOne.propTypes = { components: PropTypes.object, isDisabled: PropTypes.bool.isRequired, isLoading: PropTypes.bool.isRequired, + loadingMessage: PropTypes.string.isRequired, mainField: PropTypes.shape({ name: PropTypes.string.isRequired, schema: PropTypes.shape({ diff --git a/packages/core/admin/admin/src/content-manager/components/SelectWrapper/index.js b/packages/core/admin/admin/src/content-manager/components/SelectWrapper/index.js index ef5810095b..f72152feb1 100644 --- a/packages/core/admin/admin/src/content-manager/components/SelectWrapper/index.js +++ b/packages/core/admin/admin/src/content-manager/components/SelectWrapper/index.js @@ -282,6 +282,12 @@ function SelectWrapper({ isDisabled={isDisabled} isLoading={isLoading} isClearable + loadingMessage={() => + formatMessage({ + id: getTrad('DynamicTable.relation-loading'), + defaultMessage: 'Relations are loading', + }) + } mainField={mainField} move={moveRelation} name={name} diff --git a/packages/core/admin/package.json b/packages/core/admin/package.json index b53f1a8465..e53bc1e933 100644 --- a/packages/core/admin/package.json +++ b/packages/core/admin/package.json @@ -63,7 +63,7 @@ "bcryptjs": "2.4.3", "chalk": "^4.1.1", "chokidar": "^3.5.1", - "codemirror": "^5.65.6", + "codemirror": "^5.65.8", "cross-env": "^7.0.3", "css-loader": "6.7.1", "date-fns": "2.29.2", diff --git a/packages/core/admin/server/tests/admin-permission.test.e2e.js b/packages/core/admin/server/tests/admin-permission.test.e2e.js index 66b5a1898c..67a9d68f6d 100644 --- a/packages/core/admin/server/tests/admin-permission.test.e2e.js +++ b/packages/core/admin/server/tests/admin-permission.test.e2e.js @@ -37,115 +37,115 @@ describe('Role CRUD End to End', () => { if (edition === 'CE') { expect(sortedData).toMatchInlineSnapshot(` - Object { - "conditions": Array [ - Object { + { + "conditions": [ + { "category": "default", "displayName": "Is creator", "id": "admin::is-creator", }, - Object { + { "category": "default", "displayName": "Has same role as creator", "id": "admin::has-same-role-as-creator", }, ], - "sections": Object { - "collectionTypes": Array [ - Array [ - Object { + "sections": { + "collectionTypes": [ + [ + { "actionId": "plugin::content-manager.explorer.create", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Create", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.read", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Read", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.update", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Update", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.delete", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Delete", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.publish", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Publish", - "subjects": Array [], + "subjects": [], }, ], - Array [ - Object { + [ + { "label": "user", - "properties": Array [ - Object { - "children": Array [ - Object { + "properties": [ + { + "children": [ + { "label": "username", "required": true, "value": "username", }, - Object { + { "label": "email", "required": true, "value": "email", }, - Object { + { "label": "provider", "value": "provider", }, - Object { + { "label": "password", "value": "password", }, - Object { + { "label": "resetPasswordToken", "value": "resetPasswordToken", }, - Object { + { "label": "confirmationToken", "value": "confirmationToken", }, - Object { + { "label": "confirmed", "value": "confirmed", }, - Object { + { "label": "blocked", "value": "blocked", }, - Object { + { "label": "role", "value": "role", }, @@ -158,365 +158,365 @@ describe('Role CRUD End to End', () => { }, ], ], - "plugins": Array [ - Object { + "plugins": [ + { "action": "plugin::content-manager.collection-types.configure-view", "displayName": "Configure view", "plugin": "content-manager", "subCategory": "collection types", }, - Object { + { "action": "plugin::content-manager.components.configure-layout", "displayName": "Configure Layout", "plugin": "content-manager", "subCategory": "components", }, - Object { + { "action": "plugin::content-manager.single-types.configure-view", "displayName": "Configure view", "plugin": "content-manager", "subCategory": "single types", }, - Object { + { "action": "plugin::content-type-builder.read", "displayName": "Read", "plugin": "content-type-builder", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.read", "displayName": "Access the Documentation", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.regenerate", "displayName": "Regenerate", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.update", "displayName": "Update and delete", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::upload.assets.copy-link", "displayName": "Copy link", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.create", "displayName": "Create (upload)", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.download", "displayName": "Download", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.update", "displayName": "Update (crop, details, replace) + delete", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.read", "displayName": "Access the Media Library", "plugin": "upload", "subCategory": "general", }, - Object { + { "action": "plugin::users-permissions.advanced-settings.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "advancedSettings", }, - Object { + { "action": "plugin::users-permissions.advanced-settings.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "advancedSettings", }, - Object { + { "action": "plugin::users-permissions.email-templates.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "emailTemplates", }, - Object { + { "action": "plugin::users-permissions.email-templates.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "emailTemplates", }, - Object { + { "action": "plugin::users-permissions.providers.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "providers", }, - Object { + { "action": "plugin::users-permissions.providers.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "providers", }, - Object { + { "action": "plugin::users-permissions.roles.create", "displayName": "Create", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.delete", "displayName": "Delete", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.update", "displayName": "Update", "plugin": "users-permissions", "subCategory": "roles", }, ], - "settings": Array [ - Object { + "settings": [ + { "action": "admin::api-tokens.create", "category": "api tokens", "displayName": "Create (generate)", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.delete", "category": "api tokens", "displayName": "Delete (revoke)", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.read", "category": "api tokens", "displayName": "Read", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.update", "category": "api tokens", "displayName": "Update", "subCategory": "general", }, - Object { + { "action": "admin::marketplace.plugins.install", "category": "plugins and marketplace", "displayName": "Install (only for dev env)", "subCategory": "plugins", }, - Object { + { "action": "admin::marketplace.plugins.uninstall", "category": "plugins and marketplace", "displayName": "Uninstall (only for dev env)", "subCategory": "plugins", }, - Object { + { "action": "admin::marketplace.read", "category": "plugins and marketplace", "displayName": "Access the marketplace", "subCategory": "marketplace", }, - Object { + { "action": "admin::project-settings.read", "category": "project", "displayName": "Read the project level settings", "subCategory": "general", }, - Object { + { "action": "admin::project-settings.update", "category": "project", "displayName": "Update the project level settings", "subCategory": "general", }, - Object { + { "action": "admin::roles.create", "category": "users and roles", "displayName": "Create", "subCategory": "roles", }, - Object { + { "action": "admin::roles.delete", "category": "users and roles", "displayName": "Delete", "subCategory": "roles", }, - Object { + { "action": "admin::roles.read", "category": "users and roles", "displayName": "Read", "subCategory": "roles", }, - Object { + { "action": "admin::roles.update", "category": "users and roles", "displayName": "Update", "subCategory": "roles", }, - Object { + { "action": "admin::users.create", "category": "users and roles", "displayName": "Create (invite)", "subCategory": "users", }, - Object { + { "action": "admin::users.delete", "category": "users and roles", "displayName": "Delete", "subCategory": "users", }, - Object { + { "action": "admin::users.read", "category": "users and roles", "displayName": "Read", "subCategory": "users", }, - Object { + { "action": "admin::users.update", "category": "users and roles", "displayName": "Update", "subCategory": "users", }, - Object { + { "action": "admin::webhooks.create", "category": "webhooks", "displayName": "Create", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.delete", "category": "webhooks", "displayName": "Delete", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.read", "category": "webhooks", "displayName": "Read", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.update", "category": "webhooks", "displayName": "Update", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.read", "category": "documentation", "displayName": "Access the documentation settings page", "subCategory": "general", }, - Object { + { "action": "plugin::email.settings.read", "category": "email", "displayName": "Access the Email Settings page", "subCategory": "general", }, - Object { + { "action": "plugin::i18n.locale.create", "category": "Internationalization", "displayName": "Create", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.delete", "category": "Internationalization", "displayName": "Delete", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.read", "category": "Internationalization", "displayName": "Read", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.update", "category": "Internationalization", "displayName": "Update", "subCategory": "Locales", }, - Object { + { "action": "plugin::upload.settings.read", "category": "media library", "displayName": "Access the Media Library settings page", "subCategory": "general", }, ], - "singleTypes": Array [ - Array [ - Object { + "singleTypes": [ + [ + { "actionId": "plugin::content-manager.explorer.create", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Create", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.read", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Read", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.update", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Update", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.delete", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Delete", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.publish", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Publish", - "subjects": Array [], + "subjects": [], }, ], - Array [], + [], ], }, } @@ -528,115 +528,115 @@ describe('Role CRUD End to End', () => { if (hasSSO) { expect(sortedData).toMatchInlineSnapshot(` - Object { - "conditions": Array [ - Object { + { + "conditions": [ + { "category": "default", "displayName": "Is creator", "id": "admin::is-creator", }, - Object { + { "category": "default", "displayName": "Has same role as creator", "id": "admin::has-same-role-as-creator", }, ], - "sections": Object { - "collectionTypes": Array [ - Array [ - Object { + "sections": { + "collectionTypes": [ + [ + { "actionId": "plugin::content-manager.explorer.create", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Create", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.read", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Read", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.update", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Update", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.delete", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Delete", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.publish", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Publish", - "subjects": Array [], + "subjects": [], }, ], - Array [ - Object { + [ + { "label": "user", - "properties": Array [ - Object { - "children": Array [ - Object { + "properties": [ + { + "children": [ + { "label": "username", "required": true, "value": "username", }, - Object { + { "label": "email", "required": true, "value": "email", }, - Object { + { "label": "provider", "value": "provider", }, - Object { + { "label": "password", "value": "password", }, - Object { + { "label": "resetPasswordToken", "value": "resetPasswordToken", }, - Object { + { "label": "confirmationToken", "value": "confirmationToken", }, - Object { + { "label": "confirmed", "value": "confirmed", }, - Object { + { "label": "blocked", "value": "blocked", }, - Object { + { "label": "role", "value": "role", }, @@ -649,377 +649,377 @@ describe('Role CRUD End to End', () => { }, ], ], - "plugins": Array [ - Object { + "plugins": [ + { "action": "plugin::content-manager.collection-types.configure-view", "displayName": "Configure view", "plugin": "content-manager", "subCategory": "collection types", }, - Object { + { "action": "plugin::content-manager.components.configure-layout", "displayName": "Configure Layout", "plugin": "content-manager", "subCategory": "components", }, - Object { + { "action": "plugin::content-manager.single-types.configure-view", "displayName": "Configure view", "plugin": "content-manager", "subCategory": "single types", }, - Object { + { "action": "plugin::content-type-builder.read", "displayName": "Read", "plugin": "content-type-builder", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.read", "displayName": "Access the Documentation", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.regenerate", "displayName": "Regenerate", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.update", "displayName": "Update and delete", "plugin": "documentation", "subCategory": "general", }, - Object { + { "action": "plugin::upload.assets.copy-link", "displayName": "Copy link", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.create", "displayName": "Create (upload)", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.download", "displayName": "Download", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.assets.update", "displayName": "Update (crop, details, replace) + delete", "plugin": "upload", "subCategory": "assets", }, - Object { + { "action": "plugin::upload.read", "displayName": "Access the Media Library", "plugin": "upload", "subCategory": "general", }, - Object { + { "action": "plugin::users-permissions.advanced-settings.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "advancedSettings", }, - Object { + { "action": "plugin::users-permissions.advanced-settings.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "advancedSettings", }, - Object { + { "action": "plugin::users-permissions.email-templates.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "emailTemplates", }, - Object { + { "action": "plugin::users-permissions.email-templates.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "emailTemplates", }, - Object { + { "action": "plugin::users-permissions.providers.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "providers", }, - Object { + { "action": "plugin::users-permissions.providers.update", "displayName": "Edit", "plugin": "users-permissions", "subCategory": "providers", }, - Object { + { "action": "plugin::users-permissions.roles.create", "displayName": "Create", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.delete", "displayName": "Delete", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.read", "displayName": "Read", "plugin": "users-permissions", "subCategory": "roles", }, - Object { + { "action": "plugin::users-permissions.roles.update", "displayName": "Update", "plugin": "users-permissions", "subCategory": "roles", }, ], - "settings": Array [ - Object { + "settings": [ + { "action": "admin::api-tokens.create", "category": "api tokens", "displayName": "Create (generate)", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.delete", "category": "api tokens", "displayName": "Delete (revoke)", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.read", "category": "api tokens", "displayName": "Read", "subCategory": "general", }, - Object { + { "action": "admin::api-tokens.update", "category": "api tokens", "displayName": "Update", "subCategory": "general", }, - Object { + { "action": "admin::marketplace.plugins.install", "category": "plugins and marketplace", "displayName": "Install (only for dev env)", "subCategory": "plugins", }, - Object { + { "action": "admin::marketplace.plugins.uninstall", "category": "plugins and marketplace", "displayName": "Uninstall (only for dev env)", "subCategory": "plugins", }, - Object { + { "action": "admin::marketplace.read", "category": "plugins and marketplace", "displayName": "Access the marketplace", "subCategory": "marketplace", }, - Object { + { "action": "admin::project-settings.read", "category": "project", "displayName": "Read the project level settings", "subCategory": "general", }, - Object { + { "action": "admin::project-settings.update", "category": "project", "displayName": "Update the project level settings", "subCategory": "general", }, - Object { + { "action": "admin::provider-login.read", "category": "single sign on", "displayName": "Read", "subCategory": "options", }, - Object { + { "action": "admin::provider-login.update", "category": "single sign on", "displayName": "Update", "subCategory": "options", }, - Object { + { "action": "admin::roles.create", "category": "users and roles", "displayName": "Create", "subCategory": "roles", }, - Object { + { "action": "admin::roles.delete", "category": "users and roles", "displayName": "Delete", "subCategory": "roles", }, - Object { + { "action": "admin::roles.read", "category": "users and roles", "displayName": "Read", "subCategory": "roles", }, - Object { + { "action": "admin::roles.update", "category": "users and roles", "displayName": "Update", "subCategory": "roles", }, - Object { + { "action": "admin::users.create", "category": "users and roles", "displayName": "Create (invite)", "subCategory": "users", }, - Object { + { "action": "admin::users.delete", "category": "users and roles", "displayName": "Delete", "subCategory": "users", }, - Object { + { "action": "admin::users.read", "category": "users and roles", "displayName": "Read", "subCategory": "users", }, - Object { + { "action": "admin::users.update", "category": "users and roles", "displayName": "Update", "subCategory": "users", }, - Object { + { "action": "admin::webhooks.create", "category": "webhooks", "displayName": "Create", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.delete", "category": "webhooks", "displayName": "Delete", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.read", "category": "webhooks", "displayName": "Read", "subCategory": "general", }, - Object { + { "action": "admin::webhooks.update", "category": "webhooks", "displayName": "Update", "subCategory": "general", }, - Object { + { "action": "plugin::documentation.settings.read", "category": "documentation", "displayName": "Access the documentation settings page", "subCategory": "general", }, - Object { + { "action": "plugin::email.settings.read", "category": "email", "displayName": "Access the Email Settings page", "subCategory": "general", }, - Object { + { "action": "plugin::i18n.locale.create", "category": "Internationalization", "displayName": "Create", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.delete", "category": "Internationalization", "displayName": "Delete", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.read", "category": "Internationalization", "displayName": "Read", "subCategory": "Locales", }, - Object { + { "action": "plugin::i18n.locale.update", "category": "Internationalization", "displayName": "Update", "subCategory": "Locales", }, - Object { + { "action": "plugin::upload.settings.read", "category": "media library", "displayName": "Access the Media Library settings page", "subCategory": "general", }, ], - "singleTypes": Array [ - Array [ - Object { + "singleTypes": [ + [ + { "actionId": "plugin::content-manager.explorer.create", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Create", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.read", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Read", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.update", - "applyToProperties": Array [ + "applyToProperties": [ "fields", "locales", ], "label": "Update", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.delete", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Delete", - "subjects": Array [ + "subjects": [ "plugin::users-permissions.user", ], }, - Object { + { "actionId": "plugin::content-manager.explorer.publish", - "applyToProperties": Array [ + "applyToProperties": [ "locales", ], "label": "Publish", - "subjects": Array [], + "subjects": [], }, ], - Array [], + [], ], }, } diff --git a/packages/core/content-manager/server/services/utils/configuration/__tests__/settings.test.js b/packages/core/content-manager/server/services/utils/configuration/__tests__/settings.test.js index 76e1254511..b4aacd7e3f 100644 --- a/packages/core/content-manager/server/services/utils/configuration/__tests__/settings.test.js +++ b/packages/core/content-manager/server/services/utils/configuration/__tests__/settings.test.js @@ -12,16 +12,16 @@ describe('Configuration settings service', () => { const settings = await settingsService.createDefaultSettings(schema); expect(settings).toMatchInlineSnapshot(` - Object { - "bulkable": true, - "defaultSortBy": "id", - "defaultSortOrder": "ASC", - "filterable": true, - "mainField": "id", - "pageSize": 10, - "searchable": true, - } - `); + { + "bulkable": true, + "defaultSortBy": "id", + "defaultSortOrder": "ASC", + "filterable": true, + "mainField": "id", + "pageSize": 10, + "searchable": true, + } + `); }); test('uses id as mainField by default', async () => { diff --git a/packages/core/content-type-builder/server/services/__tests__/__snapshots__/content-types.test.js.snap b/packages/core/content-type-builder/server/services/__tests__/__snapshots__/content-types.test.js.snap index 9aadae611f..4f99874fb5 100644 --- a/packages/core/content-type-builder/server/services/__tests__/__snapshots__/content-types.test.js.snap +++ b/packages/core/content-type-builder/server/services/__tests__/__snapshots__/content-types.test.js.snap @@ -1,12 +1,12 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Content types service format ContentType Returns consistent schemas 1`] = ` -Object { +{ "apiID": "my-name", "plugin": "some-plugin", - "schema": Object { - "attributes": Object { - "title": Object { + "schema": { + "attributes": { + "title": { "type": "string", }, }, @@ -15,8 +15,8 @@ Object { "displayName": "My name", "draftAndPublish": false, "kind": "singleType", - "pluginOptions": Object { - "content-manager": Object { + "pluginOptions": { + "content-manager": { "visible": true, }, }, diff --git a/packages/core/content-type-builder/tests/__snapshots__/collection-type.test.e2e.js.snap b/packages/core/content-type-builder/tests/__snapshots__/collection-type.test.e2e.js.snap index c575d6ab3a..dc81c5e6c6 100644 --- a/packages/core/content-type-builder/tests/__snapshots__/collection-type.test.e2e.js.snap +++ b/packages/core/content-type-builder/tests/__snapshots__/collection-type.test.e2e.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Content Type Builder - Content types Collection Types Get collection type returns full schema and information 1`] = ` -Object { - "data": Object { +{ + "data": { "apiID": "test-collection-type", - "schema": Object { - "attributes": Object { - "title": Object { - "pluginOptions": Object { - "i18n": Object { + "schema": { + "attributes": { + "title": { + "pluginOptions": { + "i18n": { "localized": true, }, }, @@ -20,8 +20,8 @@ Object { "displayName": "Test Collection Type", "draftAndPublish": false, "kind": "collectionType", - "pluginOptions": Object { - "i18n": Object { + "pluginOptions": { + "i18n": { "localized": true, }, }, @@ -36,12 +36,12 @@ Object { `; exports[`Content Type Builder - Content types Collection Types Get collection type returns full schema and informations with draftAndPublish 1`] = ` -Object { - "data": Object { +{ + "data": { "apiID": "ct-with-dp", - "schema": Object { - "attributes": Object { - "title": Object { + "schema": { + "attributes": { + "title": { "type": "string", }, }, diff --git a/packages/core/content-type-builder/tests/__snapshots__/single-type.test.e2e.js.snap b/packages/core/content-type-builder/tests/__snapshots__/single-type.test.e2e.js.snap index 6e0f48d9af..dc9fc56599 100644 --- a/packages/core/content-type-builder/tests/__snapshots__/single-type.test.e2e.js.snap +++ b/packages/core/content-type-builder/tests/__snapshots__/single-type.test.e2e.js.snap @@ -1,14 +1,14 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[`Content Type Builder - Content types Single Types Get single type returns full schema and information 1`] = ` -Object { - "data": Object { +{ + "data": { "apiID": "test-single-type", - "schema": Object { - "attributes": Object { - "title": Object { - "pluginOptions": Object { - "i18n": Object { + "schema": { + "attributes": { + "title": { + "pluginOptions": { + "i18n": { "localized": true, }, }, @@ -20,8 +20,8 @@ Object { "displayName": "Test Single Type", "draftAndPublish": false, "kind": "singleType", - "pluginOptions": Object { - "i18n": Object { + "pluginOptions": { + "i18n": { "localized": true, }, }, diff --git a/packages/core/helper-plugin/lib/src/components/ReactSelect/ReactSelect.js b/packages/core/helper-plugin/lib/src/components/ReactSelect/ReactSelect.js index a8e49a1a5c..a4e16a3e88 100644 --- a/packages/core/helper-plugin/lib/src/components/ReactSelect/ReactSelect.js +++ b/packages/core/helper-plugin/lib/src/components/ReactSelect/ReactSelect.js @@ -17,7 +17,13 @@ const ReactSelect = ({ components, styles, error, ariaErrorMessage, ...props })