@strapi/admin 4.0.5 → 4.1.0
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/admin/src/components/AuthenticatedApp/index.js +25 -3
- package/admin/src/components/AuthenticatedApp/utils/api.js +15 -1
- package/admin/src/components/GuidedTour/Homepage/components/Step.js +61 -0
- package/admin/src/components/GuidedTour/Homepage/components/Stepper.js +58 -0
- package/admin/src/components/GuidedTour/Homepage/index.js +63 -0
- package/admin/src/components/GuidedTour/Modal/components/Content.js +50 -0
- package/admin/src/components/GuidedTour/Modal/components/Modal.js +75 -0
- package/admin/src/components/GuidedTour/Modal/components/StepNumberWithPadding.js +24 -0
- package/admin/src/components/GuidedTour/Modal/components/Stepper.js +119 -0
- package/admin/src/components/GuidedTour/Modal/index.js +90 -0
- package/admin/src/components/GuidedTour/Modal/reducer.js +29 -0
- package/admin/src/components/GuidedTour/Stepper/StepLine.js +27 -0
- package/admin/src/components/GuidedTour/Stepper/StepNumber.js +71 -0
- package/admin/src/components/GuidedTour/constants.js +3 -0
- package/admin/src/components/GuidedTour/index.js +100 -0
- package/admin/src/components/GuidedTour/init.js +36 -0
- package/admin/src/components/GuidedTour/layout.js +153 -0
- package/admin/src/components/GuidedTour/reducer.js +50 -0
- package/admin/src/components/GuidedTour/utils/arePreviousSectionsDone.js +13 -0
- package/admin/src/components/GuidedTour/utils/arePreviousStepsDone.js +12 -0
- package/admin/src/components/GuidedTour/utils/isGuidedTourCompleted.js +6 -0
- package/admin/src/components/GuidedTour/utils/persistStateToLocaleStorage.js +34 -0
- package/admin/src/components/Providers/index.js +4 -1
- package/admin/src/content-manager/components/CollectionTypeFormWrapper/index.js +14 -1
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/isValidJSONString.js +15 -0
- package/admin/src/content-manager/components/EditViewDataManagerProvider/utils/schema.js +11 -12
- package/admin/src/content-manager/components/InputJSON/FieldWrapper.js +32 -0
- package/admin/src/content-manager/components/InputJSON/Label.js +5 -11
- package/admin/src/content-manager/components/InputJSON/index.js +27 -27
- package/admin/src/content-manager/components/PreviewWysiwyg/Wrapper.js +4 -0
- package/admin/src/content-manager/components/PreviewWysiwyg/utils/mdRenderer.js +1 -1
- package/admin/src/content-manager/components/RepeatableComponent/DraggedItem/index.js +4 -0
- package/admin/src/content-manager/components/SingleTypeFormWrapper/index.js +5 -1
- package/admin/src/content-manager/components/Wysiwyg/Editor.js +4 -1
- package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +2 -1
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +14 -8
- package/admin/src/content-manager/components/Wysiwyg/WysiwygStyles.js +1 -0
- package/admin/src/content-manager/components/Wysiwyg/index.js +4 -1
- package/admin/src/content-manager/pages/App/index.js +15 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/DisplayedFields.js +1 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +4 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +52 -11
- package/admin/src/content-manager/pages/EditSettingsView/index.js +10 -1
- package/admin/src/content-manager/pages/EditSettingsView/reducer.js +26 -5
- package/admin/src/content-manager/pages/EditSettingsView/utils/layout.js +40 -9
- package/admin/src/content-manager/pages/EditView/index.js +2 -1
- package/admin/src/pages/Admin/index.js +4 -0
- package/admin/src/pages/AuthPage/components/Register/index.js +11 -6
- package/admin/src/pages/AuthPage/index.js +15 -1
- package/admin/src/pages/HomePage/index.js +8 -2
- package/admin/src/pages/InternalErrorPage/index.js +53 -0
- package/admin/src/pages/MarketplacePage/index.js +13 -13
- package/admin/src/pages/NotFoundPage/index.js +45 -2
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +3 -0
- package/admin/src/pages/SettingsPage/pages/ApiTokens/ListView/index.js +11 -2
- package/admin/src/pages/SettingsPage/pages/Roles/ListPage/components/RoleRow/index.js +2 -2
- package/admin/src/pages/SettingsPage/pages/Webhooks/ListView/index.js +4 -1
- package/admin/src/translations/ar.json +0 -4
- package/admin/src/translations/cs.json +0 -6
- package/admin/src/translations/de.json +0 -12
- package/admin/src/translations/dk.json +158 -170
- package/admin/src/translations/en.json +45 -27
- package/admin/src/translations/es.json +15 -25
- package/admin/src/translations/fr.json +158 -166
- package/admin/src/translations/he.json +0 -10
- package/admin/src/translations/hu.json +16 -26
- package/admin/src/translations/id.json +0 -12
- package/admin/src/translations/it.json +0 -12
- package/admin/src/translations/ja.json +16 -28
- package/admin/src/translations/ko.json +656 -670
- package/admin/src/translations/ms.json +0 -6
- package/admin/src/translations/nl.json +16 -30
- package/admin/src/translations/no.json +0 -10
- package/admin/src/translations/pl.json +0 -12
- package/admin/src/translations/pt-BR.json +19 -29
- package/admin/src/translations/pt.json +0 -4
- package/admin/src/translations/ru.json +0 -12
- package/admin/src/translations/sk.json +0 -12
- package/admin/src/translations/sv.json +0 -4
- package/admin/src/translations/th.json +0 -12
- package/admin/src/translations/tr.json +0 -4
- package/admin/src/translations/uk.json +0 -6
- package/admin/src/translations/vi.json +0 -4
- package/admin/src/translations/zh-Hans.json +22 -32
- package/admin/src/translations/zh.json +24 -27
- package/build/1856.a06395b4.chunk.js +1 -0
- package/build/2481.7d15bd79.chunk.js +1 -0
- package/build/2736.e2b1233b.chunk.js +2 -0
- package/build/{6060.72f9dda2.chunk.js.LICENSE.txt → 2736.e2b1233b.chunk.js.LICENSE.txt} +0 -0
- package/build/2912.38fb9bd1.chunk.js +1 -0
- package/build/4261.a4e1e93c.chunk.js +1 -0
- package/build/4362.d0c1a04a.chunk.js +1 -0
- package/build/4715.31ca1967.chunk.js +1 -0
- package/build/4800.18e59c83.chunk.js +1 -0
- package/build/497.8f30da61.chunk.js +1 -0
- package/build/4982.da4adb38.chunk.js +1 -0
- package/build/5032.ed02a466.chunk.js +2 -0
- package/build/{8530.f3460d3b.chunk.js.LICENSE.txt → 5032.ed02a466.chunk.js.LICENSE.txt} +0 -0
- package/build/6250.dc6d7a58.chunk.js +1 -0
- package/build/6925.bd694b04.chunk.js +2 -0
- package/build/{6925.4767e761.chunk.js.LICENSE.txt → 6925.bd694b04.chunk.js.LICENSE.txt} +2 -1
- package/build/7841.ef9bcee9.chunk.js +1 -0
- package/build/{3215.e4e1d329.chunk.js → 8042.9b85175a.chunk.js} +2 -2
- package/build/{3215.e4e1d329.chunk.js.LICENSE.txt → 8042.9b85175a.chunk.js.LICENSE.txt} +0 -0
- package/build/849.9075d399.chunk.js +1 -0
- package/build/9235.ced8aebf.chunk.js +1 -0
- package/build/9238.bdd93dae.chunk.js +1 -0
- package/build/9988.b4229043.chunk.js +2 -0
- package/build/{4741.18bf386b.chunk.js.LICENSE.txt → 9988.b4229043.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.3bb032bf.chunk.js +1 -0
- package/build/Admin_homePage.e4779166.chunk.js +1 -0
- package/build/Admin_marketplace.e8654056.chunk.js +1 -0
- package/build/{Admin_pluginsPage.0d59d86e.chunk.js → Admin_pluginsPage.7d1bd7ce.chunk.js} +1 -1
- package/build/{Admin_profilePage.c08119de.chunk.js → Admin_profilePage.67dd744c.chunk.js} +1 -1
- package/build/{Admin_settingsPage.97246c41.chunk.js → Admin_settingsPage.2d0d2cca.chunk.js} +1 -1
- package/build/{admin-edit-roles-page.8af004a6.chunk.js → admin-edit-roles-page.2d1b6461.chunk.js} +1 -1
- package/build/{admin-edit-users.73877840.chunk.js → admin-edit-users.e736db15.chunk.js} +1 -1
- package/build/admin-users.5f79c031.chunk.js +1 -0
- package/build/api-tokens-create-page.2ffd893a.chunk.js +1 -0
- package/build/{api-tokens-create-page.ebe57c8e.chunk.js → api-tokens-edit-page.a939bd0a.chunk.js} +1 -1
- package/build/api-tokens-list-page.1ccc8615.chunk.js +1 -0
- package/build/ar-json.6a2565af.chunk.js +1 -0
- package/build/codemirror-css.48b438c9.chunk.js +1 -0
- package/build/{codemirror-javacript.381a518a.chunk.js → codemirror-javacript.8c7c015d.chunk.js} +1 -1
- package/build/content-manager.5f6197c8.chunk.js +1 -0
- package/build/{content-type-builder-translation-cs-json.2f7e2289.chunk.js → content-type-builder-translation-cs-json.89f7272e.chunk.js} +1 -1
- package/build/{content-type-builder-translation-de-json.46017754.chunk.js → content-type-builder-translation-de-json.0205697c.chunk.js} +1 -1
- package/build/content-type-builder-translation-dk-json.235ff56e.chunk.js +1 -0
- package/build/{content-type-builder-translation-en-json.d70fc3af.chunk.js → content-type-builder-translation-en-json.b3d8e9d4.chunk.js} +1 -1
- package/build/{content-type-builder-translation-es-json.20c177ee.chunk.js → content-type-builder-translation-es-json.13b2e2aa.chunk.js} +1 -1
- package/build/{content-type-builder-translation-fr-json.8f66eb66.chunk.js → content-type-builder-translation-fr-json.bee621f7.chunk.js} +1 -1
- package/build/{content-type-builder-translation-id-json.aab2f426.chunk.js → content-type-builder-translation-id-json.2fbf4f8c.chunk.js} +1 -1
- package/build/{content-type-builder-translation-it-json.4c91e895.chunk.js → content-type-builder-translation-it-json.a1afd7a9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ja-json.c239ba90.chunk.js → content-type-builder-translation-ja-json.1459fb88.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ko-json.2a5e0769.chunk.js → content-type-builder-translation-ko-json.bc6fb3dc.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ms-json.124be88c.chunk.js → content-type-builder-translation-ms-json.048122eb.chunk.js} +1 -1
- package/build/{content-type-builder-translation-nl-json.98a240b8.chunk.js → content-type-builder-translation-nl-json.8d59e86b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pl-json.2abc61bd.chunk.js → content-type-builder-translation-pl-json.01dc068c.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-BR-json.c0415545.chunk.js → content-type-builder-translation-pt-BR-json.d311d056.chunk.js} +1 -1
- package/build/{content-type-builder-translation-pt-json.ab3e086d.chunk.js → content-type-builder-translation-pt-json.4893266f.chunk.js} +1 -1
- package/build/{content-type-builder-translation-ru-json.1a6779fd.chunk.js → content-type-builder-translation-ru-json.1285874d.chunk.js} +1 -1
- package/build/{content-type-builder-translation-sk-json.5c82f020.chunk.js → content-type-builder-translation-sk-json.0064156b.chunk.js} +1 -1
- package/build/{content-type-builder-translation-th-json.24ee19eb.chunk.js → content-type-builder-translation-th-json.5f690524.chunk.js} +1 -1
- package/build/{content-type-builder-translation-tr-json.30434835.chunk.js → content-type-builder-translation-tr-json.696283a5.chunk.js} +1 -1
- package/build/{content-type-builder-translation-uk-json.771662ef.chunk.js → content-type-builder-translation-uk-json.87496bf9.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-Hans-json.070020ae.chunk.js → content-type-builder-translation-zh-Hans-json.283c640e.chunk.js} +1 -1
- package/build/{content-type-builder-translation-zh-json.9708310d.chunk.js → content-type-builder-translation-zh-json.77aa2275.chunk.js} +1 -1
- package/build/content-type-builder.f1cef05c.chunk.js +1 -0
- package/build/cs-json.8df09876.chunk.js +1 -0
- package/build/de-json.6e14f607.chunk.js +1 -0
- package/build/dk-json.be388470.chunk.js +1 -0
- package/build/email-settings-page.4338588d.chunk.js +1 -0
- package/build/en-json.bb614bb0.chunk.js +1 -0
- package/build/es-json.61553168.chunk.js +1 -0
- package/build/{fontawesome-css.ef93ee2a.chunk.js → fontawesome-css.36cff9ae.chunk.js} +1 -1
- package/build/fr-json.d1de8155.chunk.js +1 -0
- package/build/he-json.1742494e.chunk.js +1 -0
- package/build/hu-json.e667d285.chunk.js +1 -0
- package/build/i18n-settings-page.51e37957.chunk.js +1 -0
- package/build/i18n-translation-dk-json.ecf02d28.chunk.js +1 -0
- package/build/i18n-translation-en-json.4d823f62.chunk.js +1 -0
- package/build/i18n-translation-es-json.7049afa2.chunk.js +1 -0
- package/build/i18n-translation-fr-json.c6367bc9.chunk.js +1 -0
- package/build/i18n-translation-ko-json.6591fe59.chunk.js +1 -0
- package/build/i18n-translation-zh-Hans-json.258b2e1a.chunk.js +1 -0
- package/build/id-json.d87ebb20.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/it-json.a2880b81.chunk.js +1 -0
- package/build/ja-json.46e29f04.chunk.js +1 -0
- package/build/ko-json.63d1660a.chunk.js +1 -0
- package/build/main.a5659553.js +2 -0
- package/build/{main.f4419aa1.js.LICENSE.txt → main.a5659553.js.LICENSE.txt} +0 -0
- package/build/ms-json.3a062984.chunk.js +1 -0
- package/build/nl-json.30ce02cb.chunk.js +1 -0
- package/build/no-json.9af40e9d.chunk.js +1 -0
- package/build/pl-json.fd373053.chunk.js +1 -0
- package/build/pt-BR-json.30e2d716.chunk.js +1 -0
- package/build/pt-json.3aaf9e05.chunk.js +1 -0
- package/build/ru-json.78c56e1c.chunk.js +1 -0
- package/build/{runtime~main.25881105.js → runtime~main.cfbc273d.js} +1 -1
- package/build/sk-json.c0bf144c.chunk.js +1 -0
- package/build/{sso-settings-page.36c35df0.chunk.js → sso-settings-page.c073b6d7.chunk.js} +1 -1
- package/build/sv-json.aad187b9.chunk.js +1 -0
- package/build/th-json.e2b4a0fb.chunk.js +1 -0
- package/build/tr-json.0add11cd.chunk.js +1 -0
- package/build/uk-json.eb78e77e.chunk.js +1 -0
- package/build/upload-settings.8e7cbc3b.chunk.js +1 -0
- package/build/{upload-translation-de-json.00f90715.chunk.js → upload-translation-de-json.1308dce5.chunk.js} +1 -1
- package/build/upload-translation-dk-json.0d4e855f.chunk.js +1 -0
- package/build/upload-translation-en-json.c3373c8d.chunk.js +1 -0
- package/build/upload-translation-es-json.81b13eac.chunk.js +1 -0
- package/build/{upload-translation-fr-json.ccb4ad8b.chunk.js → upload-translation-fr-json.1bec79ec.chunk.js} +1 -1
- package/build/upload-translation-he-json.1d28982f.chunk.js +1 -0
- package/build/{upload-translation-it-json.c1809a47.chunk.js → upload-translation-it-json.7d4bdc5a.chunk.js} +1 -1
- package/build/{upload-translation-ja-json.71aa85eb.chunk.js → upload-translation-ja-json.97fcacd8.chunk.js} +1 -1
- package/build/upload-translation-ko-json.90424b11.chunk.js +1 -0
- package/build/{upload-translation-ms-json.be669f81.chunk.js → upload-translation-ms-json.081effd5.chunk.js} +1 -1
- package/build/{upload-translation-pl-json.67685825.chunk.js → upload-translation-pl-json.2dfe78bb.chunk.js} +1 -1
- package/build/{upload-translation-pt-BR-json.f7b1133d.chunk.js → upload-translation-pt-BR-json.65936d7b.chunk.js} +1 -1
- package/build/{upload-translation-ru-json.54c031aa.chunk.js → upload-translation-ru-json.2d3b6f69.chunk.js} +1 -1
- package/build/{upload-translation-sk-json.f643dfc2.chunk.js → upload-translation-sk-json.f15c7fd6.chunk.js} +1 -1
- package/build/upload-translation-th-json.6d3c2370.chunk.js +1 -0
- package/build/{upload-translation-uk-json.1a90e73c.chunk.js → upload-translation-uk-json.a6c38449.chunk.js} +1 -1
- package/build/{upload-translation-zh-Hans-json.ac1dc0b9.chunk.js → upload-translation-zh-Hans-json.f6b26c45.chunk.js} +1 -1
- package/build/{upload-translation-zh-json.164ac601.chunk.js → upload-translation-zh-json.06052336.chunk.js} +1 -1
- package/build/upload.803ab265.chunk.js +1 -0
- package/build/users-advanced-settings-page.7694d3c9.chunk.js +1 -0
- package/build/{users-email-settings-page.678794aa.chunk.js → users-email-settings-page.862eb51e.chunk.js} +1 -1
- package/build/users-permissions-translation-dk-json.89d41c4b.chunk.js +1 -0
- package/build/users-providers-settings-page.47f97b06.chunk.js +1 -0
- package/build/{users-roles-settings-page.4f04bf06.chunk.js → users-roles-settings-page.b67e2b4d.chunk.js} +1 -1
- package/build/vi-json.55a11ac0.chunk.js +1 -0
- package/build/webhook-edit-page.adad0a42.chunk.js +1 -0
- package/build/webhook-list-page.5c8f2a91.chunk.js +1 -0
- package/build/zh-Hans-json.55f6475b.chunk.js +1 -0
- package/build/zh-json.c3c2b225.chunk.js +1 -0
- package/ee/admin/pages/App/utils/customRoutes.js +1 -1
- package/ee/server/controllers/authentication/utils.js +1 -1
- package/index.js +31 -25
- package/package.json +13 -13
- package/server/services/permission/permissions-manager/sanitize.js +5 -3
- package/server/strategies/api-token.js +0 -3
- package/build/1024.a40d2d9e.chunk.js +0 -1
- package/build/1856.cc060f4a.chunk.js +0 -1
- package/build/2912.d903b59a.chunk.js +0 -1
- package/build/4064.d7baa10c.chunk.js +0 -1
- package/build/4261.061aed35.chunk.js +0 -1
- package/build/4362.029c5c86.chunk.js +0 -1
- package/build/4672.68466ddc.chunk.js +0 -1
- package/build/4715.a5e6716c.chunk.js +0 -1
- package/build/4741.18bf386b.chunk.js +0 -2
- package/build/497.7e65282d.chunk.js +0 -1
- package/build/4982.4666f610.chunk.js +0 -1
- package/build/6060.72f9dda2.chunk.js +0 -2
- package/build/6250.5f8cd6cb.chunk.js +0 -1
- package/build/6925.4767e761.chunk.js +0 -2
- package/build/7841.d2aa6f5e.chunk.js +0 -1
- package/build/849.46892e8e.chunk.js +0 -1
- package/build/8530.f3460d3b.chunk.js +0 -2
- package/build/Admin-authenticatedApp.a0ed38a6.chunk.js +0 -1
- package/build/Admin_homePage.83a8b04f.chunk.js +0 -1
- package/build/Admin_marketplace.1cf20eeb.chunk.js +0 -1
- package/build/admin-users.e0558d75.chunk.js +0 -1
- package/build/api-tokens-edit-page.35e1522b.chunk.js +0 -1
- package/build/api-tokens-list-page.f01b7b98.chunk.js +0 -1
- package/build/ar-json.d79e4709.chunk.js +0 -1
- package/build/codemirror-css.17bc19d4.chunk.js +0 -1
- package/build/content-manager.05646891.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.098bd218.chunk.js +0 -1
- package/build/content-type-builder.7673250d.chunk.js +0 -1
- package/build/cs-json.b8ba75b8.chunk.js +0 -1
- package/build/de-json.e01bdeae.chunk.js +0 -1
- package/build/dk-json.7356ea4b.chunk.js +0 -1
- package/build/email-settings-page.8f22f49c.chunk.js +0 -1
- package/build/en-json.9e3c8615.chunk.js +0 -1
- package/build/es-json.ed9c8bef.chunk.js +0 -1
- package/build/fr-json.bae03a2c.chunk.js +0 -1
- package/build/he-json.86f9e663.chunk.js +0 -1
- package/build/hu-json.a741d263.chunk.js +0 -1
- package/build/i18n-settings-page.ad670b2c.chunk.js +0 -1
- package/build/i18n-translation-dk-json.932d3cc2.chunk.js +0 -1
- package/build/i18n-translation-en-json.239b740f.chunk.js +0 -1
- package/build/i18n-translation-es-json.347904f3.chunk.js +0 -1
- package/build/i18n-translation-fr-json.b52474fc.chunk.js +0 -1
- package/build/i18n-translation-ko-json.e88e11ef.chunk.js +0 -1
- package/build/i18n-translation-zh-Hans-json.4c17fed0.chunk.js +0 -1
- package/build/id-json.0b0c9731.chunk.js +0 -1
- package/build/it-json.939916bc.chunk.js +0 -1
- package/build/ja-json.52581a2a.chunk.js +0 -1
- package/build/ko-json.29633034.chunk.js +0 -1
- package/build/main.f4419aa1.js +0 -2
- package/build/ms-json.5e5d12f9.chunk.js +0 -1
- package/build/nl-json.ac661b7f.chunk.js +0 -1
- package/build/no-json.ff46b126.chunk.js +0 -1
- package/build/pl-json.6bff1d54.chunk.js +0 -1
- package/build/pt-BR-json.8b3f799d.chunk.js +0 -1
- package/build/pt-json.b23d9a79.chunk.js +0 -1
- package/build/ru-json.bff93229.chunk.js +0 -1
- package/build/sk-json.a40bc2c8.chunk.js +0 -1
- package/build/sv-json.8ac61ecf.chunk.js +0 -1
- package/build/th-json.6e4502a3.chunk.js +0 -1
- package/build/tr-json.eaca955b.chunk.js +0 -1
- package/build/uk-json.da2ed14e.chunk.js +0 -1
- package/build/upload-settings.f65c4d08.chunk.js +0 -1
- package/build/upload-translation-dk-json.bc6af8b4.chunk.js +0 -1
- package/build/upload-translation-en-json.31ea0622.chunk.js +0 -1
- package/build/upload-translation-es-json.b53d6641.chunk.js +0 -1
- package/build/upload-translation-he-json.5dc34ea8.chunk.js +0 -1
- package/build/upload-translation-ko-json.da369eef.chunk.js +0 -1
- package/build/upload-translation-th-json.88ee2090.chunk.js +0 -1
- package/build/upload.1e3e2685.chunk.js +0 -1
- package/build/users-advanced-settings-page.da9830fd.chunk.js +0 -1
- package/build/users-permissions-translation-dk-json.3e0295e5.chunk.js +0 -1
- package/build/users-providers-settings-page.d4f78a77.chunk.js +0 -1
- package/build/vi-json.e993857a.chunk.js +0 -1
- package/build/webhook-edit-page.42ec446c.chunk.js +0 -1
- package/build/webhook-list-page.775c0e30.chunk.js +0 -1
- package/build/zh-Hans-json.fcc53388.chunk.js +0 -1
- package/build/zh-json.2e4c9ef4.chunk.js +0 -1
|
@@ -9,11 +9,11 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import cm from 'codemirror';
|
|
10
10
|
import trimStart from 'lodash/trimStart';
|
|
11
11
|
import { Stack } from '@strapi/design-system/Stack';
|
|
12
|
+
import { FieldHint, FieldError } from '@strapi/design-system/Field';
|
|
12
13
|
import jsonlint from './jsonlint';
|
|
13
14
|
import { EditorWrapper, StyledBox } from './components';
|
|
14
|
-
import Hint from '../Hint';
|
|
15
15
|
import Label from './Label';
|
|
16
|
-
import
|
|
16
|
+
import FieldWrapper from './FieldWrapper';
|
|
17
17
|
|
|
18
18
|
const WAIT = 600;
|
|
19
19
|
const stringify = JSON.stringify;
|
|
@@ -80,7 +80,7 @@ class InputJSON extends React.Component {
|
|
|
80
80
|
try {
|
|
81
81
|
if (value === null) return this.codeMirror.setValue('');
|
|
82
82
|
|
|
83
|
-
const nextValue =
|
|
83
|
+
const nextValue = stringify(value, null, 2);
|
|
84
84
|
|
|
85
85
|
return this.codeMirror.setValue(nextValue);
|
|
86
86
|
} catch (err) {
|
|
@@ -159,30 +159,28 @@ class InputJSON extends React.Component {
|
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
return (
|
|
162
|
-
<
|
|
163
|
-
<
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
<FieldError id={this.props.id} name={this.props.name} error={this.props.error} />
|
|
185
|
-
</Stack>
|
|
162
|
+
<FieldWrapper name={this.props.name} hint={this.props.description} error={this.props.error}>
|
|
163
|
+
<Stack size={1}>
|
|
164
|
+
<Label
|
|
165
|
+
intlLabel={this.props.intlLabel}
|
|
166
|
+
labelAction={this.props.labelAction}
|
|
167
|
+
name={this.props.name}
|
|
168
|
+
required={this.props.required}
|
|
169
|
+
/>
|
|
170
|
+
<StyledBox error={this.props.error}>
|
|
171
|
+
<EditorWrapper disabled={this.props.disabled}>
|
|
172
|
+
<textarea
|
|
173
|
+
ref={this.editor}
|
|
174
|
+
autoComplete="off"
|
|
175
|
+
id={this.props.id || this.props.name}
|
|
176
|
+
defaultValue=""
|
|
177
|
+
/>
|
|
178
|
+
</EditorWrapper>
|
|
179
|
+
</StyledBox>
|
|
180
|
+
<FieldHint />
|
|
181
|
+
<FieldError />
|
|
182
|
+
</Stack>
|
|
183
|
+
</FieldWrapper>
|
|
186
184
|
);
|
|
187
185
|
}
|
|
188
186
|
}
|
|
@@ -196,6 +194,7 @@ InputJSON.defaultProps = {
|
|
|
196
194
|
labelAction: undefined,
|
|
197
195
|
onChange: () => {},
|
|
198
196
|
value: null,
|
|
197
|
+
required: false,
|
|
199
198
|
};
|
|
200
199
|
|
|
201
200
|
InputJSON.propTypes = {
|
|
@@ -216,6 +215,7 @@ InputJSON.propTypes = {
|
|
|
216
215
|
name: PropTypes.string.isRequired,
|
|
217
216
|
onChange: PropTypes.func,
|
|
218
217
|
value: PropTypes.any,
|
|
218
|
+
required: PropTypes.bool,
|
|
219
219
|
};
|
|
220
220
|
|
|
221
221
|
export default InputJSON;
|
|
@@ -121,6 +121,10 @@ const DraggedItem = ({
|
|
|
121
121
|
if (dragIndex > hoverIndex && hoverClientY > hoverMiddleY) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
+
// If They are not in the same level, should not move
|
|
125
|
+
if (dragPath.split('.').length !== hoverPath.split('.').length) {
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
124
128
|
// Time to actually perform the action in the data
|
|
125
129
|
moveComponentField(pathToComponentArray, dragIndex, hoverIndex);
|
|
126
130
|
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
formatComponentData,
|
|
7
7
|
useQueryParams,
|
|
8
8
|
useNotification,
|
|
9
|
+
useGuidedTour,
|
|
9
10
|
} from '@strapi/helper-plugin';
|
|
10
11
|
import { useSelector, useDispatch } from 'react-redux';
|
|
11
12
|
import PropTypes from 'prop-types';
|
|
@@ -29,6 +30,7 @@ import buildQueryString from '../../pages/ListView/utils/buildQueryString';
|
|
|
29
30
|
const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
30
31
|
const { trackUsage } = useTracking();
|
|
31
32
|
const { push } = useHistory();
|
|
33
|
+
const { setCurrentStep } = useGuidedTour();
|
|
32
34
|
const trackUsageRef = useRef(trackUsage);
|
|
33
35
|
const [isCreatingEntry, setIsCreatingEntry] = useState(true);
|
|
34
36
|
const [{ query, rawQuery }] = useQueryParams();
|
|
@@ -203,6 +205,8 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
203
205
|
message: { id: getTrad('success.record.save') },
|
|
204
206
|
});
|
|
205
207
|
|
|
208
|
+
setCurrentStep('contentManager.success');
|
|
209
|
+
|
|
206
210
|
dispatch(submitSucceeded(cleanReceivedData(data)));
|
|
207
211
|
setIsCreatingEntry(false);
|
|
208
212
|
|
|
@@ -215,7 +219,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
215
219
|
dispatch(setStatus('resolved'));
|
|
216
220
|
}
|
|
217
221
|
},
|
|
218
|
-
[cleanReceivedData, displayErrors, slug, dispatch, rawQuery, toggleNotification]
|
|
222
|
+
[cleanReceivedData, displayErrors, slug, dispatch, rawQuery, toggleNotification, setCurrentStep]
|
|
219
223
|
);
|
|
220
224
|
const onPublish = useCallback(async () => {
|
|
221
225
|
try {
|
|
@@ -12,6 +12,7 @@ const Editor = ({
|
|
|
12
12
|
editorRef,
|
|
13
13
|
error,
|
|
14
14
|
isPreviewMode,
|
|
15
|
+
isExpandMode,
|
|
15
16
|
name,
|
|
16
17
|
onChange,
|
|
17
18
|
placeholder,
|
|
@@ -64,7 +65,7 @@ const Editor = ({
|
|
|
64
65
|
|
|
65
66
|
return (
|
|
66
67
|
<EditorAndPreviewWrapper>
|
|
67
|
-
<EditorStylesContainer disabled={disabled || isPreviewMode}>
|
|
68
|
+
<EditorStylesContainer isExpandMode={isExpandMode} disabled={disabled || isPreviewMode}>
|
|
68
69
|
<textarea ref={textareaRef} />
|
|
69
70
|
</EditorStylesContainer>
|
|
70
71
|
{isPreviewMode && <PreviewWysiwyg data={value} />}
|
|
@@ -76,6 +77,7 @@ Editor.defaultProps = {
|
|
|
76
77
|
disabled: false,
|
|
77
78
|
error: undefined,
|
|
78
79
|
isPreviewMode: false,
|
|
80
|
+
isExpandMode: false,
|
|
79
81
|
placeholder: '',
|
|
80
82
|
value: '',
|
|
81
83
|
};
|
|
@@ -85,6 +87,7 @@ Editor.propTypes = {
|
|
|
85
87
|
editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired,
|
|
86
88
|
error: PropTypes.string,
|
|
87
89
|
isPreviewMode: PropTypes.bool,
|
|
90
|
+
isExpandMode: PropTypes.bool,
|
|
88
91
|
name: PropTypes.string.isRequired,
|
|
89
92
|
onChange: PropTypes.func.isRequired,
|
|
90
93
|
placeholder: PropTypes.string,
|
|
@@ -4,6 +4,7 @@ import styled from 'styled-components';
|
|
|
4
4
|
/* stylelint-disable */
|
|
5
5
|
export const EditorStylesContainer = styled.div`
|
|
6
6
|
cursor: ${({ disabled }) => (disabled ? 'not-allowed !important' : 'auto')};
|
|
7
|
+
height: 100%;
|
|
7
8
|
/* BASICS */
|
|
8
9
|
.CodeMirror-placeholder {
|
|
9
10
|
color: ${({ theme }) => theme.colors.neutral600} !important;
|
|
@@ -12,7 +13,7 @@ export const EditorStylesContainer = styled.div`
|
|
|
12
13
|
.CodeMirror {
|
|
13
14
|
/* Set height, width, borders, and global font properties here */
|
|
14
15
|
font-size: ${14 / 16}rem;
|
|
15
|
-
height: 290px;
|
|
16
|
+
height: ${({ isExpandMode }) => (isExpandMode ? '100%' : '290px')};
|
|
16
17
|
color: ${({ theme }) => theme.colors.neutral800};
|
|
17
18
|
direction: ltr;
|
|
18
19
|
font-family: --apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
|
@@ -28,7 +28,9 @@ import {
|
|
|
28
28
|
} from './WysiwygStyles';
|
|
29
29
|
|
|
30
30
|
const WysiwygNav = ({
|
|
31
|
+
disabled,
|
|
31
32
|
editorRef,
|
|
33
|
+
isExpandMode,
|
|
32
34
|
isPreviewMode,
|
|
33
35
|
onActionClick,
|
|
34
36
|
onToggleMediaLib,
|
|
@@ -46,7 +48,7 @@ const WysiwygNav = ({
|
|
|
46
48
|
setVisiblePopover(prev => !prev);
|
|
47
49
|
};
|
|
48
50
|
|
|
49
|
-
if (isPreviewMode) {
|
|
51
|
+
if (disabled || isPreviewMode) {
|
|
50
52
|
return (
|
|
51
53
|
<Box padding={2} background="neutral100">
|
|
52
54
|
<Flex justifyContent="space-between">
|
|
@@ -87,12 +89,14 @@ const WysiwygNav = ({
|
|
|
87
89
|
<MoreButton disabled id="more" label="More" icon={<More />} />
|
|
88
90
|
</Flex>
|
|
89
91
|
|
|
90
|
-
|
|
91
|
-
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
92
|
+
{!isExpandMode && (
|
|
93
|
+
<Button onClick={onTogglePreviewMode} variant="tertiary" id="preview">
|
|
94
|
+
{formatMessage({
|
|
95
|
+
id: 'components.Wysiwyg.ToggleMode.markdown-mode',
|
|
96
|
+
defaultMessage: 'Markdown mode',
|
|
97
|
+
})}
|
|
98
|
+
</Button>
|
|
99
|
+
)}
|
|
96
100
|
</Flex>
|
|
97
101
|
</Box>
|
|
98
102
|
);
|
|
@@ -149,7 +153,7 @@ const WysiwygNav = ({
|
|
|
149
153
|
/>
|
|
150
154
|
{visiblePopover && (
|
|
151
155
|
<Popover centered source={buttonMoreRef} spacing={4} id="popover">
|
|
152
|
-
<FocusTrap onEscape={handleTogglePopover}>
|
|
156
|
+
<FocusTrap onEscape={handleTogglePopover} restoreFocus={false}>
|
|
153
157
|
<Flex>
|
|
154
158
|
<IconButtonGroupMargin>
|
|
155
159
|
<CustomIconButton
|
|
@@ -235,7 +239,9 @@ WysiwygNav.defaultProps = {
|
|
|
235
239
|
};
|
|
236
240
|
|
|
237
241
|
WysiwygNav.propTypes = {
|
|
242
|
+
disabled: PropTypes.bool.isRequired,
|
|
238
243
|
editorRef: PropTypes.shape({ current: PropTypes.any }).isRequired,
|
|
244
|
+
isExpandMode: PropTypes.bool.isRequired,
|
|
239
245
|
isPreviewMode: PropTypes.bool,
|
|
240
246
|
onActionClick: PropTypes.func,
|
|
241
247
|
onToggleMediaLib: PropTypes.func,
|
|
@@ -144,15 +144,18 @@ const Wysiwyg = ({
|
|
|
144
144
|
onCollapse={handleToggleExpand}
|
|
145
145
|
>
|
|
146
146
|
<WysiwygNav
|
|
147
|
+
isExpandMode={isExpandMode}
|
|
147
148
|
editorRef={editorRef}
|
|
148
149
|
isPreviewMode={isPreviewMode}
|
|
149
150
|
onActionClick={handleActionClick}
|
|
150
151
|
onToggleMediaLib={handleToggleMediaLib}
|
|
151
152
|
onTogglePreviewMode={isExpandMode ? undefined : handleTogglePreviewMode}
|
|
153
|
+
disabled={disabled}
|
|
152
154
|
/>
|
|
153
155
|
|
|
154
156
|
<Editor
|
|
155
157
|
disabled={disabled}
|
|
158
|
+
isExpandMode={isExpandMode}
|
|
156
159
|
editorRef={editorRef}
|
|
157
160
|
error={errorMessage}
|
|
158
161
|
isPreviewMode={isPreviewMode}
|
|
@@ -185,7 +188,7 @@ const Wysiwyg = ({
|
|
|
185
188
|
|
|
186
189
|
Wysiwyg.defaultProps = {
|
|
187
190
|
description: null,
|
|
188
|
-
disabled:
|
|
191
|
+
disabled: false,
|
|
189
192
|
error: '',
|
|
190
193
|
labelAction: undefined,
|
|
191
194
|
placeholder: null,
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { Helmet } from 'react-helmet';
|
|
3
3
|
import { Switch, Route, useRouteMatch, Redirect, useLocation } from 'react-router-dom';
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
CheckPagePermissions,
|
|
6
|
+
LoadingIndicatorPage,
|
|
7
|
+
NotFound,
|
|
8
|
+
useGuidedTour,
|
|
9
|
+
} from '@strapi/helper-plugin';
|
|
5
10
|
import { Layout, HeaderLayout } from '@strapi/design-system/Layout';
|
|
6
11
|
import { Main } from '@strapi/design-system/Main';
|
|
7
12
|
import { useIntl } from 'react-intl';
|
|
@@ -28,6 +33,14 @@ const App = () => {
|
|
|
28
33
|
);
|
|
29
34
|
const { pathname } = useLocation();
|
|
30
35
|
const { formatMessage } = useIntl();
|
|
36
|
+
const { startSection } = useGuidedTour();
|
|
37
|
+
const startSectionRef = useRef(startSection);
|
|
38
|
+
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
if (startSectionRef.current) {
|
|
41
|
+
startSectionRef.current('contentManager');
|
|
42
|
+
}
|
|
43
|
+
}, []);
|
|
31
44
|
|
|
32
45
|
if (status === 'loading') {
|
|
33
46
|
return (
|
|
@@ -41,9 +41,7 @@ const DisplayedFields = ({ editLayout, editLayoutRemainingFields, onRemoveField,
|
|
|
41
41
|
<Box padding={4} hasRadius borderStyle="dashed" borderWidth="1px" borderColor="neutral300">
|
|
42
42
|
<Stack size={2}>
|
|
43
43
|
{editLayout.map((row, index) => (
|
|
44
|
-
<
|
|
45
|
-
<RowsLayout row={row} rowIndex={index} onRemoveField={onRemoveField} />
|
|
46
|
-
</React.Fragment>
|
|
44
|
+
<RowsLayout key={row.rowId} row={row} rowIndex={index} onRemoveField={onRemoveField} />
|
|
47
45
|
))}
|
|
48
46
|
<SimpleMenu
|
|
49
47
|
id="label"
|
|
@@ -26,7 +26,7 @@ const HeaderContainer = styled(Flex)`
|
|
|
26
26
|
}
|
|
27
27
|
`;
|
|
28
28
|
|
|
29
|
-
const FormModal = ({ onToggle,
|
|
29
|
+
const FormModal = ({ onToggle, onMetaChange, onSizeChange, onSubmit, type }) => {
|
|
30
30
|
const { selectedField } = useLayoutDnd();
|
|
31
31
|
const { formatMessage } = useIntl();
|
|
32
32
|
|
|
@@ -61,7 +61,7 @@ const FormModal = ({ onToggle, onChange, onSubmit, type }) => {
|
|
|
61
61
|
</ModalHeader>
|
|
62
62
|
<ModalBody>
|
|
63
63
|
<Grid gap={4}>
|
|
64
|
-
<ModalForm
|
|
64
|
+
<ModalForm onMetaChange={onMetaChange} onSizeChange={onSizeChange} />
|
|
65
65
|
</Grid>
|
|
66
66
|
</ModalBody>
|
|
67
67
|
<ModalFooter
|
|
@@ -84,7 +84,8 @@ const FormModal = ({ onToggle, onChange, onSubmit, type }) => {
|
|
|
84
84
|
FormModal.propTypes = {
|
|
85
85
|
onSubmit: PropTypes.func.isRequired,
|
|
86
86
|
onToggle: PropTypes.func.isRequired,
|
|
87
|
-
|
|
87
|
+
onMetaChange: PropTypes.func.isRequired,
|
|
88
|
+
onSizeChange: PropTypes.func.isRequired,
|
|
88
89
|
type: PropTypes.string.isRequired,
|
|
89
90
|
};
|
|
90
91
|
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import React, { useMemo, useCallback } from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
2
3
|
import get from 'lodash/get';
|
|
3
4
|
import { GridItem } from '@strapi/design-system/Grid';
|
|
5
|
+
import { Select, Option } from '@strapi/design-system/Select';
|
|
4
6
|
import { useSelector, shallowEqual } from 'react-redux';
|
|
5
7
|
import { useIntl } from 'react-intl';
|
|
6
8
|
import { useLayoutDnd } from '../../../hooks';
|
|
@@ -9,7 +11,11 @@ import { makeSelectModelAndComponentSchemas } from '../../App/selectors';
|
|
|
9
11
|
import getTrad from '../../../utils/getTrad';
|
|
10
12
|
import GenericInput from './GenericInput';
|
|
11
13
|
|
|
12
|
-
const
|
|
14
|
+
const FIELD_SIZES = [[4, '33%'], [6, '50%'], [8, '66%'], [12, '100%']];
|
|
15
|
+
|
|
16
|
+
const NON_RESIZABLE_FIELD_TYPES = ['dynamiczone', 'component', 'json', 'richtext'];
|
|
17
|
+
|
|
18
|
+
const ModalForm = ({ onMetaChange, onSizeChange }) => {
|
|
13
19
|
const { formatMessage } = useIntl();
|
|
14
20
|
const { modifiedData, selectedField, attributes, fieldForm } = useLayoutDnd();
|
|
15
21
|
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
|
@@ -44,22 +50,21 @@ const ModalForm = ({ onChange }) => {
|
|
|
44
50
|
[selectedField, componentsAndModelsPossibleMainFields, modifiedData]
|
|
45
51
|
);
|
|
46
52
|
|
|
47
|
-
|
|
53
|
+
const metaFields = formToDisplay.map(meta => {
|
|
48
54
|
const formType = get(attributes, [selectedField, 'type']);
|
|
49
55
|
|
|
50
|
-
if (
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if ((formType === 'component' || formType === 'media') && meta !== 'label') {
|
|
56
|
+
if (
|
|
57
|
+
formType === 'dynamiczone' ||
|
|
58
|
+
(formType === 'component' && !['label', 'description'].includes(meta))
|
|
59
|
+
) {
|
|
55
60
|
return null;
|
|
56
61
|
}
|
|
57
62
|
|
|
58
|
-
if (
|
|
63
|
+
if (formType === 'component' && meta !== 'label') {
|
|
59
64
|
return null;
|
|
60
65
|
}
|
|
61
66
|
|
|
62
|
-
if (
|
|
67
|
+
if (['media', 'json', 'boolean'].includes(formType) && meta === 'placeholder') {
|
|
63
68
|
return null;
|
|
64
69
|
}
|
|
65
70
|
|
|
@@ -78,13 +83,49 @@ const ModalForm = ({ onChange }) => {
|
|
|
78
83
|
id: get(getInputProps(meta), 'label.id', 'app.utils.defaultMessage'),
|
|
79
84
|
})}
|
|
80
85
|
name={meta}
|
|
81
|
-
onChange={
|
|
82
|
-
value={get(fieldForm, meta, '')}
|
|
86
|
+
onChange={onMetaChange}
|
|
87
|
+
value={get(fieldForm, ['metadata', meta], '')}
|
|
83
88
|
options={getSelectedItemSelectOptions(formType)}
|
|
84
89
|
/>
|
|
85
90
|
</GridItem>
|
|
86
91
|
);
|
|
87
92
|
});
|
|
93
|
+
|
|
94
|
+
const canResize = !NON_RESIZABLE_FIELD_TYPES.includes(attributes[selectedField].type);
|
|
95
|
+
|
|
96
|
+
const sizeField = (
|
|
97
|
+
<GridItem col={6} key="size">
|
|
98
|
+
<Select
|
|
99
|
+
value={fieldForm?.size}
|
|
100
|
+
name="size"
|
|
101
|
+
onChange={value => {
|
|
102
|
+
onSizeChange({ name: selectedField, value });
|
|
103
|
+
}}
|
|
104
|
+
label={formatMessage({
|
|
105
|
+
id: getTrad('containers.SettingPage.editSettings.size.label'),
|
|
106
|
+
defaultMessage: 'Size',
|
|
107
|
+
})}
|
|
108
|
+
>
|
|
109
|
+
{FIELD_SIZES.map(([value, label]) => (
|
|
110
|
+
<Option key={value} value={value}>
|
|
111
|
+
{label}
|
|
112
|
+
</Option>
|
|
113
|
+
))}
|
|
114
|
+
</Select>
|
|
115
|
+
</GridItem>
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<>
|
|
120
|
+
{metaFields}
|
|
121
|
+
{canResize && sizeField}
|
|
122
|
+
</>
|
|
123
|
+
);
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
ModalForm.propTypes = {
|
|
127
|
+
onMetaChange: PropTypes.func.isRequired,
|
|
128
|
+
onSizeChange: PropTypes.func.isRequired,
|
|
88
129
|
};
|
|
89
130
|
|
|
90
131
|
export default ModalForm;
|
|
@@ -110,6 +110,14 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
110
110
|
});
|
|
111
111
|
};
|
|
112
112
|
|
|
113
|
+
const handleSizeChange = ({ name, value }) => {
|
|
114
|
+
dispatch({
|
|
115
|
+
type: 'ON_CHANGE_SIZE',
|
|
116
|
+
name,
|
|
117
|
+
value,
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
113
121
|
const handleMetaSubmit = e => {
|
|
114
122
|
e.preventDefault();
|
|
115
123
|
dispatch({
|
|
@@ -365,7 +373,8 @@ const EditSettingsView = ({ mainLayout, components, isContentTypeView, slug, upd
|
|
|
365
373
|
onSubmit={handleMetaSubmit}
|
|
366
374
|
onToggle={handleToggleModal}
|
|
367
375
|
type={get(attributes, [metaToEdit, 'type'], '')}
|
|
368
|
-
|
|
376
|
+
onMetaChange={handleMetaChange}
|
|
377
|
+
onSizeChange={handleSizeChange}
|
|
369
378
|
/>
|
|
370
379
|
)}
|
|
371
380
|
</Main>
|
|
@@ -4,7 +4,7 @@ import get from 'lodash/get';
|
|
|
4
4
|
import cloneDeep from 'lodash/cloneDeep';
|
|
5
5
|
|
|
6
6
|
import { arrayMoveItem } from '../../utils';
|
|
7
|
-
import { formatLayout,
|
|
7
|
+
import { formatLayout, getDefaultInputSize, getFieldSize, setFieldSize } from './utils/layout';
|
|
8
8
|
|
|
9
9
|
const initialState = {
|
|
10
10
|
fieldForm: {},
|
|
@@ -45,7 +45,7 @@ const reducer = (state = initialState, action) =>
|
|
|
45
45
|
}
|
|
46
46
|
case 'ON_ADD_FIELD': {
|
|
47
47
|
const newState = cloneDeep(state);
|
|
48
|
-
const size =
|
|
48
|
+
const size = getDefaultInputSize(
|
|
49
49
|
get(newState, ['modifiedData', 'attributes', action.name, 'type'], '')
|
|
50
50
|
);
|
|
51
51
|
const listSize = get(newState, layoutPathEdit, []).length;
|
|
@@ -76,7 +76,11 @@ const reducer = (state = initialState, action) =>
|
|
|
76
76
|
break;
|
|
77
77
|
}
|
|
78
78
|
case 'ON_CHANGE_META': {
|
|
79
|
-
set(draftState, ['metaForm', ...action.keys], action.value);
|
|
79
|
+
set(draftState, ['metaForm', 'metadata', ...action.keys], action.value);
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
case 'ON_CHANGE_SIZE': {
|
|
83
|
+
set(draftState, ['metaForm', 'size'], action.value);
|
|
80
84
|
break;
|
|
81
85
|
}
|
|
82
86
|
case 'ON_RESET': {
|
|
@@ -168,11 +172,28 @@ const reducer = (state = initialState, action) =>
|
|
|
168
172
|
}
|
|
169
173
|
case 'SET_FIELD_TO_EDIT': {
|
|
170
174
|
draftState.metaToEdit = action.name;
|
|
171
|
-
draftState.metaForm =
|
|
175
|
+
draftState.metaForm = {
|
|
176
|
+
metadata: get(state, ['modifiedData', 'metadatas', action.name, 'edit'], {}),
|
|
177
|
+
size:
|
|
178
|
+
getFieldSize(action.name, state.modifiedData?.layouts?.edit) ?? getDefaultInputSize(),
|
|
179
|
+
};
|
|
180
|
+
|
|
172
181
|
break;
|
|
173
182
|
}
|
|
174
183
|
case 'SUBMIT_META_FORM': {
|
|
175
|
-
set(
|
|
184
|
+
set(
|
|
185
|
+
draftState,
|
|
186
|
+
['modifiedData', 'metadatas', state.metaToEdit, 'edit'],
|
|
187
|
+
state.metaForm.metadata
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const layoutsCopy = cloneDeep(get(state, layoutPathEdit, []));
|
|
191
|
+
const nextLayoutValue = setFieldSize(state.metaToEdit, state.metaForm.size, layoutsCopy);
|
|
192
|
+
|
|
193
|
+
if (nextLayoutValue.length > 0) {
|
|
194
|
+
set(draftState, layoutPathEdit, formatLayout(nextLayoutValue));
|
|
195
|
+
}
|
|
196
|
+
|
|
176
197
|
break;
|
|
177
198
|
}
|
|
178
199
|
case 'SUBMIT_SUCCEEDED': {
|
|
@@ -28,13 +28,7 @@ const formatLayout = arr => {
|
|
|
28
28
|
|
|
29
29
|
return acc2;
|
|
30
30
|
}, []);
|
|
31
|
-
const rowId =
|
|
32
|
-
acc.length === 0
|
|
33
|
-
? 0
|
|
34
|
-
: Math.max.apply(
|
|
35
|
-
Math,
|
|
36
|
-
acc.map(o => o.rowId)
|
|
37
|
-
) + 1;
|
|
31
|
+
const rowId = acc.length === 0 ? 0 : Math.max.apply(Math, acc.map(o => o.rowId)) + 1;
|
|
38
32
|
|
|
39
33
|
const currentRowSize = getRowSize(currentRow);
|
|
40
34
|
|
|
@@ -75,7 +69,7 @@ const unformatLayout = arr => {
|
|
|
75
69
|
}, []);
|
|
76
70
|
};
|
|
77
71
|
|
|
78
|
-
const
|
|
72
|
+
const getDefaultInputSize = type => {
|
|
79
73
|
switch (type) {
|
|
80
74
|
case 'boolean':
|
|
81
75
|
case 'date':
|
|
@@ -95,4 +89,41 @@ const getInputSize = type => {
|
|
|
95
89
|
}
|
|
96
90
|
};
|
|
97
91
|
|
|
98
|
-
|
|
92
|
+
const getFieldSize = (name, layouts = []) => {
|
|
93
|
+
return layouts.reduce((acc, { rowContent }) => {
|
|
94
|
+
const size = rowContent.find(row => row.name === name)?.size ?? null;
|
|
95
|
+
|
|
96
|
+
if (size) {
|
|
97
|
+
acc = size;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
return acc;
|
|
101
|
+
}, null);
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const setFieldSize = (name, size, layouts = []) => {
|
|
105
|
+
return layouts.map(row => {
|
|
106
|
+
row.rowContent = row.rowContent.map(column => {
|
|
107
|
+
if (column.name === name) {
|
|
108
|
+
return {
|
|
109
|
+
...column,
|
|
110
|
+
size,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
return column;
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
return row;
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
export {
|
|
122
|
+
createLayout,
|
|
123
|
+
formatLayout,
|
|
124
|
+
getDefaultInputSize,
|
|
125
|
+
getFieldSize,
|
|
126
|
+
setFieldSize,
|
|
127
|
+
getRowSize,
|
|
128
|
+
unformatLayout,
|
|
129
|
+
};
|
|
@@ -309,6 +309,7 @@ const EditView = ({
|
|
|
309
309
|
)}
|
|
310
310
|
<Box as="aside" aria-labelledby="links">
|
|
311
311
|
<Stack size={2}>
|
|
312
|
+
<InjectionZone area="contentManager.editView.right-links" slug={slug} />
|
|
312
313
|
{slug !== 'strapi::administrator' && (
|
|
313
314
|
<CheckPermissions permissions={ctbPermissions}>
|
|
314
315
|
<LinkButton
|
|
@@ -343,7 +344,7 @@ const EditView = ({
|
|
|
343
344
|
})}
|
|
344
345
|
</LinkButton>
|
|
345
346
|
</CheckPermissions>
|
|
346
|
-
|
|
347
|
+
|
|
347
348
|
{allowedActions.canDelete && (
|
|
348
349
|
<DeleteLink
|
|
349
350
|
isCreatingEntry={isCreatingEntry}
|