@strapi/admin 4.0.7 → 4.1.1-alpha.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/DynamicTable/CellContent/CellValue.js +2 -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/index.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/pages/App/index.js +15 -2
- package/admin/src/content-manager/pages/EditSettingsView/components/FormModal.js +4 -3
- package/admin/src/content-manager/pages/EditSettingsView/components/ModalForm.js +46 -4
- 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/content-manager/pages/ListSettingsView/components/DraggableCard.js +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/components/SortDisplayedFields.js +22 -4
- package/admin/src/content-manager/pages/ListSettingsView/reducer.js +1 -1
- package/admin/src/pages/Admin/index.js +2 -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/MarketplacePage/index.js +13 -13
- package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContentBox/index.js +1 -1
- 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 +44 -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 +663 -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.ee6e45c9.chunk.js +2 -0
- package/build/{6060.1a1bd16a.chunk.js.LICENSE.txt → 2736.ee6e45c9.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/{4801.3a0d8fcd.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.b6c950c2.chunk.js → 8042.9b85175a.chunk.js} +2 -2
- package/build/{3215.b6c950c2.chunk.js.LICENSE.txt → 8042.9b85175a.chunk.js.LICENSE.txt} +0 -0
- package/build/849.9075d399.chunk.js +1 -0
- package/build/{9235.63b1528f.chunk.js → 9235.ced8aebf.chunk.js} +1 -1
- package/build/9238.bdd93dae.chunk.js +1 -0
- package/build/9988.b4229043.chunk.js +2 -0
- package/build/{4741.57e58885.chunk.js.LICENSE.txt → 9988.b4229043.chunk.js.LICENSE.txt} +0 -0
- package/build/Admin-authenticatedApp.37817197.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.0981141a.chunk.js +1 -0
- package/build/api-tokens-edit-page.3faf1af1.chunk.js +1 -0
- package/build/api-tokens-list-page.26a05a21.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.141d110d.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.d2080111.chunk.js +1 -0
- 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/fr-json.a9ce0700.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.aecb7e01.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.dd36fdc0.chunk.js +1 -0
- package/build/main.8727904d.js +2 -0
- package/build/{main.fcbcdd20.js.LICENSE.txt → main.8727904d.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.32f93f84.js → runtime~main.7a0fa9c1.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.d7345fe1.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-permissions-translation-dk-json.89d41c4b.chunk.js +1 -0
- 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/index.js +1 -1
- package/package.json +10 -10
- package/build/1024.efaaca35.chunk.js +0 -1
- package/build/1856.ec8cf094.chunk.js +0 -1
- package/build/2912.b886455f.chunk.js +0 -1
- package/build/4261.d5024c20.chunk.js +0 -1
- package/build/4362.0700c5df.chunk.js +0 -1
- package/build/4672.e18b4834.chunk.js +0 -1
- package/build/4715.7f86301d.chunk.js +0 -1
- package/build/4741.57e58885.chunk.js +0 -2
- package/build/4801.3a0d8fcd.chunk.js +0 -2
- package/build/497.9a3be008.chunk.js +0 -1
- package/build/4982.52a2ce10.chunk.js +0 -1
- package/build/6060.1a1bd16a.chunk.js +0 -2
- package/build/6250.2172d040.chunk.js +0 -1
- package/build/6925.4767e761.chunk.js +0 -2
- package/build/7841.c4d33a2f.chunk.js +0 -1
- package/build/849.46892e8e.chunk.js +0 -1
- package/build/Admin-authenticatedApp.c6b9128c.chunk.js +0 -1
- package/build/Admin_homePage.f044cfaf.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-create-page.ebe57c8e.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.9c7ee647.chunk.js +0 -1
- package/build/content-type-builder-translation-dk-json.098bd218.chunk.js +0 -1
- package/build/content-type-builder-translation-ko-json.2a5e0769.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.448433af.chunk.js +0 -1
- package/build/en-json.ec998c8f.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.0ba8ab95.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.fcbcdd20.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.113fd6b8.chunk.js +0 -1
- package/build/upload-translation-dk-json.bc6af8b4.chunk.js +0 -1
- package/build/upload-translation-en-json.6b529046.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.36c37a29.chunk.js +0 -1
- package/build/users-advanced-settings-page.627f173b.chunk.js +0 -1
- package/build/users-permissions-translation-dk-json.3e0295e5.chunk.js +0 -1
- package/build/vi-json.e993857a.chunk.js +0 -1
- package/build/webhook-edit-page.e463d0ab.chunk.js +0 -1
- package/build/webhook-list-page.b7649616.chunk.js +0 -1
- package/build/zh-Hans-json.fcc53388.chunk.js +0 -1
- package/build/zh-json.2e4c9ef4.chunk.js +0 -1
|
@@ -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 (
|
|
@@ -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,7 +50,7 @@ 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
56
|
if (
|
|
@@ -77,13 +83,49 @@ const ModalForm = ({ onChange }) => {
|
|
|
77
83
|
id: get(getInputProps(meta), 'label.id', 'app.utils.defaultMessage'),
|
|
78
84
|
})}
|
|
79
85
|
name={meta}
|
|
80
|
-
onChange={
|
|
81
|
-
value={get(fieldForm, meta, '')}
|
|
86
|
+
onChange={onMetaChange}
|
|
87
|
+
value={get(fieldForm, ['metadata', meta], '')}
|
|
82
88
|
options={getSelectedItemSelectOptions(formType)}
|
|
83
89
|
/>
|
|
84
90
|
</GridItem>
|
|
85
91
|
);
|
|
86
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,
|
|
87
129
|
};
|
|
88
130
|
|
|
89
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}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState } from 'react';
|
|
1
|
+
import React, { useState, useRef, useEffect } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { PropTypes } from 'prop-types';
|
|
4
4
|
import { useIntl } from 'react-intl';
|
|
@@ -36,6 +36,24 @@ const SortDisplayedFields = ({
|
|
|
36
36
|
}) => {
|
|
37
37
|
const { formatMessage } = useIntl();
|
|
38
38
|
const [isDraggingSibling, setIsDraggingSibling] = useState(false);
|
|
39
|
+
const [lastAction, setLastAction] = useState(null);
|
|
40
|
+
const scrollableContainerRef = useRef();
|
|
41
|
+
|
|
42
|
+
function handleAddField(...args) {
|
|
43
|
+
setLastAction('add');
|
|
44
|
+
onAddField(...args);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function handleRemoveField(...args) {
|
|
48
|
+
setLastAction('remove');
|
|
49
|
+
onRemoveField(...args);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
useEffect(() => {
|
|
53
|
+
if (lastAction === 'add' && scrollableContainerRef?.current) {
|
|
54
|
+
scrollableContainerRef.current.scrollLeft = scrollableContainerRef.current.scrollWidth;
|
|
55
|
+
}
|
|
56
|
+
}, [displayedFields, lastAction]);
|
|
39
57
|
|
|
40
58
|
return (
|
|
41
59
|
<>
|
|
@@ -56,7 +74,7 @@ const SortDisplayedFields = ({
|
|
|
56
74
|
borderWidth="1px"
|
|
57
75
|
hasRadius
|
|
58
76
|
>
|
|
59
|
-
<ScrollableContainer size="1" paddingBottom={4}>
|
|
77
|
+
<ScrollableContainer size="1" paddingBottom={4} ref={scrollableContainerRef}>
|
|
60
78
|
<Stack horizontal size={3}>
|
|
61
79
|
{displayedFields.map((field, index) => (
|
|
62
80
|
<DraggableCard
|
|
@@ -65,7 +83,7 @@ const SortDisplayedFields = ({
|
|
|
65
83
|
isDraggingSibling={isDraggingSibling}
|
|
66
84
|
onMoveField={onMoveField}
|
|
67
85
|
onClickEditField={onClickEditField}
|
|
68
|
-
onRemoveField={e =>
|
|
86
|
+
onRemoveField={e => handleRemoveField(e, index)}
|
|
69
87
|
name={field}
|
|
70
88
|
labelField={metadatas[field].list.label || field}
|
|
71
89
|
setIsDraggingSibling={setIsDraggingSibling}
|
|
@@ -85,7 +103,7 @@ const SortDisplayedFields = ({
|
|
|
85
103
|
data-testid="add-field"
|
|
86
104
|
>
|
|
87
105
|
{listRemainingFields.map(field => (
|
|
88
|
-
<MenuItem key={field} onClick={() =>
|
|
106
|
+
<MenuItem key={field} onClick={() => handleAddField(field)}>
|
|
89
107
|
{field}
|
|
90
108
|
</MenuItem>
|
|
91
109
|
))}
|
|
@@ -17,7 +17,7 @@ const reducer = (state = initialState, action) =>
|
|
|
17
17
|
switch (action.type) {
|
|
18
18
|
case 'ADD_FIELD': {
|
|
19
19
|
const layoutFieldList = get(state, layoutFieldListPath, []);
|
|
20
|
-
set(draftState, layoutFieldListPath, [action.item
|
|
20
|
+
set(draftState, layoutFieldListPath, [...layoutFieldList, action.item]);
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
23
|
case 'MOVE_FIELD': {
|
|
@@ -15,6 +15,7 @@ import AppLayout from '../../layouts/AppLayout';
|
|
|
15
15
|
import { useMenu, useReleaseNotification } from '../../hooks';
|
|
16
16
|
import Onboarding from './Onboarding';
|
|
17
17
|
import { createRoute } from '../../utils';
|
|
18
|
+
import GuidedTourModal from '../../components/GuidedTour/Modal';
|
|
18
19
|
|
|
19
20
|
const CM = lazy(() =>
|
|
20
21
|
import(/* webpackChunkName: "content-manager" */ '../../content-manager/pages/App')
|
|
@@ -92,6 +93,7 @@ const Admin = () => {
|
|
|
92
93
|
<Route path="" component={NotFoundPage} />
|
|
93
94
|
</Switch>
|
|
94
95
|
</Suspense>
|
|
96
|
+
<GuidedTourModal />
|
|
95
97
|
<Onboarding />
|
|
96
98
|
</AppLayout>
|
|
97
99
|
</DndProvider>
|
|
@@ -10,7 +10,7 @@ import { Flex } from '@strapi/design-system/Flex';
|
|
|
10
10
|
import { Link } from '@strapi/design-system/Link';
|
|
11
11
|
import { Button } from '@strapi/design-system/Button';
|
|
12
12
|
import { TextInput } from '@strapi/design-system/TextInput';
|
|
13
|
-
import { Checkbox } from '@strapi/design-system/Checkbox';
|
|
13
|
+
// import { Checkbox } from '@strapi/design-system/Checkbox';
|
|
14
14
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
15
15
|
import { Typography } from '@strapi/design-system/Typography';
|
|
16
16
|
import EyeStriked from '@strapi/icons/EyeStriked';
|
|
@@ -30,9 +30,12 @@ import FieldActionWrapper from '../FieldActionWrapper';
|
|
|
30
30
|
const CenteredBox = styled(Box)`
|
|
31
31
|
text-align: center;
|
|
32
32
|
`;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
|
|
34
|
+
// Experiment only until the next release
|
|
35
|
+
// To uncomment then
|
|
36
|
+
// const A = styled.a`
|
|
37
|
+
// color: ${({ theme }) => theme.colors.primary600};
|
|
38
|
+
// `;
|
|
36
39
|
|
|
37
40
|
const PasswordInput = styled(TextInput)`
|
|
38
41
|
::-ms-reveal {
|
|
@@ -271,7 +274,9 @@ const Register = ({ fieldsToDisable, noSignin, onSubmit, schema }) => {
|
|
|
271
274
|
})}
|
|
272
275
|
type={confirmPasswordShown ? 'text' : 'password'}
|
|
273
276
|
/>
|
|
274
|
-
|
|
277
|
+
{/* Experiment only until the next release
|
|
278
|
+
To uncomment then */}
|
|
279
|
+
{/* <Checkbox
|
|
275
280
|
onValueChange={checked => {
|
|
276
281
|
handleChange({ target: { value: checked, name: 'news' } });
|
|
277
282
|
}}
|
|
@@ -304,7 +309,7 @@ const Register = ({ fieldsToDisable, noSignin, onSubmit, schema }) => {
|
|
|
304
309
|
),
|
|
305
310
|
}
|
|
306
311
|
)}
|
|
307
|
-
</Checkbox>
|
|
312
|
+
</Checkbox> */}
|
|
308
313
|
<Button fullWidth size="L" type="submit">
|
|
309
314
|
{formatMessage({
|
|
310
315
|
id: 'Auth.form.button.register',
|
|
@@ -4,9 +4,10 @@ import camelCase from 'lodash/camelCase';
|
|
|
4
4
|
import get from 'lodash/get';
|
|
5
5
|
import omit from 'lodash/omit';
|
|
6
6
|
import { Redirect, useRouteMatch, useHistory } from 'react-router-dom';
|
|
7
|
-
import { auth, useQuery } from '@strapi/helper-plugin';
|
|
7
|
+
import { auth, useQuery, useGuidedTour } from '@strapi/helper-plugin';
|
|
8
8
|
import PropTypes from 'prop-types';
|
|
9
9
|
import forms from 'ee_else_ce/pages/AuthPage/utils/forms';
|
|
10
|
+
import persistStateToLocaleStorage from '../../components/GuidedTour/utils/persistStateToLocaleStorage';
|
|
10
11
|
import useLocalesProvider from '../../components/LocalesProvider/useLocalesProvider';
|
|
11
12
|
import formatAPIErrors from '../../utils/formatAPIErrors';
|
|
12
13
|
import init from './init';
|
|
@@ -15,6 +16,7 @@ import { initialState, reducer } from './reducer';
|
|
|
15
16
|
const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
16
17
|
const { push } = useHistory();
|
|
17
18
|
const { changeLocale } = useLocalesProvider();
|
|
19
|
+
const { setSkipped } = useGuidedTour();
|
|
18
20
|
const {
|
|
19
21
|
params: { authType },
|
|
20
22
|
} = useRouteMatch('/auth/:authType');
|
|
@@ -176,6 +178,18 @@ const AuthPage = ({ hasAdmin, setHasAdmin }) => {
|
|
|
176
178
|
// Redirect to the homePage
|
|
177
179
|
setSubmitting(false);
|
|
178
180
|
setHasAdmin(true);
|
|
181
|
+
|
|
182
|
+
const { roles } = user;
|
|
183
|
+
|
|
184
|
+
if (roles) {
|
|
185
|
+
const isUserSuperAdmin = roles.find(({ code }) => code === 'strapi-super-admin');
|
|
186
|
+
|
|
187
|
+
if (isUserSuperAdmin) {
|
|
188
|
+
persistStateToLocaleStorage.setSkipped(false);
|
|
189
|
+
setSkipped(false);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
179
193
|
push('/');
|
|
180
194
|
} catch (err) {
|
|
181
195
|
if (err.response) {
|
|
@@ -8,13 +8,15 @@ import { FormattedMessage } from 'react-intl';
|
|
|
8
8
|
import styled from 'styled-components';
|
|
9
9
|
import { Helmet } from 'react-helmet';
|
|
10
10
|
import { useHistory } from 'react-router-dom';
|
|
11
|
-
import { LoadingIndicatorPage } from '@strapi/helper-plugin';
|
|
11
|
+
import { LoadingIndicatorPage, useGuidedTour } from '@strapi/helper-plugin';
|
|
12
12
|
import { Layout } from '@strapi/design-system/Layout';
|
|
13
13
|
import { Main } from '@strapi/design-system/Main';
|
|
14
14
|
import { Box } from '@strapi/design-system/Box';
|
|
15
15
|
import { Grid, GridItem } from '@strapi/design-system/Grid';
|
|
16
16
|
import Logo from '../../assets/images/homepage-logo.png';
|
|
17
17
|
import { useModels } from '../../hooks';
|
|
18
|
+
import isGuidedTourCompleted from '../../components/GuidedTour/utils/isGuidedTourCompleted';
|
|
19
|
+
import GuidedTourHomepage from '../../components/GuidedTour/Homepage';
|
|
18
20
|
import SocialLinks from './SocialLinks';
|
|
19
21
|
import HomeHeader from './HomeHeader';
|
|
20
22
|
import ContentBlocks from './ContentBlocks';
|
|
@@ -31,6 +33,10 @@ const LogoContainer = styled(Box)`
|
|
|
31
33
|
const HomePage = () => {
|
|
32
34
|
// // Temporary until we develop the menu API
|
|
33
35
|
const { collectionTypes, singleTypes, isLoading: isLoadingForModels } = useModels();
|
|
36
|
+
const { guidedTourState, isGuidedTourVisible, isSkipped } = useGuidedTour();
|
|
37
|
+
|
|
38
|
+
const showGuidedTour =
|
|
39
|
+
!isGuidedTourCompleted(guidedTourState) && isGuidedTourVisible && !isSkipped;
|
|
34
40
|
|
|
35
41
|
const { push } = useHistory();
|
|
36
42
|
const handleClick = e => {
|
|
@@ -71,7 +77,7 @@ const HomePage = () => {
|
|
|
71
77
|
</Grid>
|
|
72
78
|
<Grid gap={6}>
|
|
73
79
|
<GridItem col={8} s={12}>
|
|
74
|
-
<ContentBlocks />
|
|
80
|
+
{showGuidedTour ? <GuidedTourHomepage /> : <ContentBlocks />}
|
|
75
81
|
</GridItem>
|
|
76
82
|
<GridItem col={4} s={12}>
|
|
77
83
|
<SocialLinks />
|
|
@@ -10,6 +10,7 @@ import { Stack } from '@strapi/design-system/Stack';
|
|
|
10
10
|
import { LinkButton } from '@strapi/design-system/LinkButton';
|
|
11
11
|
import { Main } from '@strapi/design-system/Main';
|
|
12
12
|
import { Typography } from '@strapi/design-system/Typography';
|
|
13
|
+
import ExternalLink from '@strapi/icons/ExternalLink';
|
|
13
14
|
import adminPermissions from '../../permissions';
|
|
14
15
|
import MarketplacePicture from './assets/marketplace-coming-soon.png';
|
|
15
16
|
|
|
@@ -79,31 +80,30 @@ const MarketPlacePage = () => {
|
|
|
79
80
|
</Typography>
|
|
80
81
|
<Typography variant="alpha" textColor="primary700">
|
|
81
82
|
{formatMessage({
|
|
82
|
-
id: 'admin.pages.MarketPlacePage.
|
|
83
|
-
defaultMessage: '
|
|
83
|
+
id: 'admin.pages.MarketPlacePage.published',
|
|
84
|
+
defaultMessage: 'Finally here.',
|
|
84
85
|
})}
|
|
85
86
|
</Typography>
|
|
86
|
-
<Flex maxWidth={pxToRem(
|
|
87
|
+
<Flex maxWidth={pxToRem(620)} paddingTop={3}>
|
|
87
88
|
<CenterTypography variant="epsilon" textColor="neutral600">
|
|
88
89
|
{formatMessage({
|
|
89
|
-
id: 'admin.pages.MarketPlacePage.content.subtitle',
|
|
90
|
+
id: 'admin.pages.MarketPlacePage.content.subtitle.published',
|
|
90
91
|
defaultMessage:
|
|
91
|
-
'The
|
|
92
|
+
'The web marketplace helps you get the most of Strapi. In addition, we are working hard to offer the best experience to discover and install plugins, directly from the app.',
|
|
92
93
|
})}
|
|
93
94
|
</CenterTypography>
|
|
94
95
|
</Flex>
|
|
95
96
|
<Stack paddingTop={6} horizontal size={2}>
|
|
96
|
-
|
|
97
|
-
{/* <LinkButton href="https://strapi.io/" size="L" variant="secondary">
|
|
97
|
+
<LinkButton href="https://market.strapi.io" size="L" variant="primary" endIcon={<ExternalLink />}>
|
|
98
98
|
{formatMessage({
|
|
99
|
-
id: 'admin.pages.MarketPlacePage.submit.
|
|
100
|
-
defaultMessage: '
|
|
99
|
+
id: 'admin.pages.MarketPlacePage.submit.market.link',
|
|
100
|
+
defaultMessage: 'Visit the web marketplace',
|
|
101
101
|
})}
|
|
102
|
-
</LinkButton>
|
|
103
|
-
<LinkButton href="https://strapi.io/
|
|
102
|
+
</LinkButton>
|
|
103
|
+
<LinkButton href="https://market.strapi.io/submit-plugin" size="L" variant="secondary">
|
|
104
104
|
{formatMessage({
|
|
105
|
-
id: 'admin.pages.MarketPlacePage.
|
|
106
|
-
defaultMessage: '
|
|
105
|
+
id: 'admin.pages.MarketPlacePage.submit.plugin.link',
|
|
106
|
+
defaultMessage: 'Submit your plugin',
|
|
107
107
|
})}
|
|
108
108
|
</LinkButton>
|
|
109
109
|
</Stack>
|
package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/components/ContentBox/index.js
CHANGED
|
@@ -20,7 +20,7 @@ const HeaderContentBox = ({ apiToken }) => {
|
|
|
20
20
|
<span style={{ alignSelf: 'start' }}>
|
|
21
21
|
<CopyToClipboard
|
|
22
22
|
onCopy={() => {
|
|
23
|
-
trackUsageRef('didCopyTokenKey');
|
|
23
|
+
trackUsageRef.current('didCopyTokenKey');
|
|
24
24
|
toggleNotification({
|
|
25
25
|
type: 'success',
|
|
26
26
|
message: { id: 'Settings.apiTokens.notification.copied' },
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
useOverlayBlocker,
|
|
8
8
|
useNotification,
|
|
9
9
|
useTracking,
|
|
10
|
+
useGuidedTour,
|
|
10
11
|
} from '@strapi/helper-plugin';
|
|
11
12
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
12
13
|
import { Main } from '@strapi/design-system/Main';
|
|
@@ -40,6 +41,7 @@ const ApiTokenCreateView = () => {
|
|
|
40
41
|
const history = useHistory();
|
|
41
42
|
const { trackUsage } = useTracking();
|
|
42
43
|
const trackUsageRef = useRef(trackUsage);
|
|
44
|
+
const { setCurrentStep } = useGuidedTour();
|
|
43
45
|
|
|
44
46
|
const {
|
|
45
47
|
params: { id },
|
|
@@ -103,6 +105,7 @@ const ApiTokenCreateView = () => {
|
|
|
103
105
|
|
|
104
106
|
if (isCreating) {
|
|
105
107
|
history.replace(`/settings/api-tokens/${response.id}`, { apiToken: response });
|
|
108
|
+
setCurrentStep('apiTokens.success');
|
|
106
109
|
}
|
|
107
110
|
} catch (err) {
|
|
108
111
|
const errors = formatAPIErrors(err.response.data);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
2
|
import { useIntl } from 'react-intl';
|
|
3
3
|
import {
|
|
4
4
|
SettingsPageTitle,
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
NoContent,
|
|
10
10
|
DynamicTable,
|
|
11
11
|
useTracking,
|
|
12
|
+
useGuidedTour,
|
|
12
13
|
} from '@strapi/helper-plugin';
|
|
13
14
|
import { HeaderLayout, ContentLayout } from '@strapi/design-system/Layout';
|
|
14
15
|
import { Main } from '@strapi/design-system/Main';
|
|
@@ -33,6 +34,14 @@ const ApiTokenListView = () => {
|
|
|
33
34
|
} = useRBAC(adminPermissions.settings['api-tokens']);
|
|
34
35
|
const { push } = useHistory();
|
|
35
36
|
const { trackUsage } = useTracking();
|
|
37
|
+
const { startSection } = useGuidedTour();
|
|
38
|
+
const startSectionRef = useRef(startSection);
|
|
39
|
+
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (startSectionRef.current) {
|
|
42
|
+
startSectionRef.current('apiTokens');
|
|
43
|
+
}
|
|
44
|
+
}, []);
|
|
36
45
|
|
|
37
46
|
useEffect(() => {
|
|
38
47
|
push({ search: qs.stringify({ sort: 'name:ASC' }, { encode: false }) });
|
|
@@ -111,7 +120,7 @@ const ApiTokenListView = () => {
|
|
|
111
120
|
>
|
|
112
121
|
{formatMessage({
|
|
113
122
|
id: 'Settings.apiTokens.create',
|
|
114
|
-
defaultMessage: '
|
|
123
|
+
defaultMessage: 'Create new API Token',
|
|
115
124
|
})}
|
|
116
125
|
</LinkButton>
|
|
117
126
|
) : (
|
|
@@ -13,8 +13,8 @@ const RoleRow = ({ id, name, description, usersCount, icons }) => {
|
|
|
13
13
|
|
|
14
14
|
const usersCountText = formatMessage(
|
|
15
15
|
{
|
|
16
|
-
id: `Roles.RoleRow.user-count
|
|
17
|
-
defaultMessage: '{number} user',
|
|
16
|
+
id: `Roles.RoleRow.user-count`,
|
|
17
|
+
defaultMessage: '{number, plural, =0 {# user} one {# user} other {# users}}',
|
|
18
18
|
},
|
|
19
19
|
{ number: usersCount }
|
|
20
20
|
);
|