@strapi/admin 4.6.0-beta.0 → 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/AuthenticatedApp/index.js +13 -2
- package/admin/src/components/GlobalStyle/index.js +0 -11
- 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/ComponentIcon/ComponentIcon.js +49 -0
- package/admin/src/content-manager/components/ComponentIcon/index.js +1 -0
- package/admin/src/content-manager/components/DragLayer/ComponentDragPreview.js +2 -16
- package/admin/src/content-manager/components/DragLayer/RelationDragPreview.js +9 -7
- package/admin/src/content-manager/components/DragLayer/index.js +1 -1
- package/admin/src/content-manager/components/DynamicTable/CellContent/RelationMultiple/index.js +4 -0
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCard.js +17 -31
- package/admin/src/content-manager/components/DynamicZone/components/ComponentCategory.js +2 -2
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +1 -3
- package/admin/src/content-manager/components/EditViewDataManagerProvider/index.js +5 -6
- package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +49 -8
- 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/InputJSON/FieldWrapper.js +10 -2
- package/admin/src/content-manager/components/InputJSON/Label.js +2 -18
- package/admin/src/content-manager/components/InputJSON/index.js +7 -3
- package/admin/src/content-manager/components/RelationInput/RelationInput.js +14 -25
- package/admin/src/content-manager/components/RelationInput/components/RelationItem.js +8 -1
- package/admin/src/content-manager/components/RelationInput/components/RelationList.js +10 -6
- package/admin/src/content-manager/components/RelationInput/index.js +1 -0
- 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 +19 -26
- package/admin/src/content-manager/hooks/useCallbackRef.js +23 -0
- package/admin/src/content-manager/hooks/useDragAndDrop.js +26 -12
- 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/EditSettingsView/components/DynamicZoneList.js +18 -38
- 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/Admin/Onboarding/index.js +42 -44
- package/admin/src/pages/App/index.js +20 -12
- package/admin/src/pages/AuthPage/components/Register/index.js +1 -1
- package/admin/src/pages/AuthPage/components/ResetPassword/index.js +1 -1
- package/admin/src/pages/ProfilePage/index.js +1 -1
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +2 -3
- 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 +43 -1
- 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/sk.json +274 -52
- package/admin/src/translations/tr.json +485 -5
- package/admin/src/translations/zh-Hans.json +1 -1
- package/admin/src/translations/zh.json +11 -3
- package/admin/src/utils/index.js +1 -0
- package/admin/src/utils/uniqueAdminHash.js +22 -0
- 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/services/passport/provider-registry.js +1 -1
- package/ee/server/validation/audit-logs.js +18 -0
- package/package.json +21 -17
- package/server/controllers/admin.js +2 -0
- 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/admin.js +1 -1
- package/server/routes/authentication.js +12 -1
- package/server/routes/roles.js +0 -8
- package/server/services/metrics.js +5 -2
- package/server/services/permission/queries.js +12 -3
- package/server/services/role.js +12 -2
- package/server/services/user.js +23 -3
- package/webpack.alias.js +0 -2
- package/webpack.config.js +7 -4
- package/admin/src/content-manager/components/BackHeader/index.js +0 -8
- package/admin/src/content-manager/components/Block/components.js +0 -28
- package/admin/src/content-manager/components/Block/index.js +0 -43
- package/admin/src/content-manager/components/Container/index.js +0 -7
- package/admin/src/content-manager/components/CustomInputCheckbox/components.js +0 -77
- package/admin/src/content-manager/components/CustomInputCheckbox/index.js +0 -53
- package/admin/src/content-manager/components/DynamicComponentCard/Wrapper.js +0 -63
- package/admin/src/content-manager/components/FilterOptionsCTA/index.js +0 -14
- package/admin/src/content-manager/components/FormTitle/index.js +0 -22
- package/admin/src/content-manager/components/FormWrapper/index.js +0 -20
- package/admin/src/content-manager/components/InputJSON/FieldError.js +0 -38
- package/admin/src/content-manager/components/LayoutTitle/index.js +0 -19
- package/admin/src/content-manager/components/PlusButton/index.js +0 -52
- package/admin/src/content-manager/components/PreviewCarret/components.js +0 -27
- package/admin/src/content-manager/components/PreviewCarret/index.js +0 -22
- package/admin/src/content-manager/components/SectionTitle/Title.js +0 -11
- package/admin/src/content-manager/components/SectionTitle/index.js +0 -26
- 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/1551f4f60c37af51121f.woff2 +0 -0
- package/build/1e59d2330b4c6deb84b3.ttf +0 -0
- package/build/20fd1704ea223900efa9.woff2 +0 -0
- package/build/2285773e6b4b172f07d9.woff +0 -0
- package/build/23f19bb08961f37aaf69.eot +0 -0
- package/build/2f517e09eb2ca6650ff5.svg +0 -3717
- package/build/4306.df40a798.chunk.js +0 -98
- package/build/4318.80bdf035.chunk.js +0 -30
- package/build/4689f52cc96215721344.svg +0 -801
- package/build/491974d108fe4002b2aa.ttf +0 -0
- package/build/5015.f080b64e.chunk.js +0 -6
- package/build/504.9aeff724.chunk.js +0 -758
- package/build/5057.195a59ff.chunk.js +0 -65
- package/build/527940b104eb2ea366c8.ttf +0 -0
- package/build/77206a6bb316fa0aded5.eot +0 -0
- package/build/7a3337626410ca2f4071.woff2 +0 -0
- package/build/7a8b4f130182d19a2d7c.svg +0 -5034
- package/build/805.e991a370.chunk.js +0 -138
- package/build/8176.b19bc128.chunk.js +0 -145
- package/build/8186.55910742.chunk.js +0 -169
- package/build/8633.59223842.chunk.js +0 -1
- package/build/8881.c693411a.chunk.js +0 -245
- package/build/8b43027f47b20503057d.eot +0 -0
- package/build/9161.4a0ab137.chunk.js +0 -2119
- package/build/9279.6290c87a.chunk.js +0 -117
- package/build/9707.a0cc4ad8.chunk.js +0 -70
- package/build/9bbb245e67a133f6e486.eot +0 -0
- package/build/Admin-authenticatedApp.f9e74dc0.chunk.js +0 -80
- 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.3c872de7.chunk.js +0 -6
- package/build/Admin_profilePage.c07bdf08.chunk.js +0 -15
- package/build/Admin_settingsPage.50a8765b.chunk.js +0 -178
- package/build/admin-app.2861b6d2.chunk.js +0 -112
- package/build/admin-edit-roles-page.f407538c.chunk.js +0 -1
- package/build/admin-edit-users.85231e4c.chunk.js +0 -10
- package/build/admin-users.a2707644.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.700e575f.chunk.js +0 -16
- package/build/ar-json.3489463d.chunk.js +0 -1
- package/build/bb58e57c48a3e911f15f.woff +0 -0
- package/build/be9ee23c0c6390141475.ttf +0 -0
- package/build/c1e38fd9e0e74ba58f7a.svg +0 -2671
- 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.ee948f75.chunk.js +0 -1186
- package/build/content-type-builder-list-view.4412efc3.chunk.js +0 -201
- 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.0d7696b9.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.4729f055.chunk.js +0 -1
- package/build/content-type-builder-translation-en-json.f985c9c4.chunk.js +0 -1
- package/build/content-type-builder-translation-es-json.333cf47f.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.51201b12.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.4a42349b.chunk.js +0 -1
- package/build/content-type-builder-translation-pt-BR-json.6fe3b8d1.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.6deff030.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.2e52bc60.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.3b0afd31.chunk.js +0 -1
- package/build/content-type-builder.b132b5f4.chunk.js +0 -145
- package/build/cropper-css.12fe038c.chunk.js +0 -306
- package/build/cs-json.ce49da5c.chunk.js +0 -1
- package/build/d878b0a6a1144760244f.woff2 +0 -0
- package/build/de-json.6b3e1894.chunk.js +0 -1
- package/build/dk-json.144c6a8e.chunk.js +0 -1
- package/build/eeccf4f66002c6f2ba24.woff +0 -0
- package/build/email-settings-page.db0d98d1.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.87f2feb3.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.4a56dca7.chunk.js +0 -1
- package/build/es-json.6d123a82.chunk.js +0 -1
- package/build/f691f37e57f04c152e23.woff +0 -0
- package/build/fontawesome-css-all.15068c6e.chunk.js +0 -4618
- package/build/fontawesome-css.418f40da.chunk.js +0 -6
- package/build/fontawesome-js.252cc5f3.chunk.js +0 -7
- 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.195d42fe.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-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.faac89ee.js +0 -2025
- 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.75a15b8e.js +0 -2
- package/build/sa-json.44e95991.chunk.js +0 -1
- package/build/sk-json.7ba4b330.chunk.js +0 -1
- package/build/sso-settings-page.adb12ac3.chunk.js +0 -1
- package/build/sv-json.fb1081ff.chunk.js +0 -1
- package/build/th-json.a67309b1.chunk.js +0 -1
- package/build/tr-json.9c44ea0c.chunk.js +0 -1
- package/build/uk-json.c4cd2e24.chunk.js +0 -1
- package/build/upload-settings.450cab1a.chunk.js +0 -18
- 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.86da7b0a.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.b03d4904.chunk.js +0 -1
- package/build/upload-translation-th-json.9e1fda51.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.e2034370.chunk.js +0 -64
- package/build/users-advanced-settings-page.0c0b8230.chunk.js +0 -13
- package/build/users-email-settings-page.3126ff8c.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.fe39c74b.chunk.js +0 -1
- package/build/users-permissions-translation-en-json.765abf48.chunk.js +0 -1
- package/build/users-permissions-translation-es-json.1bb9cde2.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.3be77775.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.1dbdd4a1.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.d5d11648.chunk.js +0 -1
- package/build/users-permissions-translation-th-json.68873214.chunk.js +0 -1
- package/build/users-permissions-translation-tr-json.cdc49a3c.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.92f406f9.chunk.js +0 -1
- package/build/users-providers-settings-page.b7b602e2.chunk.js +0 -33
- package/build/users-roles-settings-page.ce5b582d.chunk.js +0 -30
- package/build/vi-json.f7890025.chunk.js +0 -1
- package/build/webhook-edit-page.1215a6b7.chunk.js +0 -75
- package/build/webhook-list-page.b87821f2.chunk.js +0 -42
- package/build/zh-Hans-json.21617c24.chunk.js +0 -1
- package/build/zh-json.2ecc6b99.chunk.js +0 -1
|
@@ -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,
|
|
@@ -3,12 +3,18 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { Field } from '@strapi/design-system/Field';
|
|
5
5
|
|
|
6
|
-
const FieldWrapper = ({ name, hint, error, children }) => {
|
|
6
|
+
const FieldWrapper = ({ name, hint, error, children, required }) => {
|
|
7
7
|
const { formatMessage } = useIntl();
|
|
8
8
|
const errorMessage = error ? formatMessage({ id: error, defaultMessage: error }) : '';
|
|
9
9
|
|
|
10
10
|
return (
|
|
11
|
-
<Field
|
|
11
|
+
<Field
|
|
12
|
+
name={name}
|
|
13
|
+
hint={hint && formatMessage(hint)}
|
|
14
|
+
error={errorMessage}
|
|
15
|
+
id={name}
|
|
16
|
+
required={required}
|
|
17
|
+
>
|
|
12
18
|
{children}
|
|
13
19
|
</Field>
|
|
14
20
|
);
|
|
@@ -17,6 +23,7 @@ const FieldWrapper = ({ name, hint, error, children }) => {
|
|
|
17
23
|
FieldWrapper.defaultProps = {
|
|
18
24
|
hint: undefined,
|
|
19
25
|
error: '',
|
|
26
|
+
required: false,
|
|
20
27
|
};
|
|
21
28
|
|
|
22
29
|
FieldWrapper.propTypes = {
|
|
@@ -27,6 +34,7 @@ FieldWrapper.propTypes = {
|
|
|
27
34
|
}),
|
|
28
35
|
error: PropTypes.string,
|
|
29
36
|
children: PropTypes.node.isRequired,
|
|
37
|
+
required: PropTypes.bool,
|
|
30
38
|
};
|
|
31
39
|
|
|
32
40
|
export default FieldWrapper;
|
|
@@ -1,18 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import styled from 'styled-components';
|
|
4
3
|
import { useIntl } from 'react-intl';
|
|
5
4
|
import { FieldLabel } from '@strapi/design-system/Field';
|
|
6
|
-
import { Box } from '@strapi/design-system/Box';
|
|
7
|
-
import { Flex } from '@strapi/design-system/Flex';
|
|
8
5
|
|
|
9
|
-
const
|
|
10
|
-
svg path {
|
|
11
|
-
fill: ${({ theme }) => theme.colors.neutral500};
|
|
12
|
-
}
|
|
13
|
-
`;
|
|
14
|
-
|
|
15
|
-
const Label = ({ intlLabel, labelAction, name, required }) => {
|
|
6
|
+
const Label = ({ intlLabel, labelAction, name }) => {
|
|
16
7
|
const { formatMessage } = useIntl();
|
|
17
8
|
const label = intlLabel?.id
|
|
18
9
|
? formatMessage(
|
|
@@ -21,19 +12,13 @@ const Label = ({ intlLabel, labelAction, name, required }) => {
|
|
|
21
12
|
)
|
|
22
13
|
: name;
|
|
23
14
|
|
|
24
|
-
return
|
|
25
|
-
<Flex>
|
|
26
|
-
<FieldLabel required={required}>{label}</FieldLabel>
|
|
27
|
-
{labelAction && <LabelAction paddingLeft={1}>{labelAction}</LabelAction>}
|
|
28
|
-
</Flex>
|
|
29
|
-
);
|
|
15
|
+
return <FieldLabel action={labelAction}>{label}</FieldLabel>;
|
|
30
16
|
};
|
|
31
17
|
|
|
32
18
|
Label.defaultProps = {
|
|
33
19
|
id: undefined,
|
|
34
20
|
intlLabel: undefined,
|
|
35
21
|
labelAction: undefined,
|
|
36
|
-
required: false,
|
|
37
22
|
};
|
|
38
23
|
|
|
39
24
|
Label.propTypes = {
|
|
@@ -45,7 +30,6 @@ Label.propTypes = {
|
|
|
45
30
|
}),
|
|
46
31
|
labelAction: PropTypes.element,
|
|
47
32
|
name: PropTypes.string.isRequired,
|
|
48
|
-
required: PropTypes.bool,
|
|
49
33
|
};
|
|
50
34
|
|
|
51
35
|
export default Label;
|
|
@@ -157,13 +157,17 @@ class InputJSON extends React.Component {
|
|
|
157
157
|
}
|
|
158
158
|
|
|
159
159
|
return (
|
|
160
|
-
<FieldWrapper
|
|
160
|
+
<FieldWrapper
|
|
161
|
+
name={this.props.name}
|
|
162
|
+
hint={this.props.description}
|
|
163
|
+
error={this.props.error}
|
|
164
|
+
required={this.props.required}
|
|
165
|
+
>
|
|
161
166
|
<Stack spacing={1}>
|
|
162
167
|
<Label
|
|
163
168
|
intlLabel={this.props.intlLabel}
|
|
164
|
-
labelAction={this.props.labelAction}
|
|
165
169
|
name={this.props.name}
|
|
166
|
-
|
|
170
|
+
labelAction={this.props.labelAction}
|
|
167
171
|
/>
|
|
168
172
|
<StyledBox error={this.props.error}>
|
|
169
173
|
<EditorWrapper disabled={this.props.disabled}>
|
|
@@ -25,30 +25,26 @@ import { RELATION_GUTTER, RELATION_ITEM_HEIGHT } from './constants';
|
|
|
25
25
|
|
|
26
26
|
import { usePrev } from '../../hooks';
|
|
27
27
|
|
|
28
|
-
const LinkEllipsis = styled(Link)`
|
|
29
|
-
|
|
30
|
-
overflow: hidden;
|
|
31
|
-
text-overflow: ellipsis;
|
|
32
|
-
display: inherit;
|
|
33
|
-
`;
|
|
28
|
+
export const LinkEllipsis = styled(Link)`
|
|
29
|
+
display: block;
|
|
34
30
|
|
|
35
|
-
export const BoxEllipsis = styled(Box)`
|
|
36
31
|
> span {
|
|
37
32
|
white-space: nowrap;
|
|
38
33
|
overflow: hidden;
|
|
39
34
|
text-overflow: ellipsis;
|
|
40
|
-
display:
|
|
35
|
+
display: block;
|
|
41
36
|
}
|
|
42
37
|
`;
|
|
43
38
|
|
|
44
39
|
export const DisconnectButton = styled.button`
|
|
45
40
|
svg path {
|
|
46
|
-
fill: ${({ theme }) =>
|
|
41
|
+
fill: ${({ theme, disabled }) =>
|
|
42
|
+
disabled ? theme.colors.neutral600 : theme.colors.neutral500};
|
|
47
43
|
}
|
|
48
44
|
|
|
49
45
|
&:hover svg path,
|
|
50
46
|
&:focus svg path {
|
|
51
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
47
|
+
fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};
|
|
52
48
|
}
|
|
53
49
|
`;
|
|
54
50
|
|
|
@@ -108,8 +104,7 @@ const RelationInput = ({
|
|
|
108
104
|
);
|
|
109
105
|
|
|
110
106
|
const shouldDisplayLoadMoreButton =
|
|
111
|
-
(!!labelLoadMore &&
|
|
112
|
-
paginatedRelations.isLoading;
|
|
107
|
+
(!!labelLoadMore && paginatedRelations.hasNextPage) || paginatedRelations.isLoading;
|
|
113
108
|
|
|
114
109
|
const options = useMemo(
|
|
115
110
|
() =>
|
|
@@ -267,15 +262,13 @@ const RelationInput = ({
|
|
|
267
262
|
const ariaDescriptionId = `${name}-item-instructions`;
|
|
268
263
|
|
|
269
264
|
return (
|
|
270
|
-
<Field error={error} name={name} hint={description} id={id}>
|
|
265
|
+
<Field error={error} name={name} hint={description} id={id} required={required}>
|
|
271
266
|
<Relation
|
|
272
267
|
totalNumberOfRelations={totalNumberOfRelations}
|
|
273
268
|
size={size}
|
|
274
269
|
search={
|
|
275
270
|
<>
|
|
276
|
-
<FieldLabel action={labelAction}
|
|
277
|
-
{label}
|
|
278
|
-
</FieldLabel>
|
|
271
|
+
<FieldLabel action={labelAction}>{label}</FieldLabel>
|
|
279
272
|
<ReactSelect
|
|
280
273
|
// position fixed doesn't update position on scroll
|
|
281
274
|
// react select doesn't update menu position on options change
|
|
@@ -352,9 +345,7 @@ const RelationInput = ({
|
|
|
352
345
|
relations,
|
|
353
346
|
updatePositionOfRelation: handleUpdatePositionOfRelation,
|
|
354
347
|
}}
|
|
355
|
-
itemKey={(index
|
|
356
|
-
`${relationsItems[index].mainField}_${relationsItems[index].id}`
|
|
357
|
-
}
|
|
348
|
+
itemKey={(index) => `${relations[index].mainField}_${relations[index].id}`}
|
|
358
349
|
innerElementType="ol"
|
|
359
350
|
>
|
|
360
351
|
{ListItem}
|
|
@@ -482,7 +473,7 @@ const ListItem = ({ data, index, style }) => {
|
|
|
482
473
|
ariaDescribedBy={ariaDescribedBy}
|
|
483
474
|
canDrag={canDrag}
|
|
484
475
|
disabled={disabled}
|
|
485
|
-
displayValue={mainField ?? id}
|
|
476
|
+
displayValue={String(mainField ?? id)}
|
|
486
477
|
iconButtonAriaLabel={iconButtonAriaLabel}
|
|
487
478
|
id={id}
|
|
488
479
|
index={index}
|
|
@@ -509,19 +500,17 @@ const ListItem = ({ data, index, style }) => {
|
|
|
509
500
|
}}
|
|
510
501
|
updatePositionOfRelation={updatePositionOfRelation}
|
|
511
502
|
>
|
|
512
|
-
<
|
|
503
|
+
<Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>
|
|
513
504
|
<Tooltip description={mainField ?? `${id}`}>
|
|
514
505
|
{href ? (
|
|
515
|
-
<LinkEllipsis to={href}
|
|
516
|
-
{mainField ?? id}
|
|
517
|
-
</LinkEllipsis>
|
|
506
|
+
<LinkEllipsis to={href}>{mainField ?? id}</LinkEllipsis>
|
|
518
507
|
) : (
|
|
519
508
|
<Typography textColor={disabled ? 'neutral600' : 'primary600'} ellipsis>
|
|
520
509
|
{mainField ?? id}
|
|
521
510
|
</Typography>
|
|
522
511
|
)}
|
|
523
512
|
</Tooltip>
|
|
524
|
-
</
|
|
513
|
+
</Box>
|
|
525
514
|
|
|
526
515
|
{publicationState && (
|
|
527
516
|
<Status variant={statusColor} showBullet={false} size="S">
|
|
@@ -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)`
|
|
@@ -50,11 +54,13 @@ export const RelationItem = ({
|
|
|
50
54
|
item: {
|
|
51
55
|
displayedValue: displayValue,
|
|
52
56
|
status,
|
|
57
|
+
id,
|
|
53
58
|
},
|
|
54
59
|
onGrabItem,
|
|
55
60
|
onDropItem,
|
|
56
61
|
onCancel,
|
|
57
62
|
onMoveItem: updatePositionOfRelation,
|
|
63
|
+
dropSensitivity: 'immediate',
|
|
58
64
|
});
|
|
59
65
|
|
|
60
66
|
const composedRefs = composeRefs(relationRef, dragRef);
|
|
@@ -81,8 +87,8 @@ export const RelationItem = ({
|
|
|
81
87
|
paddingRight={4}
|
|
82
88
|
hasRadius
|
|
83
89
|
borderSize={1}
|
|
84
|
-
background={disabled ? 'neutral150' : 'neutral0'}
|
|
85
90
|
borderColor="neutral200"
|
|
91
|
+
background={disabled ? 'neutral150' : 'neutral0'}
|
|
86
92
|
justifyContent="space-between"
|
|
87
93
|
ref={canDrag ? composedRefs : undefined}
|
|
88
94
|
data-handler-id={handlerId}
|
|
@@ -97,6 +103,7 @@ export const RelationItem = ({
|
|
|
97
103
|
aria-label={iconButtonAriaLabel}
|
|
98
104
|
noBorder
|
|
99
105
|
onKeyDown={handleKeyDown}
|
|
106
|
+
disabled={disabled}
|
|
100
107
|
>
|
|
101
108
|
<Drag />
|
|
102
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
|
|
@@ -17,7 +17,7 @@ function useSelect({
|
|
|
17
17
|
readActionAllowedFields,
|
|
18
18
|
updateActionAllowedFields,
|
|
19
19
|
slug,
|
|
20
|
-
|
|
20
|
+
modifiedData,
|
|
21
21
|
} = useCMEditViewDataManager();
|
|
22
22
|
|
|
23
23
|
const isFieldAllowed = useMemo(() => {
|
|
@@ -50,7 +50,7 @@ function useSelect({
|
|
|
50
50
|
let componentId;
|
|
51
51
|
|
|
52
52
|
if (componentUid) {
|
|
53
|
-
componentId = get(
|
|
53
|
+
componentId = get(modifiedData, fieldNameKeys.slice(0, -1))?.id;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// /content-manager/relations/[model]/[id]/[field-name]
|
|
@@ -61,15 +61,15 @@ function useSelect({
|
|
|
61
61
|
|
|
62
62
|
if (componentUid) {
|
|
63
63
|
// repeatable components and dz are dynamically created
|
|
64
|
-
// if no componentId exists in
|
|
64
|
+
// if no componentId exists in modifiedData it means that the user just created it
|
|
65
65
|
// there then are no relations to request
|
|
66
66
|
return componentId
|
|
67
67
|
? getRequestUrl(`relations/${componentUid}/${componentId}/${fieldNameKeys.at(-1)}`)
|
|
68
68
|
: null;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
return getRequestUrl(`relations/${slug}/${
|
|
72
|
-
}, [isCreatingEntry, componentUid, slug,
|
|
71
|
+
return getRequestUrl(`relations/${slug}/${modifiedData.id}/${name.split('.').at(-1)}`);
|
|
72
|
+
}, [isCreatingEntry, componentUid, slug, modifiedData.id, name, componentId, fieldNameKeys]);
|
|
73
73
|
|
|
74
74
|
// /content-manager/relations/[model]/[field-name]
|
|
75
75
|
const relationSearchEndpoint = useMemo(() => {
|
|
@@ -51,9 +51,7 @@ const RepeatableComponent = ({
|
|
|
51
51
|
[componentUid, getComponentLayout]
|
|
52
52
|
);
|
|
53
53
|
|
|
54
|
-
const nextTempKey = useMemo(() =>
|
|
55
|
-
return getMaxTempKey(componentValue || []) + 1;
|
|
56
|
-
}, [componentValue]);
|
|
54
|
+
const nextTempKey = useMemo(() => getMaxTempKey(componentValue || []) + 1, [componentValue]);
|
|
57
55
|
|
|
58
56
|
const componentErrorKeys = getComponentErrorKeys(name, formErrors);
|
|
59
57
|
|
|
@@ -199,29 +197,24 @@ const RepeatableComponent = ({
|
|
|
199
197
|
<VisuallyHidden aria-live="assertive">{liveText}</VisuallyHidden>
|
|
200
198
|
<Accordion.Group error={errorMessage} ariaDescribedBy={ariaDescriptionId}>
|
|
201
199
|
<Accordion.Content aria-describedby={ariaDescriptionId}>
|
|
202
|
-
{componentValue.map((
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
onDropItem={handleDropItem}
|
|
221
|
-
onGrabItem={handleGrabItem}
|
|
222
|
-
/>
|
|
223
|
-
);
|
|
224
|
-
})}
|
|
200
|
+
{componentValue.map(({ __temp_key__: key }, index) => (
|
|
201
|
+
<Component
|
|
202
|
+
componentFieldName={`${name}.${index}`}
|
|
203
|
+
componentUid={componentUid}
|
|
204
|
+
fields={componentLayoutData.layouts.edit}
|
|
205
|
+
key={key}
|
|
206
|
+
index={index}
|
|
207
|
+
isOpen={collapseToOpen === key}
|
|
208
|
+
isReadOnly={isReadOnly}
|
|
209
|
+
mainField={mainField}
|
|
210
|
+
moveComponentField={handleMoveComponentField}
|
|
211
|
+
onClickToggle={handleToggle(key)}
|
|
212
|
+
toggleCollapses={toggleCollapses}
|
|
213
|
+
onCancel={handleCancel}
|
|
214
|
+
onDropItem={handleDropItem}
|
|
215
|
+
onGrabItem={handleGrabItem}
|
|
216
|
+
/>
|
|
217
|
+
))}
|
|
225
218
|
</Accordion.Content>
|
|
226
219
|
<Accordion.Footer>
|
|
227
220
|
<Flex justifyContent="center" height="48px" background="neutral0">
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a
|
|
5
|
+
* prop or avoid re-executing effects when passed as a dependency
|
|
6
|
+
*
|
|
7
|
+
* @type {<T extends (...args: any[]) => any>(callback: T | undefined) => T}
|
|
8
|
+
*/
|
|
9
|
+
export const useCallbackRef = (callback) => {
|
|
10
|
+
const callbackRef = React.useRef(callback);
|
|
11
|
+
|
|
12
|
+
React.useEffect(() => {
|
|
13
|
+
callbackRef.current = callback;
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
// https://github.com/facebook/react/issues/19240
|
|
17
|
+
return React.useMemo(
|
|
18
|
+
() =>
|
|
19
|
+
(...args) =>
|
|
20
|
+
callbackRef.current?.(...args),
|
|
21
|
+
[]
|
|
22
|
+
);
|
|
23
|
+
};
|