@strapi/admin 4.6.0-beta.1 → 4.6.0-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.browserslistrc +3 -0
- package/admin/src/components/GlobalStyle/index.js +0 -6
- package/admin/src/components/GuidedTour/Modal/components/Content.js +7 -2
- package/admin/src/components/LeftMenu/index.js +8 -4
- package/admin/src/components/Notifications/Notification/index.js +25 -3
- package/admin/src/components/Notifications/reducer.js +1 -0
- package/admin/src/content-manager/components/DragLayer/RelationDragPreview.js +8 -6
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +4 -0
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +1 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +5 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +30 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/cleanData.js +18 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/findLeafByPathAndReplace.js +2 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +2 -1
- package/admin/src/content-manager/components/FieldComponent/index.js +6 -4
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +6 -8
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +6 -1
- package/admin/src/content-manager/components/RelationInput/components/RelationList.js +10 -6
- package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js +17 -6
- package/admin/src/content-manager/components/RelationInputDataManager/utils/select.js +5 -5
- package/admin/src/content-manager/components/RepeatableComponent/index.js +18 -23
- package/admin/src/content-manager/hooks/useCallbackRef.js +23 -0
- package/admin/src/content-manager/hooks/useDragAndDrop.js +1 -1
- package/admin/src/content-manager/hooks/useKeyboardDragAndDrop.js +10 -2
- package/admin/src/content-manager/hooks/useRelation/useRelation.js +9 -6
- package/admin/src/content-manager/pages/App/LeftMenu/index.js +5 -7
- package/admin/src/content-manager/pages/EditView/Header/index.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/index.js +3 -5
- package/admin/src/content-manager/utils/getMaxTempKey.js +4 -2
- package/admin/src/content-manager/utils/paths.js +37 -0
- package/admin/src/hooks/index.js +0 -1
- package/admin/src/hooks/useSettingsMenu/init.js +7 -0
- package/admin/src/pages/App/index.js +2 -1
- package/admin/src/pages/ProfilePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionBody.js +111 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/Modal/ActionItem.js +22 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/Modal/index.js +52 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/PaginationFooter/index.js +35 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/TableRows/index.js +88 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/hooks/useFormatTimeStamp.js +24 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/index.js +98 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/utils/getActionTypesDefaultMessages.js +33 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ListView/utils/tableHeaders.js +38 -0
- package/admin/src/pages/SettingsPage/pages/AuditLogs/ProtectedListPage/index.js +12 -0
- package/admin/src/pages/SettingsPage/utils/defaultRoutes.js +11 -0
- package/admin/src/permissions/defaultPermissions.js +4 -0
- package/admin/src/translations/ca.json +2 -3
- package/admin/src/translations/dk.json +2 -2
- package/admin/src/translations/en.json +41 -0
- package/admin/src/translations/es.json +2 -2
- package/admin/src/translations/fr.json +2 -2
- package/admin/src/translations/hu.json +197 -2
- package/admin/src/translations/ja.json +2 -2
- package/admin/src/translations/nl.json +2 -2
- package/admin/src/translations/zh-Hans.json +1 -1
- package/admin/src/translations/zh.json +11 -3
- package/build/2235.746d3cf7.chunk.js +106 -0
- package/build/2598.01c96bd5.chunk.js +159 -0
- package/build/2743.692b1f21.chunk.js +42 -0
- package/build/3557.e7115160.chunk.js +169 -0
- package/build/4318.87affaf2.chunk.js +30 -0
- package/build/4958.1979bbf5.chunk.js +276 -0
- package/build/5015.f5e15fdb.chunk.js +6 -0
- package/build/5052.c2eacff2.chunk.js +65 -0
- package/build/7295.4e2dfbbb.chunk.js +114 -0
- package/build/805.da20168c.chunk.js +138 -0
- package/build/8633.6f546066.chunk.js +1 -0
- package/build/874.be41e4b3.chunk.js +104 -0
- package/build/9707.a07db355.chunk.js +101 -0
- package/build/Admin-authenticatedApp.9933974c.chunk.js +75 -0
- package/build/Admin_InternalErrorPage.157152a8.chunk.js +1 -0
- package/build/Admin_homePage.045bb0c8.chunk.js +77 -0
- package/build/Admin_marketplace.bf3ac090.chunk.js +26 -0
- package/build/Admin_pluginsPage.d2a9a619.chunk.js +6 -0
- package/build/Admin_profilePage.5e830ceb.chunk.js +15 -0
- package/build/Admin_settingsPage.53fa00a4.chunk.js +178 -0
- package/build/Upload_ConfigureTheView.9bdf41b5.chunk.js +1 -0
- package/build/admin-app.8ed108ca.chunk.js +112 -0
- package/build/admin-audit-logs.68f833bf.chunk.js +1 -0
- package/build/admin-edit-roles-page.32bfe5ea.chunk.js +1 -0
- package/build/admin-edit-users.795f155c.chunk.js +10 -0
- package/build/admin-users.cbd9bcf7.chunk.js +11 -0
- package/build/api-tokens-create-page.0e686c30.chunk.js +1 -0
- package/build/api-tokens-edit-page.d6c7487b.chunk.js +1 -0
- package/build/api-tokens-list-page.a55e427c.chunk.js +16 -0
- package/build/ar-json.932794f7.chunk.js +1 -0
- package/build/ca-json.f6a0f472.chunk.js +1 -0
- package/build/codemirror-addon-closebrackets.71aa4bbd.chunk.js +2 -0
- package/build/codemirror-addon-lint-js.405f70fb.chunk.js +1 -0
- package/build/codemirror-addon-lint.8487ad3d.chunk.js +1 -0
- package/build/codemirror-addon-mark-selection.1928c849.chunk.js +1 -0
- package/build/{codemirror-css.4e2bbed3.chunk.js → codemirror-css.359a2a4b.chunk.js} +2 -3
- package/build/codemirror-javacript.af237b68.chunk.js +1 -0
- package/build/codemirror-theme.2fe63a16.chunk.js +33 -0
- package/build/content-manager.ad929a94.chunk.js +1174 -0
- package/build/content-type-builder-list-view.3048854d.chunk.js +198 -0
- package/build/content-type-builder-translation-ar-json.56d8fcf4.chunk.js +1 -0
- package/build/content-type-builder-translation-cs-json.a5b299ca.chunk.js +1 -0
- package/build/content-type-builder-translation-de-json.29df67b8.chunk.js +1 -0
- package/build/content-type-builder-translation-dk-json.e22d2527.chunk.js +1 -0
- package/build/content-type-builder-translation-en-json.08e28f4e.chunk.js +1 -0
- package/build/content-type-builder-translation-es-json.1044b252.chunk.js +1 -0
- package/build/content-type-builder-translation-fr-json.2183e6b3.chunk.js +1 -0
- package/build/content-type-builder-translation-id-json.ba3e8891.chunk.js +1 -0
- package/build/content-type-builder-translation-it-json.d4661201.chunk.js +1 -0
- package/build/content-type-builder-translation-ja-json.9be0d5b2.chunk.js +1 -0
- package/build/content-type-builder-translation-ko-json.57ff7f51.chunk.js +1 -0
- package/build/content-type-builder-translation-ms-json.2d29c1e0.chunk.js +1 -0
- package/build/content-type-builder-translation-nl-json.40bbc562.chunk.js +1 -0
- package/build/content-type-builder-translation-pl-json.a057b51e.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-BR-json.446df9da.chunk.js +1 -0
- package/build/content-type-builder-translation-pt-json.ddb44f8c.chunk.js +1 -0
- package/build/content-type-builder-translation-ru-json.8c51843e.chunk.js +1 -0
- package/build/content-type-builder-translation-sk-json.626c9493.chunk.js +1 -0
- package/build/content-type-builder-translation-sv-json.af6ecca1.chunk.js +1 -0
- package/build/content-type-builder-translation-th-json.6fe3ed55.chunk.js +1 -0
- package/build/content-type-builder-translation-tr-json.da83a07e.chunk.js +1 -0
- package/build/content-type-builder-translation-uk-json.c4524247.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-Hans-json.52a30266.chunk.js +1 -0
- package/build/content-type-builder-translation-zh-json.42f94cb3.chunk.js +1 -0
- package/build/content-type-builder.4edd1c22.chunk.js +127 -0
- package/build/cs-json.79879fb6.chunk.js +1 -0
- package/build/de-json.30e1f35b.chunk.js +1 -0
- package/build/dk-json.e6d9ffa4.chunk.js +1 -0
- package/build/email-settings-page.7c9e6c5e.chunk.js +15 -0
- package/build/email-translation-ar-json.88304564.chunk.js +1 -0
- package/build/email-translation-cs-json.6eaeec6a.chunk.js +1 -0
- package/build/email-translation-de-json.1b334230.chunk.js +1 -0
- package/build/email-translation-dk-json.85402492.chunk.js +1 -0
- package/build/email-translation-en-json.4211d4d0.chunk.js +1 -0
- package/build/email-translation-es-json.0b6b1006.chunk.js +1 -0
- package/build/email-translation-fr-json.78be2787.chunk.js +1 -0
- package/build/email-translation-id-json.c97239fe.chunk.js +1 -0
- package/build/email-translation-it-json.a2ed8c78.chunk.js +1 -0
- package/build/email-translation-ja-json.63eebd02.chunk.js +1 -0
- package/build/email-translation-ko-json.4de49b23.chunk.js +1 -0
- package/build/email-translation-ms-json.7390477e.chunk.js +1 -0
- package/build/email-translation-nl-json.377bdd9f.chunk.js +1 -0
- package/build/email-translation-pl-json.97d0db97.chunk.js +1 -0
- package/build/email-translation-pt-BR-json.81cca553.chunk.js +1 -0
- package/build/email-translation-pt-json.2a2a0643.chunk.js +1 -0
- package/build/email-translation-ru-json.6bce37dd.chunk.js +1 -0
- package/build/email-translation-sk-json.53da2fcd.chunk.js +1 -0
- package/build/email-translation-th-json.660fa9a8.chunk.js +1 -0
- package/build/email-translation-tr-json.e6c0f8fc.chunk.js +1 -0
- package/build/email-translation-uk-json.bd1fb6bf.chunk.js +1 -0
- package/build/email-translation-vi-json.9fb7e6d7.chunk.js +1 -0
- package/build/email-translation-zh-Hans-json.c6841563.chunk.js +1 -0
- package/build/email-translation-zh-json.7a2232ea.chunk.js +1 -0
- package/build/en-json.d65a13ef.chunk.js +1 -0
- package/build/es-json.e275481d.chunk.js +1 -0
- package/build/fr-json.78545ef8.chunk.js +1 -0
- package/build/gu-json.676518f2.chunk.js +1 -0
- package/build/he-json.ad22e8cc.chunk.js +1 -0
- package/build/hi-json.19b51c09.chunk.js +1 -0
- package/build/highlight.js.26ef649f.chunk.js +85 -0
- package/build/hu-json.f947088f.chunk.js +1 -0
- package/build/i18n-settings-page.fbccdf12.chunk.js +1 -0
- package/build/i18n-translation-de-json.dc876c08.chunk.js +1 -0
- package/build/i18n-translation-dk-json.49aaf933.chunk.js +1 -0
- package/build/i18n-translation-en-json.ac9ebc1b.chunk.js +1 -0
- package/build/i18n-translation-es-json.57072ed3.chunk.js +1 -0
- package/build/i18n-translation-fr-json.84733f34.chunk.js +1 -0
- package/build/i18n-translation-ko-json.fc73fe20.chunk.js +1 -0
- package/build/i18n-translation-pl-json.16e5df90.chunk.js +1 -0
- package/build/i18n-translation-tr-json.cb39c048.chunk.js +1 -0
- package/build/i18n-translation-zh-Hans-json.2cf82d2d.chunk.js +1 -0
- package/build/i18n-translation-zh-json.ed1d272e.chunk.js +1 -0
- package/build/id-json.504daa84.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.2fd90f4d.chunk.js +1 -0
- package/build/ja-json.c9f12d0b.chunk.js +1 -0
- package/build/ko-json.ef463065.chunk.js +1 -0
- package/build/main.6bbf9950.js +4417 -0
- package/build/ml-json.490f666c.chunk.js +1 -0
- package/build/ms-json.db87d8d3.chunk.js +1 -0
- package/build/nl-json.c416295a.chunk.js +1 -0
- package/build/no-json.1a2258ba.chunk.js +1 -0
- package/build/pl-json.8cf0c871.chunk.js +1 -0
- package/build/pt-BR-json.51fab8d0.chunk.js +1 -0
- package/build/pt-json.62927d1e.chunk.js +1 -0
- package/build/ru-json.3b411a39.chunk.js +1 -0
- package/build/runtime~main.c2bf62af.js +2 -0
- package/build/sa-json.f3fa5407.chunk.js +1 -0
- package/build/sk-json.9ec60d9f.chunk.js +1 -0
- package/build/sso-settings-page.4031de9e.chunk.js +41 -0
- package/build/sv-json.c6b0c237.chunk.js +1 -0
- package/build/th-json.6e68155c.chunk.js +1 -0
- package/build/tr-json.9f41dc08.chunk.js +1 -0
- package/build/uk-json.b2fcd567.chunk.js +1 -0
- package/build/upload-settings.657790fd.chunk.js +89 -0
- package/build/upload-translation-ca-json.57954414.chunk.js +1 -0
- package/build/upload-translation-de-json.420c943b.chunk.js +1 -0
- package/build/upload-translation-dk-json.bbb2fa05.chunk.js +1 -0
- package/build/upload-translation-en-json.8b7573ce.chunk.js +1 -0
- package/build/upload-translation-es-json.ba2eb03a.chunk.js +1 -0
- package/build/upload-translation-fr-json.84429734.chunk.js +1 -0
- package/build/upload-translation-he-json.0a830937.chunk.js +1 -0
- package/build/upload-translation-it-json.e87d7966.chunk.js +1 -0
- package/build/upload-translation-ja-json.44b88e7a.chunk.js +1 -0
- package/build/upload-translation-ko-json.a52eab64.chunk.js +1 -0
- package/build/upload-translation-ms-json.74f6d746.chunk.js +1 -0
- package/build/upload-translation-pl-json.426f31c9.chunk.js +1 -0
- package/build/upload-translation-pt-BR-json.d1704f0b.chunk.js +1 -0
- package/build/upload-translation-pt-json.6b937fdf.chunk.js +1 -0
- package/build/upload-translation-ru-json.675f6b93.chunk.js +1 -0
- package/build/upload-translation-sk-json.483a18f6.chunk.js +1 -0
- package/build/upload-translation-th-json.3847dae0.chunk.js +1 -0
- package/build/upload-translation-tr-json.74117e5c.chunk.js +1 -0
- package/build/upload-translation-uk-json.9950466a.chunk.js +1 -0
- package/build/upload-translation-zh-Hans-json.3da5cf56.chunk.js +1 -0
- package/build/upload-translation-zh-json.e1dd6eb2.chunk.js +1 -0
- package/build/upload.608a9856.chunk.js +38 -0
- package/build/users-advanced-settings-page.e3ab865f.chunk.js +13 -0
- package/build/users-email-settings-page.57adf9b7.chunk.js +28 -0
- package/build/users-permissions-translation-ar-json.7d87d54d.chunk.js +1 -0
- package/build/users-permissions-translation-cs-json.7e23424a.chunk.js +1 -0
- package/build/users-permissions-translation-de-json.a6fb670f.chunk.js +1 -0
- package/build/users-permissions-translation-dk-json.60e50f48.chunk.js +1 -0
- package/build/users-permissions-translation-en-json.4b302272.chunk.js +1 -0
- package/build/users-permissions-translation-es-json.35007573.chunk.js +1 -0
- package/build/users-permissions-translation-fr-json.7e55bbbb.chunk.js +1 -0
- package/build/users-permissions-translation-id-json.a5a0fb59.chunk.js +1 -0
- package/build/users-permissions-translation-it-json.0705465d.chunk.js +1 -0
- package/build/users-permissions-translation-ja-json.891fe76e.chunk.js +1 -0
- package/build/users-permissions-translation-ko-json.357d7a33.chunk.js +1 -0
- package/build/users-permissions-translation-ms-json.c83f87c4.chunk.js +1 -0
- package/build/users-permissions-translation-nl-json.c9f92a3c.chunk.js +1 -0
- package/build/users-permissions-translation-pl-json.0a7287d1.chunk.js +1 -0
- package/build/users-permissions-translation-pt-BR-json.1b6d2920.chunk.js +1 -0
- package/build/users-permissions-translation-pt-json.a7eda429.chunk.js +1 -0
- package/build/users-permissions-translation-ru-json.20e177db.chunk.js +1 -0
- package/build/users-permissions-translation-sk-json.7f37180f.chunk.js +1 -0
- package/build/users-permissions-translation-sv-json.17187818.chunk.js +1 -0
- package/build/users-permissions-translation-th-json.1e9c0247.chunk.js +1 -0
- package/build/users-permissions-translation-tr-json.2bd7ff98.chunk.js +1 -0
- package/build/users-permissions-translation-uk-json.6a0a1572.chunk.js +1 -0
- package/build/users-permissions-translation-vi-json.6722a8a2.chunk.js +1 -0
- package/build/users-permissions-translation-zh-Hans-json.0b31c705.chunk.js +1 -0
- package/build/users-permissions-translation-zh-json.7978eaa6.chunk.js +1 -0
- package/build/users-providers-settings-page.7d1fb45c.chunk.js +1 -0
- package/build/users-roles-settings-page.ad28ab42.chunk.js +30 -0
- package/build/vi-json.f08d7d03.chunk.js +1 -0
- package/build/webhook-edit-page.1dd6d040.chunk.js +75 -0
- package/build/webhook-list-page.98afa3ea.chunk.js +42 -0
- package/build/zh-Hans-json.9c0eac99.chunk.js +1 -0
- package/build/zh-json.f88f563d.chunk.js +1 -0
- package/ee/server/bootstrap.js +6 -20
- package/ee/server/config/admin-actions.js +32 -0
- package/ee/server/controllers/audit-logs.js +24 -0
- package/ee/server/controllers/authentication/middlewares.js +2 -1
- package/ee/server/controllers/index.js +1 -0
- package/ee/server/destroy.js +12 -0
- package/ee/server/index.js +2 -0
- package/ee/server/register.js +15 -0
- package/ee/server/routes/features-routes.js +20 -0
- package/ee/server/services/audit-logs.js +135 -0
- package/ee/server/validation/audit-logs.js +18 -0
- package/package.json +25 -15
- package/server/controllers/authentication.js +8 -1
- package/server/index.js +2 -0
- package/server/middlewares/index.js +7 -0
- package/server/middlewares/rateLimit.js +43 -0
- package/server/register.js +9 -0
- package/server/routes/authentication.js +12 -1
- package/server/routes/roles.js +0 -8
- package/server/services/permission/queries.js +12 -3
- package/server/services/role.js +11 -2
- package/server/services/user.js +23 -3
- package/webpack.config.js +7 -4
- package/admin/src/hooks/useFetchClient/index.js +0 -23
- package/admin/src/utils/fetchClient.js +0 -45
- package/admin/src/utils/getFetchClient.js +0 -10
- package/build/2235.06c13219.chunk.js +0 -106
- package/build/2598.962797b2.chunk.js +0 -159
- package/build/4318.0bbd3f4b.chunk.js +0 -30
- package/build/4958.7c118f5e.chunk.js +0 -276
- package/build/5015.f080b64e.chunk.js +0 -6
- package/build/5052.712419ea.chunk.js +0 -65
- package/build/7295.04ac49dc.chunk.js +0 -114
- package/build/805.ddcead70.chunk.js +0 -138
- package/build/8633.59223842.chunk.js +0 -1
- package/build/874.bde3ea04.chunk.js +0 -104
- package/build/9159.ac968e72.chunk.js +0 -169
- package/build/9707.77e475ee.chunk.js +0 -101
- package/build/Admin-authenticatedApp.9dd415b8.chunk.js +0 -72
- package/build/Admin_InternalErrorPage.e0317a5e.chunk.js +0 -1
- package/build/Admin_homePage.8945f71a.chunk.js +0 -77
- package/build/Admin_marketplace.ed754a4a.chunk.js +0 -26
- package/build/Admin_pluginsPage.67728975.chunk.js +0 -6
- package/build/Admin_profilePage.60ab80bb.chunk.js +0 -15
- package/build/Admin_settingsPage.9ce40fed.chunk.js +0 -178
- package/build/Upload_ConfigureTheView.7cb2a3fd.chunk.js +0 -1
- package/build/admin-app.d8fc7c4d.chunk.js +0 -112
- package/build/admin-edit-roles-page.f407538c.chunk.js +0 -1
- package/build/admin-edit-users.5547b126.chunk.js +0 -10
- package/build/admin-users.4b6b47f8.chunk.js +0 -11
- package/build/api-tokens-create-page.dd4ddfcb.chunk.js +0 -1
- package/build/api-tokens-edit-page.821c5a6c.chunk.js +0 -1
- package/build/api-tokens-list-page.50519ed7.chunk.js +0 -16
- package/build/ar-json.3489463d.chunk.js +0 -1
- package/build/ca-json.07ae0f2c.chunk.js +0 -1
- package/build/codemirror-addon-closebrackets.c0f97916.chunk.js +0 -2
- package/build/codemirror-addon-lint-js.7c35dcb0.chunk.js +0 -1
- package/build/codemirror-addon-lint.505ff1d4.chunk.js +0 -1
- package/build/codemirror-addon-mark-selection.653e904d.chunk.js +0 -1
- package/build/codemirror-javacript.41bdefda.chunk.js +0 -1
- package/build/codemirror-theme.a82cae4e.chunk.js +0 -34
- package/build/content-manager.f2214e32.chunk.js +0 -1166
- package/build/content-type-builder-list-view.4aea46fa.chunk.js +0 -198
- package/build/content-type-builder-translation-ar-json.142327af.chunk.js +0 -1
- package/build/content-type-builder-translation-cs-json.4aafb972.chunk.js +0 -1
- package/build/content-type-builder-translation-de-json.a52482c7.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.a8616510.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.1d9a3c14.chunk.js +0 -1
- package/build/content-type-builder-translation-es-json.c3ea46fb.chunk.js +0 -1
- package/build/content-type-builder-translation-fr-json.aa6eeea8.chunk.js +0 -1
- package/build/content-type-builder-translation-id-json.7c00a32a.chunk.js +0 -1
- package/build/content-type-builder-translation-it-json.a906b389.chunk.js +0 -1
- package/build/content-type-builder-translation-ja-json.87f71930.chunk.js +0 -1
- package/build/content-type-builder-translation-ko-json.3fb7ddc8.chunk.js +0 -1
- package/build/content-type-builder-translation-ms-json.963a1a01.chunk.js +0 -1
- package/build/content-type-builder-translation-nl-json.c46c8f30.chunk.js +0 -1
- package/build/content-type-builder-translation-pl-json.9b2993b2.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-BR-json.6d255441.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-json.96a31576.chunk.js +0 -1
- package/build/content-type-builder-translation-ru-json.cf8d7c5c.chunk.js +0 -1
- package/build/content-type-builder-translation-sk-json.3a6defe0.chunk.js +0 -1
- package/build/content-type-builder-translation-sv-json.c608b9ca.chunk.js +0 -1
- package/build/content-type-builder-translation-th-json.c96a2d3f.chunk.js +0 -1
- package/build/content-type-builder-translation-tr-json.949e22eb.chunk.js +0 -1
- package/build/content-type-builder-translation-uk-json.d8c0b6dd.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-Hans-json.92a27f59.chunk.js +0 -1
- package/build/content-type-builder-translation-zh-json.b79513e4.chunk.js +0 -1
- package/build/content-type-builder.8a9a77f9.chunk.js +0 -127
- package/build/cropper-css.12fe038c.chunk.js +0 -306
- package/build/cs-json.ce49da5c.chunk.js +0 -1
- package/build/de-json.6b3e1894.chunk.js +0 -1
- package/build/dk-json.144c6a8e.chunk.js +0 -1
- package/build/email-settings-page.c6e62f6b.chunk.js +0 -15
- package/build/email-translation-ar-json.c624512d.chunk.js +0 -1
- package/build/email-translation-cs-json.cb18caab.chunk.js +0 -1
- package/build/email-translation-de-json.54743260.chunk.js +0 -1
- package/build/email-translation-dk-json.f323fe4e.chunk.js +0 -1
- package/build/email-translation-en-json.ebad8943.chunk.js +0 -1
- package/build/email-translation-es-json.9021417d.chunk.js +0 -1
- package/build/email-translation-fr-json.9f125db0.chunk.js +0 -1
- package/build/email-translation-id-json.3bcae5f5.chunk.js +0 -1
- package/build/email-translation-it-json.6ffd1774.chunk.js +0 -1
- package/build/email-translation-ja-json.72b3f73c.chunk.js +0 -1
- package/build/email-translation-ko-json.e61d4e7a.chunk.js +0 -1
- package/build/email-translation-ms-json.b2b11e05.chunk.js +0 -1
- package/build/email-translation-nl-json.5349635f.chunk.js +0 -1
- package/build/email-translation-pl-json.a03bcf98.chunk.js +0 -1
- package/build/email-translation-pt-BR-json.2c98ab20.chunk.js +0 -1
- package/build/email-translation-pt-json.159505ab.chunk.js +0 -1
- package/build/email-translation-ru-json.d508cf3e.chunk.js +0 -1
- package/build/email-translation-sk-json.fa1fd4b3.chunk.js +0 -1
- package/build/email-translation-th-json.989cfecc.chunk.js +0 -1
- package/build/email-translation-tr-json.8aa034bb.chunk.js +0 -1
- package/build/email-translation-uk-json.0396a803.chunk.js +0 -1
- package/build/email-translation-vi-json.c0d8c414.chunk.js +0 -1
- package/build/email-translation-zh-Hans-json.8172da08.chunk.js +0 -1
- package/build/email-translation-zh-json.62b1c6fe.chunk.js +0 -1
- package/build/en-json.1abdade9.chunk.js +0 -1
- package/build/es-json.6d123a82.chunk.js +0 -1
- package/build/fr-json.28ab54cb.chunk.js +0 -1
- package/build/gu-json.9a50ea64.chunk.js +0 -1
- package/build/he-json.72f18790.chunk.js +0 -1
- package/build/hi-json.0301b7ba.chunk.js +0 -1
- package/build/highlight.js.af2de364.chunk.js +0 -86
- package/build/hu-json.c4b641bb.chunk.js +0 -1
- package/build/i18n-settings-page.ee572037.chunk.js +0 -1
- package/build/i18n-translation-de-json.92534555.chunk.js +0 -1
- package/build/i18n-translation-dk-json.54f410ca.chunk.js +0 -1
- package/build/i18n-translation-en-json.760250ae.chunk.js +0 -1
- package/build/i18n-translation-es-json.488206ae.chunk.js +0 -1
- package/build/i18n-translation-fr-json.b401aa34.chunk.js +0 -1
- package/build/i18n-translation-ko-json.b2d90a83.chunk.js +0 -1
- package/build/i18n-translation-pl-json.cea5bf23.chunk.js +0 -1
- package/build/i18n-translation-tr-json.34ca9d61.chunk.js +0 -1
- package/build/i18n-translation-zh-Hans-json.560a98e3.chunk.js +0 -1
- package/build/i18n-translation-zh-json.eeebb849.chunk.js +0 -1
- package/build/id-json.86035797.chunk.js +0 -1
- package/build/it-json.bbdc8993.chunk.js +0 -1
- package/build/ja-json.1c9eeeec.chunk.js +0 -1
- package/build/ko-json.e1f66398.chunk.js +0 -1
- package/build/main.91f6e21e.js +0 -4099
- package/build/ml-json.963c889f.chunk.js +0 -1
- package/build/ms-json.ed51e902.chunk.js +0 -1
- package/build/nl-json.26f39180.chunk.js +0 -1
- package/build/no-json.a58c28bd.chunk.js +0 -1
- package/build/pl-json.249626b3.chunk.js +0 -1
- package/build/pt-BR-json.2b72b1d6.chunk.js +0 -1
- package/build/pt-json.cd67ba86.chunk.js +0 -1
- package/build/ru-json.8830286f.chunk.js +0 -1
- package/build/runtime~main.447b0382.js +0 -2
- package/build/sa-json.44e95991.chunk.js +0 -1
- package/build/sk-json.2af48064.chunk.js +0 -1
- package/build/sso-settings-page.91924df1.chunk.js +0 -41
- package/build/sv-json.fb1081ff.chunk.js +0 -1
- package/build/th-json.a67309b1.chunk.js +0 -1
- package/build/tr-json.eac8bd79.chunk.js +0 -1
- package/build/uk-json.c4cd2e24.chunk.js +0 -1
- package/build/upload-settings.326cd9fd.chunk.js +0 -89
- package/build/upload-translation-ca-json.db8ed7ba.chunk.js +0 -1
- package/build/upload-translation-de-json.00cbbc08.chunk.js +0 -1
- package/build/upload-translation-dk-json.c787a6be.chunk.js +0 -1
- package/build/upload-translation-en-json.32cf9aff.chunk.js +0 -1
- package/build/upload-translation-es-json.0f90db48.chunk.js +0 -1
- package/build/upload-translation-fr-json.e21c0c7a.chunk.js +0 -1
- package/build/upload-translation-he-json.4ce77b7b.chunk.js +0 -1
- package/build/upload-translation-it-json.5ce11e0b.chunk.js +0 -1
- package/build/upload-translation-ja-json.22afae44.chunk.js +0 -1
- package/build/upload-translation-ko-json.392002fb.chunk.js +0 -1
- package/build/upload-translation-ms-json.0605d6da.chunk.js +0 -1
- package/build/upload-translation-pl-json.136eedb6.chunk.js +0 -1
- package/build/upload-translation-pt-BR-json.95686cfb.chunk.js +0 -1
- package/build/upload-translation-pt-json.5c452b48.chunk.js +0 -1
- package/build/upload-translation-ru-json.37bd1546.chunk.js +0 -1
- package/build/upload-translation-sk-json.fe86c53b.chunk.js +0 -1
- package/build/upload-translation-th-json.9e1fda51.chunk.js +0 -1
- package/build/upload-translation-tr-json.b173223a.chunk.js +0 -1
- package/build/upload-translation-uk-json.1328cb3e.chunk.js +0 -1
- package/build/upload-translation-zh-Hans-json.37a2981e.chunk.js +0 -1
- package/build/upload-translation-zh-json.ac5711de.chunk.js +0 -1
- package/build/upload.2977cb13.chunk.js +0 -38
- package/build/users-advanced-settings-page.0c0b8230.chunk.js +0 -13
- package/build/users-email-settings-page.18d4a475.chunk.js +0 -28
- package/build/users-permissions-translation-ar-json.e8123ed2.chunk.js +0 -1
- package/build/users-permissions-translation-cs-json.e6649c5f.chunk.js +0 -1
- package/build/users-permissions-translation-de-json.c3628843.chunk.js +0 -1
- package/build/users-permissions-translation-dk-json.bad0b786.chunk.js +0 -1
- package/build/users-permissions-translation-en-json.aeab388a.chunk.js +0 -1
- package/build/users-permissions-translation-es-json.152a923f.chunk.js +0 -1
- package/build/users-permissions-translation-fr-json.172aa69f.chunk.js +0 -1
- package/build/users-permissions-translation-id-json.5aadd143.chunk.js +0 -1
- package/build/users-permissions-translation-it-json.7d377480.chunk.js +0 -1
- package/build/users-permissions-translation-ja-json.4967badf.chunk.js +0 -1
- package/build/users-permissions-translation-ko-json.6bd0ae22.chunk.js +0 -1
- package/build/users-permissions-translation-ms-json.ea8a2baf.chunk.js +0 -1
- package/build/users-permissions-translation-nl-json.d638c4ce.chunk.js +0 -1
- package/build/users-permissions-translation-pl-json.c6a02992.chunk.js +0 -1
- package/build/users-permissions-translation-pt-BR-json.f6791a86.chunk.js +0 -1
- package/build/users-permissions-translation-pt-json.38afed04.chunk.js +0 -1
- package/build/users-permissions-translation-ru-json.319d51ef.chunk.js +0 -1
- package/build/users-permissions-translation-sk-json.ba1cd385.chunk.js +0 -1
- package/build/users-permissions-translation-sv-json.370d6eee.chunk.js +0 -1
- package/build/users-permissions-translation-th-json.68873214.chunk.js +0 -1
- package/build/users-permissions-translation-tr-json.9bebc250.chunk.js +0 -1
- package/build/users-permissions-translation-uk-json.63eaa01c.chunk.js +0 -1
- package/build/users-permissions-translation-vi-json.dccc02fc.chunk.js +0 -1
- package/build/users-permissions-translation-zh-Hans-json.c3fd301b.chunk.js +0 -1
- package/build/users-permissions-translation-zh-json.1fea833f.chunk.js +0 -1
- package/build/users-providers-settings-page.25dd858e.chunk.js +0 -1
- package/build/users-roles-settings-page.8482a999.chunk.js +0 -30
- package/build/vi-json.f7890025.chunk.js +0 -1
- package/build/webhook-edit-page.dcc3d145.chunk.js +0 -75
- package/build/webhook-list-page.894e6959.chunk.js +0 -42
- package/build/zh-Hans-json.21617c24.chunk.js +0 -1
- package/build/zh-json.2ecc6b99.chunk.js +0 -1
package/.browserslistrc
ADDED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import { createGlobalStyle } from 'styled-components';
|
|
2
2
|
|
|
3
|
-
const loadCss = async () => {
|
|
4
|
-
await import(/* webpackChunkName: "cropper-css" */ 'cropperjs/dist/cropper.css');
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
loadCss();
|
|
8
|
-
|
|
9
3
|
const GlobalStyle = createGlobalStyle`
|
|
10
4
|
body {
|
|
11
5
|
background: ${({ theme }) => theme.colors.neutral100};
|
|
@@ -8,6 +8,9 @@ import { useIntl } from 'react-intl';
|
|
|
8
8
|
|
|
9
9
|
const LiStyled = styled.li`
|
|
10
10
|
list-style: disc;
|
|
11
|
+
&::marker {
|
|
12
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
13
|
+
}
|
|
11
14
|
`;
|
|
12
15
|
|
|
13
16
|
const Content = ({ id, defaultMessage }) => {
|
|
@@ -19,13 +22,15 @@ const Content = ({ id, defaultMessage }) => {
|
|
|
19
22
|
{ id, defaultMessage },
|
|
20
23
|
{
|
|
21
24
|
documentationLink: (children) => (
|
|
22
|
-
<
|
|
25
|
+
<Typography
|
|
26
|
+
as="a"
|
|
27
|
+
textColor="primary600"
|
|
23
28
|
target="_blank"
|
|
24
29
|
rel="noopener noreferrer"
|
|
25
30
|
href="https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#api-parameters"
|
|
26
31
|
>
|
|
27
32
|
{children}
|
|
28
|
-
</
|
|
33
|
+
</Typography>
|
|
29
34
|
),
|
|
30
35
|
b: (children) => <Typography fontWeight="semiBold">{children}</Typography>,
|
|
31
36
|
p: (children) => <Typography>{children}</Typography>,
|
|
@@ -2,7 +2,7 @@ import React, { useRef, useState } from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
5
|
-
import { NavLink as RouterNavLink, useLocation } from 'react-router-dom';
|
|
5
|
+
import { NavLink as RouterNavLink, useLocation, useHistory } from 'react-router-dom';
|
|
6
6
|
import { Divider } from '@strapi/design-system/Divider';
|
|
7
7
|
import {
|
|
8
8
|
MainNav,
|
|
@@ -20,7 +20,8 @@ import { Stack } from '@strapi/design-system/Stack';
|
|
|
20
20
|
import Write from '@strapi/icons/Write';
|
|
21
21
|
import Exit from '@strapi/icons/Exit';
|
|
22
22
|
import { auth, usePersistentState, useAppInfos, useTracking } from '@strapi/helper-plugin';
|
|
23
|
-
import useConfigurations from '../../hooks
|
|
23
|
+
import { useConfigurations } from '../../hooks';
|
|
24
|
+
import { axiosInstance } from '../../core/utils';
|
|
24
25
|
|
|
25
26
|
const LinkUserWrapper = styled(Box)`
|
|
26
27
|
width: ${150 / 16}rem;
|
|
@@ -61,6 +62,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
61
62
|
const { formatMessage } = useIntl();
|
|
62
63
|
const { trackUsage } = useTracking();
|
|
63
64
|
const { pathname } = useLocation();
|
|
65
|
+
const history = useHistory();
|
|
64
66
|
|
|
65
67
|
const initials = userDisplayName
|
|
66
68
|
.split(' ')
|
|
@@ -70,9 +72,11 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
70
72
|
|
|
71
73
|
const handleToggleUserLinks = () => setUserLinksVisible((prev) => !prev);
|
|
72
74
|
|
|
73
|
-
const handleLogout = () => {
|
|
75
|
+
const handleLogout = async () => {
|
|
76
|
+
await axiosInstance.post('/admin/logout');
|
|
74
77
|
auth.clearAppStorage();
|
|
75
78
|
handleToggleUserLinks();
|
|
79
|
+
history.push('/auth/login');
|
|
76
80
|
};
|
|
77
81
|
|
|
78
82
|
const handleBlur = (e) => {
|
|
@@ -205,7 +209,7 @@ const LeftMenu = ({ generalSectionLinks, pluginsSectionLinks }) => {
|
|
|
205
209
|
})}
|
|
206
210
|
</Typography>
|
|
207
211
|
</LinkUser>
|
|
208
|
-
<LinkUser tabIndex={0} onClick={handleLogout} logout="logout"
|
|
212
|
+
<LinkUser as="button" tabIndex={0} onClick={handleLogout} logout="logout">
|
|
209
213
|
<Typography textColor="danger600">
|
|
210
214
|
{formatMessage({
|
|
211
215
|
id: 'app.components.LeftMenu.logout',
|
|
@@ -6,7 +6,7 @@ import { Link } from '@strapi/design-system/v2/Link';
|
|
|
6
6
|
|
|
7
7
|
const Notification = ({ dispatch, notification }) => {
|
|
8
8
|
const { formatMessage } = useIntl();
|
|
9
|
-
const { message, link, type, id, onClose, timeout, blockTransition } = notification;
|
|
9
|
+
const { message, link, type, id, onClose, timeout, blockTransition, title } = notification;
|
|
10
10
|
|
|
11
11
|
const formattedMessage = (msg) =>
|
|
12
12
|
typeof msg === 'string' ? msg : formatMessage(msg, msg.values);
|
|
@@ -37,6 +37,7 @@ const Notification = ({ dispatch, notification }) => {
|
|
|
37
37
|
let variant;
|
|
38
38
|
let alertTitle;
|
|
39
39
|
|
|
40
|
+
// TODO break out this logic into separate file
|
|
40
41
|
if (type === 'info') {
|
|
41
42
|
variant = 'default';
|
|
42
43
|
alertTitle = formatMessage({
|
|
@@ -44,17 +45,29 @@ const Notification = ({ dispatch, notification }) => {
|
|
|
44
45
|
defaultMessage: 'Information:',
|
|
45
46
|
});
|
|
46
47
|
} else if (type === 'warning') {
|
|
48
|
+
// type should be renamed to danger in the future, but it might introduce changes if done now
|
|
49
|
+
variant = 'danger';
|
|
50
|
+
alertTitle = formatMessage({
|
|
51
|
+
id: 'notification.warning.title',
|
|
52
|
+
defaultMessage: 'Warning:',
|
|
53
|
+
});
|
|
54
|
+
} else if (type === 'softWarning') {
|
|
55
|
+
// type should be renamed to just warning in the future
|
|
56
|
+
variant = 'warning';
|
|
47
57
|
alertTitle = formatMessage({
|
|
48
58
|
id: 'notification.warning.title',
|
|
49
59
|
defaultMessage: 'Warning:',
|
|
50
60
|
});
|
|
51
|
-
variant = 'danger';
|
|
52
61
|
} else {
|
|
62
|
+
variant = 'success';
|
|
53
63
|
alertTitle = formatMessage({
|
|
54
64
|
id: 'notification.success.title',
|
|
55
65
|
defaultMessage: 'Success:',
|
|
56
66
|
});
|
|
57
|
-
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (title) {
|
|
70
|
+
alertTitle = typeof title === 'string' ? title : formatMessage(title);
|
|
58
71
|
}
|
|
59
72
|
|
|
60
73
|
return (
|
|
@@ -77,6 +90,7 @@ const Notification = ({ dispatch, notification }) => {
|
|
|
77
90
|
{formattedMessage({
|
|
78
91
|
id: message?.id || message,
|
|
79
92
|
defaultMessage: message?.defaultMessage || message?.id || message,
|
|
93
|
+
values: message?.values,
|
|
80
94
|
})}
|
|
81
95
|
</Alert>
|
|
82
96
|
);
|
|
@@ -124,6 +138,14 @@ Notification.propTypes = {
|
|
|
124
138
|
onClose: PropTypes.func,
|
|
125
139
|
timeout: PropTypes.number,
|
|
126
140
|
blockTransition: PropTypes.bool,
|
|
141
|
+
title: PropTypes.oneOfType([
|
|
142
|
+
PropTypes.string,
|
|
143
|
+
PropTypes.shape({
|
|
144
|
+
id: PropTypes.string.isRequired,
|
|
145
|
+
defaultMessage: PropTypes.string,
|
|
146
|
+
values: PropTypes.object,
|
|
147
|
+
}),
|
|
148
|
+
]),
|
|
127
149
|
}),
|
|
128
150
|
};
|
|
129
151
|
|
|
@@ -23,6 +23,7 @@ const notificationReducer = (state = initialState, action) =>
|
|
|
23
23
|
timeout: get(action, ['config', 'timeout'], 2500),
|
|
24
24
|
blockTransition: get(action, ['config', 'blockTransition'], false),
|
|
25
25
|
onClose: get(action, ['config', 'onClose'], null),
|
|
26
|
+
title: get(action, ['config', 'title'], null),
|
|
26
27
|
});
|
|
27
28
|
draftState.notifId = state.notifId + 1;
|
|
28
29
|
break;
|
|
@@ -43,12 +43,14 @@ export const RelationDragPreview = ({ status, displayedValue, width }) => {
|
|
|
43
43
|
<IconButton noBorder>
|
|
44
44
|
<Drag />
|
|
45
45
|
</IconButton>
|
|
46
|
-
<ChildrenWrapper justifyContent="space-between">
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
<ChildrenWrapper maxWidth="100%" justifyContent="space-between">
|
|
47
|
+
<Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>
|
|
48
|
+
<LinkEllipsis>
|
|
49
|
+
<Typography textColor="primary600" ellipsis>
|
|
50
|
+
{displayedValue}
|
|
51
|
+
</Typography>
|
|
52
|
+
</LinkEllipsis>
|
|
53
|
+
</Box>
|
|
52
54
|
{status && (
|
|
53
55
|
<Status variant={statusColor} showBullet={false} size="S">
|
|
54
56
|
<Typography fontWeight="bold" textColor={`${statusColor}700`}>
|
|
@@ -98,7 +98,7 @@ const DynamicZoneComponent = ({
|
|
|
98
98
|
|
|
99
99
|
const mainField = get(modifiedData, [name, index, mainFieldKey]) ?? '';
|
|
100
100
|
|
|
101
|
-
const displayedValue = mainFieldKey === 'id' ? '' : mainField.trim();
|
|
101
|
+
const displayedValue = mainFieldKey === 'id' ? '' : String(mainField).trim();
|
|
102
102
|
|
|
103
103
|
const mainValue = displayedValue.length > 0 ? ` - ${displayedValue}` : displayedValue;
|
|
104
104
|
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
getAPIInnerErrors,
|
|
22
22
|
} from '@strapi/helper-plugin';
|
|
23
23
|
|
|
24
|
-
import { getTrad
|
|
24
|
+
import { getTrad } from '../../utils';
|
|
25
25
|
|
|
26
26
|
import selectCrudReducer from '../../sharedReducers/crudReducer/selectors';
|
|
27
27
|
|
|
@@ -261,10 +261,11 @@ const EditViewDataManagerProvider = ({
|
|
|
261
261
|
});
|
|
262
262
|
}, []);
|
|
263
263
|
|
|
264
|
-
const relationLoad = useCallback(({ target: {
|
|
264
|
+
const relationLoad = useCallback(({ target: { initialDataPath, modifiedDataPath, value } }) => {
|
|
265
265
|
dispatch({
|
|
266
266
|
type: 'LOAD_RELATION',
|
|
267
|
-
|
|
267
|
+
modifiedDataPath,
|
|
268
|
+
initialDataPath,
|
|
268
269
|
value,
|
|
269
270
|
});
|
|
270
271
|
}, []);
|
|
@@ -360,11 +361,9 @@ const EditViewDataManagerProvider = ({
|
|
|
360
361
|
|
|
361
362
|
const createFormData = useCallback(
|
|
362
363
|
(modifiedData, initialData) => {
|
|
363
|
-
// First we need to remove the added keys needed for the dnd
|
|
364
|
-
const preparedData = removeKeyInObject(cloneDeep(modifiedData), '__temp_key__');
|
|
365
364
|
// Then we need to apply our helper
|
|
366
365
|
const cleanedData = cleanData(
|
|
367
|
-
{ browserState:
|
|
366
|
+
{ browserState: modifiedData, serverState: initialData },
|
|
368
367
|
currentContentTypeLayout,
|
|
369
368
|
allLayoutData.components
|
|
370
369
|
);
|
|
@@ -6,6 +6,8 @@ import take from 'lodash/take';
|
|
|
6
6
|
import cloneDeep from 'lodash/cloneDeep';
|
|
7
7
|
import uniqBy from 'lodash/uniqBy';
|
|
8
8
|
import merge from 'lodash/merge';
|
|
9
|
+
import castArray from 'lodash/castArray';
|
|
10
|
+
import isNil from 'lodash/isNil';
|
|
9
11
|
|
|
10
12
|
import {
|
|
11
13
|
findLeafByPathAndReplace,
|
|
@@ -148,22 +150,33 @@ const reducer = (state, action) =>
|
|
|
148
150
|
break;
|
|
149
151
|
}
|
|
150
152
|
case 'LOAD_RELATION': {
|
|
151
|
-
const initialDataPath =
|
|
152
|
-
const modifiedDataPath = ['modifiedData', ...action.keys];
|
|
153
|
-
const { value } = action;
|
|
153
|
+
const { initialDataPath, modifiedDataPath, value } = action;
|
|
154
154
|
|
|
155
155
|
const initialDataRelations = get(state, initialDataPath);
|
|
156
156
|
const modifiedDataRelations = get(state, modifiedDataPath);
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
/**
|
|
159
|
+
* Check if the values we're loading are already in initial
|
|
160
|
+
* data if they are then we don't need to load them at all
|
|
161
|
+
*/
|
|
162
|
+
const valuesToLoad = value.filter((relation) => {
|
|
163
|
+
return !initialDataRelations.some((initialDataRelation) => {
|
|
164
|
+
return initialDataRelation.id === relation.id;
|
|
165
|
+
});
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
set(draftState, initialDataPath, uniqBy([...valuesToLoad, ...initialDataRelations], 'id'));
|
|
159
169
|
|
|
160
170
|
/**
|
|
161
171
|
* We need to set the value also on modifiedData, because initialData
|
|
162
172
|
* and modifiedData need to stay in sync, so that the CM can compare
|
|
163
173
|
* both states, to render the dirty UI state
|
|
164
174
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
175
|
+
set(
|
|
176
|
+
draftState,
|
|
177
|
+
modifiedDataPath,
|
|
178
|
+
uniqBy([...valuesToLoad, ...modifiedDataRelations], 'id')
|
|
179
|
+
);
|
|
167
180
|
|
|
168
181
|
break;
|
|
169
182
|
}
|
|
@@ -247,6 +260,17 @@ const reducer = (state, action) =>
|
|
|
247
260
|
.reduce((acc, currentPaths) => {
|
|
248
261
|
const [componentName] = currentPaths;
|
|
249
262
|
|
|
263
|
+
const existingComponents = castArray(acc[componentName] || []);
|
|
264
|
+
existingComponents.reduce((result, currentEntry) => {
|
|
265
|
+
if (!isNil(get(currentEntry, [`__temp_key__`]))) {
|
|
266
|
+
return result;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
set(currentEntry, [`__temp_key__`], getMaxTempKey(result) + 1);
|
|
270
|
+
|
|
271
|
+
return result;
|
|
272
|
+
}, existingComponents);
|
|
273
|
+
|
|
250
274
|
if (state.modifiedData && get(state.modifiedData, componentName)) {
|
|
251
275
|
/**
|
|
252
276
|
* this will be null on initial load, however subsequent calls
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
2
|
import isArray from 'lodash/isArray';
|
|
3
3
|
import isObject from 'lodash/isObject';
|
|
4
|
+
import { getInitialDataPathUsingTempKeys } from '../../../utils/paths';
|
|
4
5
|
|
|
5
6
|
/* eslint-disable indent */
|
|
6
7
|
|
|
@@ -12,6 +13,8 @@ import isObject from 'lodash/isObject';
|
|
|
12
13
|
* @returns
|
|
13
14
|
*/
|
|
14
15
|
const cleanData = ({ browserState, serverState }, currentSchema, componentsSchema) => {
|
|
16
|
+
const rootServerState = serverState;
|
|
17
|
+
const rootBrowserState = browserState;
|
|
15
18
|
const getType = (schema, attrName) => get(schema, ['attributes', attrName, 'type'], '');
|
|
16
19
|
const getOtherInfos = (schema, arr) => get(schema, ['attributes', ...arr], '');
|
|
17
20
|
|
|
@@ -20,10 +23,12 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
|
|
20
23
|
* @param {object} browserState – the modifiedData from REDUX
|
|
21
24
|
* @param {object} serverState – the initialData from REDUX
|
|
22
25
|
* @param {*} schema
|
|
26
|
+
* @param {string} pathToParent - the path to the parent of the current entry
|
|
23
27
|
* @returns
|
|
24
28
|
*/
|
|
25
|
-
const recursiveCleanData = (browserState, serverState, schema) => {
|
|
29
|
+
const recursiveCleanData = (browserState, serverState, schema, pathToParent) => {
|
|
26
30
|
return Object.keys(browserState).reduce((acc, current) => {
|
|
31
|
+
const path = pathToParent ? `${pathToParent}.${current}` : current;
|
|
27
32
|
const attrType = getType(schema, current);
|
|
28
33
|
|
|
29
34
|
// This is the field value
|
|
@@ -61,7 +66,8 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
|
|
61
66
|
const subCleanedData = recursiveCleanData(
|
|
62
67
|
data,
|
|
63
68
|
(oldValue ?? [])[index],
|
|
64
|
-
componentsSchema[component]
|
|
69
|
+
componentsSchema[component],
|
|
70
|
+
`${path}.${index}`
|
|
65
71
|
);
|
|
66
72
|
|
|
67
73
|
return subCleanedData;
|
|
@@ -69,20 +75,25 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
|
|
69
75
|
: value;
|
|
70
76
|
} else {
|
|
71
77
|
cleanedData = value
|
|
72
|
-
? recursiveCleanData(value, oldValue, componentsSchema[component])
|
|
78
|
+
? recursiveCleanData(value, oldValue, componentsSchema[component], path)
|
|
73
79
|
: value;
|
|
74
80
|
}
|
|
75
81
|
|
|
76
82
|
break;
|
|
77
83
|
|
|
78
84
|
case 'relation': {
|
|
85
|
+
const trueInitialDataPath = getInitialDataPathUsingTempKeys(
|
|
86
|
+
rootServerState,
|
|
87
|
+
rootBrowserState
|
|
88
|
+
)(path).join('.');
|
|
89
|
+
|
|
79
90
|
/**
|
|
80
91
|
* Because of how repeatable components work when you dig into them the server
|
|
81
92
|
* will have no object to compare too therefore no relation array will be setup
|
|
82
93
|
* because the component has not been initialised, therefore we can safely assume
|
|
83
94
|
* it needs to be added and provide a default empty array.
|
|
84
95
|
*/
|
|
85
|
-
let actualOldValue =
|
|
96
|
+
let actualOldValue = get(rootServerState, trueInitialDataPath, []);
|
|
86
97
|
|
|
87
98
|
const valuesWithPositions = value.map((relation, index, allRelations) => {
|
|
88
99
|
const nextRelation = allRelations[index + 1];
|
|
@@ -141,7 +152,8 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
|
|
141
152
|
const subCleanedData = recursiveCleanData(
|
|
142
153
|
componentData,
|
|
143
154
|
(oldValue ?? [])[index],
|
|
144
|
-
componentsSchema[componentData.__component]
|
|
155
|
+
componentsSchema[componentData.__component],
|
|
156
|
+
`${path}.${index}`
|
|
145
157
|
);
|
|
146
158
|
|
|
147
159
|
return subCleanedData;
|
|
@@ -157,7 +169,7 @@ const cleanData = ({ browserState, serverState }, currentSchema, componentsSchem
|
|
|
157
169
|
}, {});
|
|
158
170
|
};
|
|
159
171
|
|
|
160
|
-
return recursiveCleanData(browserState, serverState, currentSchema);
|
|
172
|
+
return recursiveCleanData(browserState, serverState, currentSchema, '');
|
|
161
173
|
};
|
|
162
174
|
|
|
163
175
|
// TODO: check which parts are still needed: I suspect the
|
|
@@ -24,7 +24,8 @@ export const findLeafByPathAndReplace = (endpath, replaceWith) => {
|
|
|
24
24
|
* and the current path is not undefined in the accumulator
|
|
25
25
|
* then we assume it's a leaf and we can replace it.
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
|
|
28
|
+
if (ind === currentArr.length - 1 && endpath === curr && acc[curr] !== undefined) {
|
|
28
29
|
set(acc, curr, replaceWith);
|
|
29
30
|
|
|
30
31
|
return acc;
|
|
@@ -284,7 +284,8 @@ const createYupSchemaAttribute = (type, validations, options) => {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
if (type === 'boolean') {
|
|
287
|
-
|
|
287
|
+
// Boolean value can be undefined/unset in modifiedData when generated in a new component
|
|
288
|
+
return value !== null && value !== undefined;
|
|
288
289
|
}
|
|
289
290
|
|
|
290
291
|
if (type === 'date' || type === 'datetime') {
|
|
@@ -4,20 +4,22 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import size from 'lodash/size';
|
|
5
5
|
import isEqual from 'react-fast-compare';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
|
+
|
|
7
8
|
import { NotAllowedInput } from '@strapi/helper-plugin';
|
|
8
9
|
import Trash from '@strapi/icons/Trash';
|
|
9
10
|
import { Box } from '@strapi/design-system/Box';
|
|
10
11
|
import { IconButton } from '@strapi/design-system/IconButton';
|
|
11
12
|
import { Flex } from '@strapi/design-system/Flex';
|
|
12
13
|
import { Stack } from '@strapi/design-system/Stack';
|
|
13
|
-
|
|
14
|
-
import ComponentInitializer from '../ComponentInitializer';
|
|
15
|
-
import NonRepeatableComponent from '../NonRepeatableComponent';
|
|
16
|
-
import RepeatableComponent from '../RepeatableComponent';
|
|
14
|
+
|
|
17
15
|
import connect from './utils/connect';
|
|
18
16
|
import select from './utils/select';
|
|
19
17
|
import Label from './Label';
|
|
18
|
+
import ComponentInitializer from '../ComponentInitializer';
|
|
19
|
+
import NonRepeatableComponent from '../NonRepeatableComponent';
|
|
20
|
+
import RepeatableComponent from '../RepeatableComponent';
|
|
20
21
|
import { useContentTypeLayout } from '../../hooks';
|
|
22
|
+
import { getTrad } from '../../utils';
|
|
21
23
|
|
|
22
24
|
const FieldComponent = ({
|
|
23
25
|
addNonRepeatableComponentToField,
|
|
@@ -38,12 +38,13 @@ export const LinkEllipsis = styled(Link)`
|
|
|
38
38
|
|
|
39
39
|
export const DisconnectButton = styled.button`
|
|
40
40
|
svg path {
|
|
41
|
-
fill: ${({ theme }) =>
|
|
41
|
+
fill: ${({ theme, disabled }) =>
|
|
42
|
+
disabled ? theme.colors.neutral600 : theme.colors.neutral500};
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
&:hover svg path,
|
|
45
46
|
&:focus svg path {
|
|
46
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
47
|
+
fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};
|
|
47
48
|
}
|
|
48
49
|
`;
|
|
49
50
|
|
|
@@ -103,8 +104,7 @@ const RelationInput = ({
|
|
|
103
104
|
);
|
|
104
105
|
|
|
105
106
|
const shouldDisplayLoadMoreButton =
|
|
106
|
-
(!!labelLoadMore &&
|
|
107
|
-
paginatedRelations.isLoading;
|
|
107
|
+
(!!labelLoadMore && paginatedRelations.hasNextPage) || paginatedRelations.isLoading;
|
|
108
108
|
|
|
109
109
|
const options = useMemo(
|
|
110
110
|
() =>
|
|
@@ -473,7 +473,7 @@ const ListItem = ({ data, index, style }) => {
|
|
|
473
473
|
ariaDescribedBy={ariaDescribedBy}
|
|
474
474
|
canDrag={canDrag}
|
|
475
475
|
disabled={disabled}
|
|
476
|
-
displayValue={mainField ?? id}
|
|
476
|
+
displayValue={String(mainField ?? id)}
|
|
477
477
|
iconButtonAriaLabel={iconButtonAriaLabel}
|
|
478
478
|
id={id}
|
|
479
479
|
index={index}
|
|
@@ -503,9 +503,7 @@ const ListItem = ({ data, index, style }) => {
|
|
|
503
503
|
<Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>
|
|
504
504
|
<Tooltip description={mainField ?? `${id}`}>
|
|
505
505
|
{href ? (
|
|
506
|
-
<LinkEllipsis to={href}
|
|
507
|
-
{mainField ?? id}
|
|
508
|
-
</LinkEllipsis>
|
|
506
|
+
<LinkEllipsis to={href}>{mainField ?? id}</LinkEllipsis>
|
|
509
507
|
) : (
|
|
510
508
|
<Typography textColor={disabled ? 'neutral600' : 'primary600'} ellipsis>
|
|
511
509
|
{mainField ?? id}
|
|
@@ -16,6 +16,10 @@ export const StackWrapper = styled(Stack)`
|
|
|
16
16
|
width: 100%;
|
|
17
17
|
/* Used to prevent endAction to be pushed out of container */
|
|
18
18
|
min-width: 0;
|
|
19
|
+
|
|
20
|
+
& > div[role='button'] {
|
|
21
|
+
cursor: all-scroll;
|
|
22
|
+
}
|
|
19
23
|
`;
|
|
20
24
|
|
|
21
25
|
export const ChildrenWrapper = styled(Flex)`
|
|
@@ -83,8 +87,8 @@ export const RelationItem = ({
|
|
|
83
87
|
paddingRight={4}
|
|
84
88
|
hasRadius
|
|
85
89
|
borderSize={1}
|
|
86
|
-
background={disabled ? 'neutral150' : 'neutral0'}
|
|
87
90
|
borderColor="neutral200"
|
|
91
|
+
background={disabled ? 'neutral150' : 'neutral0'}
|
|
88
92
|
justifyContent="space-between"
|
|
89
93
|
ref={canDrag ? composedRefs : undefined}
|
|
90
94
|
data-handler-id={handlerId}
|
|
@@ -99,6 +103,7 @@ export const RelationItem = ({
|
|
|
99
103
|
aria-label={iconButtonAriaLabel}
|
|
100
104
|
noBorder
|
|
101
105
|
onKeyDown={handleKeyDown}
|
|
106
|
+
disabled={disabled}
|
|
102
107
|
>
|
|
103
108
|
<Drag />
|
|
104
109
|
</IconButton>
|
|
@@ -18,18 +18,22 @@ const ShadowBox = styled(Box)`
|
|
|
18
18
|
|
|
19
19
|
&:before {
|
|
20
20
|
/* TODO: as for DS Table component we would need this to be handled by the DS theme */
|
|
21
|
-
content:
|
|
22
|
-
|
|
23
|
-
background: linear-gradient(rgba(33, 33, 52, 0.1) 0%, rgba(0, 0, 0, 0) 100%);
|
|
21
|
+
content: '';
|
|
22
|
+
background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
|
|
24
23
|
top: 0;
|
|
24
|
+
opacity: ${({ overflowDirection }) =>
|
|
25
|
+
overflowDirection === 'top-bottom' || overflowDirection === 'top' ? 1 : 0};
|
|
26
|
+
transition: opacity 0.2s ease-in-out;
|
|
25
27
|
}
|
|
26
28
|
|
|
27
29
|
&:after {
|
|
28
30
|
/* TODO: as for DS Table component we would need this to be handled by the DS theme */
|
|
29
|
-
content:
|
|
30
|
-
|
|
31
|
-
background: linear-gradient(rgba(0, 0, 0, 0) 0%, rgba(33, 33, 52, 0.1) 100%);
|
|
31
|
+
content: '';
|
|
32
|
+
background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
|
|
32
33
|
bottom: 0;
|
|
34
|
+
opacity: ${({ overflowDirection }) =>
|
|
35
|
+
overflowDirection === 'top-bottom' || overflowDirection === 'bottom' ? 1 : 0};
|
|
36
|
+
transition: opacity 0.2s ease-in-out;
|
|
33
37
|
}
|
|
34
38
|
`;
|
|
35
39
|
|
package/admin/src/content-manager/components/RelationInputDataManager/RelationInputDataManager.js
CHANGED
|
@@ -15,6 +15,7 @@ import { getTrad } from '../../utils';
|
|
|
15
15
|
|
|
16
16
|
import { PUBLICATION_STATES, RELATIONS_TO_DISPLAY, SEARCH_RESULTS_TO_DISPLAY } from './constants';
|
|
17
17
|
import { connect, select, normalizeSearchResults, diffRelations, normalizeRelation } from './utils';
|
|
18
|
+
import { getInitialDataPathUsingTempKeys } from '../../utils/paths';
|
|
18
19
|
|
|
19
20
|
export const RelationInputDataManager = ({
|
|
20
21
|
error,
|
|
@@ -37,7 +38,6 @@ export const RelationInputDataManager = ({
|
|
|
37
38
|
targetModel,
|
|
38
39
|
}) => {
|
|
39
40
|
const [liveText, setLiveText] = useState('');
|
|
40
|
-
|
|
41
41
|
const { formatMessage } = useIntl();
|
|
42
42
|
const {
|
|
43
43
|
slug,
|
|
@@ -49,12 +49,16 @@ export const RelationInputDataManager = ({
|
|
|
49
49
|
relationReorder,
|
|
50
50
|
} = useCMEditViewDataManager();
|
|
51
51
|
|
|
52
|
+
const nameSplit = name.split('.');
|
|
53
|
+
|
|
54
|
+
const initialDataPath = getInitialDataPathUsingTempKeys(initialData, modifiedData)(name);
|
|
55
|
+
|
|
52
56
|
const relationsFromModifiedData = get(modifiedData, name, []);
|
|
53
57
|
|
|
54
58
|
const currentLastPage = Math.ceil(get(initialData, name, []).length / RELATIONS_TO_DISPLAY);
|
|
55
59
|
|
|
56
|
-
const
|
|
57
|
-
|
|
60
|
+
const cacheKey = `${slug}-${initialDataPath.join('.')}`;
|
|
61
|
+
const { relations, search, searchFor } = useRelation(cacheKey, {
|
|
58
62
|
relation: {
|
|
59
63
|
enabled: !!endpoints.relation,
|
|
60
64
|
endpoint: endpoints.relation,
|
|
@@ -63,14 +67,21 @@ export const RelationInputDataManager = ({
|
|
|
63
67
|
...defaultParams,
|
|
64
68
|
pageSize: RELATIONS_TO_DISPLAY,
|
|
65
69
|
},
|
|
66
|
-
onLoad
|
|
70
|
+
onLoad(value) {
|
|
71
|
+
relationLoad({
|
|
72
|
+
target: {
|
|
73
|
+
initialDataPath: ['initialData', ...initialDataPath],
|
|
74
|
+
modifiedDataPath: ['modifiedData', ...nameSplit],
|
|
75
|
+
value,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
},
|
|
67
79
|
normalizeArguments: {
|
|
68
80
|
mainFieldName: mainField.name,
|
|
69
81
|
shouldAddLink: shouldDisplayRelationLink,
|
|
70
82
|
targetModel,
|
|
71
83
|
},
|
|
72
84
|
},
|
|
73
|
-
|
|
74
85
|
search: {
|
|
75
86
|
endpoint: endpoints.search,
|
|
76
87
|
pageParams: {
|
|
@@ -257,7 +268,7 @@ export const RelationInputDataManager = ({
|
|
|
257
268
|
* actually subtract from the total number on the server (regardless of how many you fetched).
|
|
258
269
|
*/
|
|
259
270
|
const browserRelationsCount = relationsFromModifiedData.length;
|
|
260
|
-
const serverRelationsCount = (get(initialData,
|
|
271
|
+
const serverRelationsCount = (get(initialData, initialDataPath) ?? []).length;
|
|
261
272
|
const realServerRelationsCount = relations.data?.pages[0]?.pagination?.total ?? 0;
|
|
262
273
|
/**
|
|
263
274
|
* _IF_ theres no relations data and the browserCount is the same as serverCount you can therefore assume
|