@strapi/admin 5.0.0-beta.9 → 5.0.0-rc.1
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/LICENSE +18 -3
- package/dist/admin/{AdminSeatInfo-cqB8nHFZ.js → AdminSeatInfo-E8azTFQY.js} +5 -5
- package/dist/admin/AdminSeatInfo-E8azTFQY.js.map +1 -0
- package/dist/admin/{AdminSeatInfo-_UxgNKbX.mjs → AdminSeatInfo-Q_hUNC5B.mjs} +5 -5
- package/dist/admin/AdminSeatInfo-Q_hUNC5B.mjs.map +1 -0
- package/dist/admin/{ApplicationInfoPage-6PD2owY8.mjs → ApplicationInfoPage-FvuI2dqs.mjs} +153 -158
- package/dist/admin/ApplicationInfoPage-FvuI2dqs.mjs.map +1 -0
- package/dist/admin/{ApplicationInfoPage-S18loXTF.js → ApplicationInfoPage-ODW6epX5.js} +161 -166
- package/dist/admin/ApplicationInfoPage-ODW6epX5.js.map +1 -0
- package/dist/admin/{AuthResponse-Y4lblDuD.mjs → AuthResponse-J8A48xdo.mjs} +9 -5
- package/dist/admin/AuthResponse-J8A48xdo.mjs.map +1 -0
- package/dist/admin/{AuthResponse-EiDRhJY8.js → AuthResponse-KlTDmm2i.js} +10 -6
- package/dist/admin/AuthResponse-KlTDmm2i.js.map +1 -0
- package/dist/admin/{AuthenticatedLayout-gOaUXjO8.mjs → AuthenticatedLayout-1zXrNSte.mjs} +177 -166
- package/dist/admin/AuthenticatedLayout-1zXrNSte.mjs.map +1 -0
- package/dist/admin/{AuthenticatedLayout-MDNNJRPg.js → AuthenticatedLayout-haMSd2JF.js} +192 -181
- package/dist/admin/AuthenticatedLayout-haMSd2JF.js.map +1 -0
- package/dist/admin/CreateActionEE-Yfp4hs7a.mjs +49 -0
- package/dist/admin/CreateActionEE-Yfp4hs7a.mjs.map +1 -0
- package/dist/admin/CreateActionEE-uqyKLxwI.js +76 -0
- package/dist/admin/CreateActionEE-uqyKLxwI.js.map +1 -0
- package/dist/admin/{CreatePage-puzZjQXr.mjs → CreatePage-UzCNaW8h.mjs} +13 -14
- package/dist/admin/CreatePage-UzCNaW8h.mjs.map +1 -0
- package/dist/admin/{CreatePage-Z_y-A5xj.js → CreatePage-X9rp03gy.js} +5 -5
- package/dist/admin/{CreatePage-Z_y-A5xj.js.map → CreatePage-X9rp03gy.js.map} +1 -1
- package/dist/admin/{CreatePage-GD7KENsP.mjs → CreatePage-embavU6j.mjs} +3 -3
- package/dist/admin/{CreatePage-GD7KENsP.mjs.map → CreatePage-embavU6j.mjs.map} +1 -1
- package/dist/admin/{CreatePage-5V60DKB0.js → CreatePage-zeisnPM2.js} +18 -19
- package/dist/admin/CreatePage-zeisnPM2.js.map +1 -0
- package/dist/admin/{CreateView-EjqRVjU_.mjs → CreateView-SQFk7zP8.mjs} +3 -3
- package/dist/admin/{CreateView-EjqRVjU_.mjs.map → CreateView-SQFk7zP8.mjs.map} +1 -1
- package/dist/admin/CreateView-Smkfwq2U.js +17 -0
- package/dist/admin/{CreateView-VYprogwB.js.map → CreateView-Smkfwq2U.js.map} +1 -1
- package/dist/admin/{CreateView-jM_w7R83.mjs → CreateView-phBO6q6q.mjs} +3 -3
- package/dist/admin/{CreateView-jM_w7R83.mjs.map → CreateView-phBO6q6q.mjs.map} +1 -1
- package/dist/admin/CreateView-yQvtXeP2.js +17 -0
- package/dist/admin/{CreateView-5V271zBl.js.map → CreateView-yQvtXeP2.js.map} +1 -1
- package/dist/admin/{EditPage-vRwS2OJZ.js → EditPage-1svcLlQN.js} +19 -19
- package/dist/admin/EditPage-1svcLlQN.js.map +1 -0
- package/dist/admin/{EditPage-HsLjcfgK.js → EditPage-GM7gM7Np.js} +15 -15
- package/dist/admin/EditPage-GM7gM7Np.js.map +1 -0
- package/dist/admin/{EditPage-W_qlhF-2.mjs → EditPage-QHC3cITE.mjs} +11 -11
- package/dist/admin/EditPage-QHC3cITE.mjs.map +1 -0
- package/dist/admin/{EditPage-WuJtih1X.js → EditPage-ix4Or3TO.js} +96 -91
- package/dist/admin/EditPage-ix4Or3TO.js.map +1 -0
- package/dist/admin/{EditPage-8_dXc9y1.mjs → EditPage-riE7hBMx.mjs} +9 -9
- package/dist/admin/EditPage-riE7hBMx.mjs.map +1 -0
- package/dist/admin/{EditPage-8fk5JEO7.mjs → EditPage-xDZwHLDD.mjs} +91 -86
- package/dist/admin/EditPage-xDZwHLDD.mjs.map +1 -0
- package/dist/admin/{EditView-Cac025JW.mjs → EditView-3TBDETCw.mjs} +10 -10
- package/dist/admin/EditView-3TBDETCw.mjs.map +1 -0
- package/dist/admin/{EditView-lhhZAQtN.js → EditView-z-CFelH2.js} +19 -19
- package/dist/admin/EditView-z-CFelH2.js.map +1 -0
- package/dist/admin/{EditViewPage-Q7N1TLU9.js → EditViewPage-Kw7Ezpay.js} +32 -32
- package/dist/admin/EditViewPage-Kw7Ezpay.js.map +1 -0
- package/dist/admin/{EditViewPage-f56oKqQ-.mjs → EditViewPage-M5Bto2f0.mjs} +23 -23
- package/dist/admin/EditViewPage-M5Bto2f0.mjs.map +1 -0
- package/dist/admin/{EventsTable-y6XT7dVi.js → EventsTable-ihsVS1kY.js} +2 -2
- package/dist/admin/{EventsTable-y6XT7dVi.js.map → EventsTable-ihsVS1kY.js.map} +1 -1
- package/dist/admin/{EventsTable-duSraBTj.mjs → EventsTable-xNALq0Xl.mjs} +2 -2
- package/dist/admin/{EventsTable-duSraBTj.mjs.map → EventsTable-xNALq0Xl.mjs.map} +1 -1
- package/dist/admin/{HomePage-UTLFs-4n.mjs → HomePage-1iC-u-RM.mjs} +3 -3
- package/dist/admin/{HomePage-UTLFs-4n.mjs.map → HomePage-1iC-u-RM.mjs.map} +1 -1
- package/dist/admin/{HomePage-vTms2gld.js → HomePage-5XpRwLIS.js} +3 -3
- package/dist/admin/{HomePage-vTms2gld.js.map → HomePage-5XpRwLIS.js.map} +1 -1
- package/dist/admin/{HomePage-4Hk9puW_.js → HomePage-6JeS-ulc.js} +18 -18
- package/dist/admin/HomePage-6JeS-ulc.js.map +1 -0
- package/dist/admin/{HomePage-d4h0KEnw.mjs → HomePage-pBVsiRLB.mjs} +12 -12
- package/dist/admin/HomePage-pBVsiRLB.mjs.map +1 -0
- package/dist/admin/{InstalledPluginsPage-9ooKCsS7.js → InstalledPluginsPage-QYeyWKla.js} +10 -10
- package/dist/admin/{InstalledPluginsPage-9ooKCsS7.js.map → InstalledPluginsPage-QYeyWKla.js.map} +1 -1
- package/dist/admin/{InstalledPluginsPage-nCdAsAAu.mjs → InstalledPluginsPage-wwA3VULI.mjs} +4 -4
- package/dist/admin/{InstalledPluginsPage-nCdAsAAu.mjs.map → InstalledPluginsPage-wwA3VULI.mjs.map} +1 -1
- package/dist/admin/{Layout-Ax9QtxH1.mjs → Layout-Dg3BpNCD.mjs} +22 -10
- package/dist/admin/Layout-Dg3BpNCD.mjs.map +1 -0
- package/dist/admin/{Layout-Bmmqv9h6.js → Layout-n5Z9I_69.js} +26 -14
- package/dist/admin/Layout-n5Z9I_69.js.map +1 -0
- package/dist/admin/{ListPage-4nzagne8.js → ListPage-8Tez014i.js} +79 -43
- package/dist/admin/ListPage-8Tez014i.js.map +1 -0
- package/dist/admin/{ListPage-10_h7FUt.js → ListPage-8iWYEe2_.js} +50 -49
- package/dist/admin/ListPage-8iWYEe2_.js.map +1 -0
- package/dist/admin/{ListPage-TWLqkRt6.js → ListPage-CxUAyot2.js} +27 -32
- package/dist/admin/ListPage-CxUAyot2.js.map +1 -0
- package/dist/admin/{ListPage-4n-Xb2aE.js → ListPage-KOIEopQN.js} +3 -3
- package/dist/admin/{ListPage-4n-Xb2aE.js.map → ListPage-KOIEopQN.js.map} +1 -1
- package/dist/admin/{ListPage-4kGSO2Ri.mjs → ListPage-Ka430VWJ.mjs} +40 -39
- package/dist/admin/ListPage-Ka430VWJ.mjs.map +1 -0
- package/dist/admin/{ListPage-OE9xQffQ.mjs → ListPage-P4Apgmd-.mjs} +18 -23
- package/dist/admin/ListPage-P4Apgmd-.mjs.map +1 -0
- package/dist/admin/{ListPage-EPIYY3Uf.mjs → ListPage-PfBDJtky.mjs} +71 -35
- package/dist/admin/ListPage-PfBDJtky.mjs.map +1 -0
- package/dist/admin/{ListPage-gbCO5Otz.mjs → ListPage-SnOw9EMq.mjs} +3 -3
- package/dist/admin/{ListPage-gbCO5Otz.mjs.map → ListPage-SnOw9EMq.mjs.map} +1 -1
- package/dist/admin/{ListPage-IgkmnCSY.js → ListPage-XYrZSP2n.js} +15 -22
- package/dist/admin/ListPage-XYrZSP2n.js.map +1 -0
- package/dist/admin/{ListPage-VGqEsiEA.mjs → ListPage-_sJsfVLq.mjs} +7 -14
- package/dist/admin/ListPage-_sJsfVLq.mjs.map +1 -0
- package/dist/admin/{ListView-uHb_Hgib.js → ListView-6U-6GqOi.js} +13 -13
- package/dist/admin/{ListView-uHb_Hgib.js.map → ListView-6U-6GqOi.js.map} +1 -1
- package/dist/admin/{ListView-Zvs5X2St.mjs → ListView-UKJyJnd2.mjs} +4 -4
- package/dist/admin/{ListView-Zvs5X2St.mjs.map → ListView-UKJyJnd2.mjs.map} +1 -1
- package/dist/admin/{ListView-pT2a-fdi.js → ListView-u3bQ6Jrd.js} +13 -13
- package/dist/admin/{ListView-pT2a-fdi.js.map → ListView-u3bQ6Jrd.js.map} +1 -1
- package/dist/admin/{ListView-gKrpPLEM.mjs → ListView-udsJ7zMT.mjs} +4 -4
- package/dist/admin/{ListView-gKrpPLEM.mjs.map → ListView-udsJ7zMT.mjs.map} +1 -1
- package/dist/admin/{Login-EcSP4AMG.js → Login-iUJs_YTe.js} +5 -5
- package/dist/admin/{Login-EcSP4AMG.js.map → Login-iUJs_YTe.js.map} +1 -1
- package/dist/admin/{Login-w4BUlNaE.mjs → Login-qOZJMFOX.mjs} +4 -4
- package/dist/admin/{Login-w4BUlNaE.mjs.map → Login-qOZJMFOX.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-b9NK8XXY.mjs → MagicLinkEE--uHOs_Sh.mjs} +3 -3
- package/dist/admin/{MagicLinkEE-b9NK8XXY.mjs.map → MagicLinkEE--uHOs_Sh.mjs.map} +1 -1
- package/dist/admin/{MagicLinkEE-qT5OE9Pm.js → MagicLinkEE-ZHDAMHRp.js} +3 -3
- package/dist/admin/{MagicLinkEE-qT5OE9Pm.js.map → MagicLinkEE-ZHDAMHRp.js.map} +1 -1
- package/dist/admin/{MarketplacePage-MVRrpUSk.js → MarketplacePage-FLcrHGFN.js} +123 -150
- package/dist/admin/MarketplacePage-FLcrHGFN.js.map +1 -0
- package/dist/admin/{MarketplacePage-oGhZBKgX.mjs → MarketplacePage-KyupKstI.mjs} +111 -138
- package/dist/admin/MarketplacePage-KyupKstI.mjs.map +1 -0
- package/dist/admin/{Ornaments-h_LCCr5P.mjs → Ornaments-jAwgQeK0.mjs} +2 -2
- package/dist/admin/{Ornaments-h_LCCr5P.mjs.map → Ornaments-jAwgQeK0.mjs.map} +1 -1
- package/dist/admin/{Ornaments-UTssGzOw.js → Ornaments-sFPQPOtb.js} +2 -2
- package/dist/admin/{Ornaments-UTssGzOw.js.map → Ornaments-sFPQPOtb.js.map} +1 -1
- package/dist/admin/{Permissions-kNVZVLmu.js → Permissions-SuZE5tW3.js} +265 -277
- package/dist/admin/Permissions-SuZE5tW3.js.map +1 -0
- package/dist/admin/{Permissions-lf6dNG4S.mjs → Permissions-oxdduJgE.mjs} +256 -269
- package/dist/admin/Permissions-oxdduJgE.mjs.map +1 -0
- package/dist/admin/{PrivateRoute-1hyhztQM.mjs → PrivateRoute-4oRTB_tX.mjs} +2 -2
- package/dist/admin/{PrivateRoute-1hyhztQM.mjs.map → PrivateRoute-4oRTB_tX.mjs.map} +1 -1
- package/dist/admin/{PrivateRoute-wBE5vMxe.js → PrivateRoute-ndqg7K6H.js} +3 -3
- package/dist/admin/{PrivateRoute-wBE5vMxe.js.map → PrivateRoute-ndqg7K6H.js.map} +1 -1
- package/dist/admin/{ProfilePage-zk-Py9wt.mjs → ProfilePage-4dKn6UUc.mjs} +10 -10
- package/dist/admin/ProfilePage-4dKn6UUc.mjs.map +1 -0
- package/dist/admin/{ProfilePage-ZlpnTKEF.js → ProfilePage-Ryrm4G10.js} +23 -23
- package/dist/admin/ProfilePage-Ryrm4G10.js.map +1 -0
- package/dist/admin/{PurchaseAuditLogs-9reb0oGz.js → PurchaseAuditLogs-EDV5UGnG.js} +2 -2
- package/dist/admin/{PurchaseAuditLogs-9reb0oGz.js.map → PurchaseAuditLogs-EDV5UGnG.js.map} +1 -1
- package/dist/admin/{PurchaseAuditLogs-iOYsTJA-.mjs → PurchaseAuditLogs-K5ZTiR8K.mjs} +2 -2
- package/dist/admin/{PurchaseAuditLogs-iOYsTJA-.mjs.map → PurchaseAuditLogs-K5ZTiR8K.mjs.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-S3xLiiv7.js → PurchaseSingleSignOn--Cb7M20e.js} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-S3xLiiv7.js.map → PurchaseSingleSignOn--Cb7M20e.js.map} +1 -1
- package/dist/admin/{PurchaseSingleSignOn-X629iA7K.mjs → PurchaseSingleSignOn-c143s7mz.mjs} +2 -2
- package/dist/admin/{PurchaseSingleSignOn-X629iA7K.mjs.map → PurchaseSingleSignOn-c143s7mz.mjs.map} +1 -1
- package/dist/admin/{SSOProviders-AirHFyBl.js → SSOProviders-QBcyB9VI.js} +5 -5
- package/dist/admin/SSOProviders-QBcyB9VI.js.map +1 -0
- package/dist/admin/{SSOProviders-t8D-v8As.mjs → SSOProviders-nMmBLr8g.mjs} +6 -6
- package/dist/admin/SSOProviders-nMmBLr8g.mjs.map +1 -0
- package/dist/admin/{SelectRoles-yM-LT458.mjs → SelectRoles-psJuDrRF.mjs} +4 -4
- package/dist/admin/{SelectRoles-yM-LT458.mjs.map → SelectRoles-psJuDrRF.mjs.map} +1 -1
- package/dist/admin/{SelectRoles-hyiyvsCG.js → SelectRoles-x3GAhhSJ.js} +5 -5
- package/dist/admin/{SelectRoles-hyiyvsCG.js.map → SelectRoles-x3GAhhSJ.js.map} +1 -1
- package/dist/admin/{SingleSignOnPage-3Mfu4dgn.js → SingleSignOnPage-83q-C4t-.js} +17 -17
- package/dist/admin/SingleSignOnPage-83q-C4t-.js.map +1 -0
- package/dist/admin/{SingleSignOnPage-wPZ1tqEk.mjs → SingleSignOnPage-9l6JRqDd.mjs} +7 -7
- package/dist/admin/SingleSignOnPage-9l6JRqDd.mjs.map +1 -0
- package/dist/admin/{Table-OcYvBab7.mjs → Table-I-45hnM1.mjs} +11 -22
- package/dist/admin/Table-I-45hnM1.mjs.map +1 -0
- package/dist/admin/{Table-N9PZc6xL.js → Table-oO6QTH1W.js} +12 -23
- package/dist/admin/Table-oO6QTH1W.js.map +1 -0
- package/dist/admin/{rbac-5b9ylhpa.js → Theme-7W0we6BI.js} +147 -80
- package/dist/admin/Theme-7W0we6BI.js.map +1 -0
- package/dist/admin/{rbac-oJEkQdXG.mjs → Theme-PrUuuGtN.mjs} +140 -81
- package/dist/admin/Theme-PrUuuGtN.mjs.map +1 -0
- package/dist/admin/{TokenTypeSelect-dWn05yGP.js → TokenTypeSelect-26DfB0-O.js} +10 -12
- package/dist/admin/TokenTypeSelect-26DfB0-O.js.map +1 -0
- package/dist/admin/{TokenTypeSelect-v6IYPaBF.mjs → TokenTypeSelect-xCzuaMQo.mjs} +7 -9
- package/dist/admin/TokenTypeSelect-xCzuaMQo.mjs.map +1 -0
- package/dist/admin/{UseCasePage-ijq-Bur_.js → UseCasePage-WtuQk75n.js} +6 -6
- package/dist/admin/{UseCasePage-ijq-Bur_.js.map → UseCasePage-WtuQk75n.js.map} +1 -1
- package/dist/admin/{UseCasePage-P4AFdcDQ.mjs → UseCasePage-fXNd00ES.mjs} +4 -4
- package/dist/admin/{UseCasePage-P4AFdcDQ.mjs.map → UseCasePage-fXNd00ES.mjs.map} +1 -1
- package/dist/admin/{constants-sfZ2gFzJ.js → constants-GyaJoB7C.js} +5 -5
- package/dist/admin/{constants-sfZ2gFzJ.js.map → constants-GyaJoB7C.js.map} +1 -1
- package/dist/admin/{constants-Z-zrJ7Zs.mjs → constants-nzCvle10.mjs} +4 -4
- package/dist/admin/{constants-Z-zrJ7Zs.mjs.map → constants-nzCvle10.mjs.map} +1 -1
- package/dist/admin/{en-K35WIWVM.mjs → en-0Ld-ipyI.mjs} +3 -2
- package/dist/admin/{en-K35WIWVM.mjs.map → en-0Ld-ipyI.mjs.map} +1 -1
- package/dist/admin/{en-G-ukrF2h.js → en-TbnMBjZf.js} +3 -2
- package/dist/admin/{en-G-ukrF2h.js.map → en-TbnMBjZf.js.map} +1 -1
- package/dist/admin/{index-duYn5r8_.js → index-TG8-3711.js} +1524 -1425
- package/dist/admin/index-TG8-3711.js.map +1 -0
- package/dist/admin/{index-EQL2s09p.mjs → index-f6STHGSC.mjs} +1479 -1377
- package/dist/admin/index-f6STHGSC.mjs.map +1 -0
- package/dist/admin/index.js +12 -12
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/{selectors-Ilww6FA-.mjs → selectors-ZpHhvPK4.mjs} +2 -2
- package/dist/admin/{selectors-Ilww6FA-.mjs.map → selectors-ZpHhvPK4.mjs.map} +1 -1
- package/dist/admin/selectors-zQKcCNuz.js +8 -0
- package/dist/admin/{selectors-NDEu6dJa.js.map → selectors-zQKcCNuz.js.map} +1 -1
- package/dist/admin/src/StrapiApp.d.ts +17 -45
- package/dist/admin/src/components/ConfirmDialog.d.ts +18 -8
- package/dist/admin/src/components/Filters.d.ts +4 -8
- package/dist/admin/src/components/Form.d.ts +6 -1
- package/dist/admin/src/components/FormInputs/Checkbox.d.ts +1 -1
- package/dist/admin/src/components/FormInputs/types.d.ts +1 -1
- package/dist/admin/src/components/Layouts/HeaderLayout.d.ts +1 -1
- package/dist/admin/src/components/Layouts/Layout.d.ts +1 -1
- package/dist/admin/src/components/MainNav/NavUser.d.ts +1 -1
- package/dist/admin/src/components/Table.d.ts +1 -1
- package/dist/admin/src/constants/filters.d.ts +2 -1
- package/dist/admin/src/constants.d.ts +3 -3
- package/dist/admin/src/core/apis/router.d.ts +73 -0
- package/dist/admin/src/features/Auth.d.ts +2 -2
- package/dist/admin/src/features/StrapiApp.d.ts +2 -1
- package/dist/admin/src/hooks/useSettingsMenu.d.ts +2 -2
- package/dist/admin/src/index.d.ts +2 -1
- package/dist/admin/src/pages/Settings/pages/Roles/components/CollapsePropertyMatrix.d.ts +0 -6
- package/dist/admin/src/pages/Settings/pages/Roles/components/ConditionsButton.d.ts +4 -2
- package/dist/admin/src/pages/Settings/pages/Roles/components/ConditionsModal.d.ts +2 -4
- package/dist/admin/src/pages/Settings/pages/Users/components/CreateActionCE.d.ts +2 -1
- package/dist/admin/src/reducer.d.ts +7 -2
- package/dist/admin/src/render.d.ts +1 -0
- package/dist/admin/src/router.d.ts +7 -0
- package/dist/admin/src/services/admin.d.ts +5 -5
- package/dist/admin/src/types/permissions.d.ts +1 -1
- package/dist/admin/test.js +17 -16
- package/dist/admin/test.js.map +1 -1
- package/dist/admin/test.mjs +10 -9
- package/dist/admin/test.mjs.map +1 -1
- package/dist/admin/tests/store.d.ts +2 -1
- package/dist/admin/tests/utils.d.ts +2 -1
- package/dist/admin/{useAdminRoles-cq3ZckdQ.mjs → useAdminRoles-Aj5B2oXT.mjs} +2 -2
- package/dist/admin/{useAdminRoles-cq3ZckdQ.mjs.map → useAdminRoles-Aj5B2oXT.mjs.map} +1 -1
- package/dist/admin/{useAdminRoles-2VDDweuC.js → useAdminRoles-JbwI6Lrm.js} +2 -2
- package/dist/admin/{useAdminRoles-2VDDweuC.js.map → useAdminRoles-JbwI6Lrm.js.map} +1 -1
- package/dist/admin/{useLicenseLimitNotification-1Xo24v-C.mjs → useLicenseLimitNotification-PaR7jmqd.mjs} +2 -2
- package/dist/admin/{useLicenseLimitNotification-1Xo24v-C.mjs.map → useLicenseLimitNotification-PaR7jmqd.mjs.map} +1 -1
- package/dist/admin/{useLicenseLimitNotification-9iq0TFuF.js → useLicenseLimitNotification-g1vq6nzk.js} +3 -3
- package/dist/admin/{useLicenseLimitNotification-9iq0TFuF.js.map → useLicenseLimitNotification-g1vq6nzk.js.map} +1 -1
- package/dist/admin/{useWebhooks-opYGugiT.js → useWebhooks-0RUEkKAV.js} +4 -4
- package/dist/admin/{useWebhooks-opYGugiT.js.map → useWebhooks-0RUEkKAV.js.map} +1 -1
- package/dist/admin/{useWebhooks-bgdpL7W6.mjs → useWebhooks-7thg-d57.mjs} +4 -4
- package/dist/admin/{useWebhooks-bgdpL7W6.mjs.map → useWebhooks-7thg-d57.mjs.map} +1 -1
- package/dist/admin/{validation-qUTUIssJ.mjs → validation-F0JQeiU1.mjs} +2 -2
- package/dist/admin/{validation-qUTUIssJ.mjs.map → validation-F0JQeiU1.mjs.map} +1 -1
- package/dist/admin/{validation-6PUPWFkz.js → validation-hzptxkSz.js} +2 -2
- package/dist/admin/{validation-6PUPWFkz.js.map → validation-hzptxkSz.js.map} +1 -1
- package/dist/ee/admin/src/constants.d.ts +10 -0
- package/dist/ee/admin/src/pages/SettingsPage/pages/Users/components/CreateActionEE.d.ts +2 -1
- package/dist/ee/server/index.js +1 -3
- package/dist/ee/server/index.js.map +1 -1
- package/dist/ee/server/index.mjs +1 -3
- package/dist/ee/server/index.mjs.map +1 -1
- package/dist/package.json.d.ts +13 -10
- package/dist/server/index.js +20 -1
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +18 -1
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/webhooks.d.ts.map +1 -1
- package/package.json +14 -11
- package/dist/admin/AdminSeatInfo-_UxgNKbX.mjs.map +0 -1
- package/dist/admin/AdminSeatInfo-cqB8nHFZ.js.map +0 -1
- package/dist/admin/ApplicationInfoPage-6PD2owY8.mjs.map +0 -1
- package/dist/admin/ApplicationInfoPage-S18loXTF.js.map +0 -1
- package/dist/admin/AuthResponse-EiDRhJY8.js.map +0 -1
- package/dist/admin/AuthResponse-Y4lblDuD.mjs.map +0 -1
- package/dist/admin/AuthenticatedLayout-MDNNJRPg.js.map +0 -1
- package/dist/admin/AuthenticatedLayout-gOaUXjO8.mjs.map +0 -1
- package/dist/admin/CreateActionEE-dGj-JbWV.js +0 -53
- package/dist/admin/CreateActionEE-dGj-JbWV.js.map +0 -1
- package/dist/admin/CreateActionEE-uBGAkLbn.mjs +0 -45
- package/dist/admin/CreateActionEE-uBGAkLbn.mjs.map +0 -1
- package/dist/admin/CreatePage-5V60DKB0.js.map +0 -1
- package/dist/admin/CreatePage-puzZjQXr.mjs.map +0 -1
- package/dist/admin/CreateView-5V271zBl.js +0 -17
- package/dist/admin/CreateView-VYprogwB.js +0 -17
- package/dist/admin/EditPage-8_dXc9y1.mjs.map +0 -1
- package/dist/admin/EditPage-8fk5JEO7.mjs.map +0 -1
- package/dist/admin/EditPage-HsLjcfgK.js.map +0 -1
- package/dist/admin/EditPage-W_qlhF-2.mjs.map +0 -1
- package/dist/admin/EditPage-WuJtih1X.js.map +0 -1
- package/dist/admin/EditPage-vRwS2OJZ.js.map +0 -1
- package/dist/admin/EditView-Cac025JW.mjs.map +0 -1
- package/dist/admin/EditView-lhhZAQtN.js.map +0 -1
- package/dist/admin/EditViewPage-Q7N1TLU9.js.map +0 -1
- package/dist/admin/EditViewPage-f56oKqQ-.mjs.map +0 -1
- package/dist/admin/HomePage-4Hk9puW_.js.map +0 -1
- package/dist/admin/HomePage-d4h0KEnw.mjs.map +0 -1
- package/dist/admin/Layout-Ax9QtxH1.mjs.map +0 -1
- package/dist/admin/Layout-Bmmqv9h6.js.map +0 -1
- package/dist/admin/ListPage-10_h7FUt.js.map +0 -1
- package/dist/admin/ListPage-4kGSO2Ri.mjs.map +0 -1
- package/dist/admin/ListPage-4nzagne8.js.map +0 -1
- package/dist/admin/ListPage-EPIYY3Uf.mjs.map +0 -1
- package/dist/admin/ListPage-IgkmnCSY.js.map +0 -1
- package/dist/admin/ListPage-OE9xQffQ.mjs.map +0 -1
- package/dist/admin/ListPage-TWLqkRt6.js.map +0 -1
- package/dist/admin/ListPage-VGqEsiEA.mjs.map +0 -1
- package/dist/admin/MarketplacePage-MVRrpUSk.js.map +0 -1
- package/dist/admin/MarketplacePage-oGhZBKgX.mjs.map +0 -1
- package/dist/admin/Permissions-kNVZVLmu.js.map +0 -1
- package/dist/admin/Permissions-lf6dNG4S.mjs.map +0 -1
- package/dist/admin/ProfilePage-ZlpnTKEF.js.map +0 -1
- package/dist/admin/ProfilePage-zk-Py9wt.mjs.map +0 -1
- package/dist/admin/SSOProviders-AirHFyBl.js.map +0 -1
- package/dist/admin/SSOProviders-t8D-v8As.mjs.map +0 -1
- package/dist/admin/SingleSignOnPage-3Mfu4dgn.js.map +0 -1
- package/dist/admin/SingleSignOnPage-wPZ1tqEk.mjs.map +0 -1
- package/dist/admin/Table-N9PZc6xL.js.map +0 -1
- package/dist/admin/Table-OcYvBab7.mjs.map +0 -1
- package/dist/admin/TokenTypeSelect-dWn05yGP.js.map +0 -1
- package/dist/admin/TokenTypeSelect-v6IYPaBF.mjs.map +0 -1
- package/dist/admin/index-EQL2s09p.mjs.map +0 -1
- package/dist/admin/index-duYn5r8_.js.map +0 -1
- package/dist/admin/rbac-5b9ylhpa.js.map +0 -1
- package/dist/admin/rbac-oJEkQdXG.mjs.map +0 -1
- package/dist/admin/selectors-NDEu6dJa.js +0 -8
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
import { createRoot } from 'react-dom/client';
|
|
2
2
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import
|
|
4
|
-
import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
|
|
5
|
-
import { Link, Alert, Typography, Main, Flex, Button, useCallbackRef, useComposedRefs, Dialog, DialogBody, DialogFooter, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Box, Portal, IconButton, VisuallyHidden, Grid, GridItem, EmptyStateLayout, LinkButton, lightTheme, darkTheme, PopoverPrimitives, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, BaseCheckbox, Tbody, Td, Loader } from '@strapi/design-system';
|
|
3
|
+
import { Link, Alert, Typography, Main, Flex, Button, Box, useCallbackRef, EmptyStateLayout, LinkButton, useComposedRefs, Dialog, Field, Toggle, Checkbox, DatePicker, DateTimePicker, TextInput, SingleSelect, SingleSelectOption, JSONInput, NumberInput, Textarea, TimePicker, Portal, IconButton, VisuallyHidden, Grid, lightTheme, darkTheme, Popover, Tag, Pagination as Pagination$1, PreviousLink, PageLink, Dots, NextLink, SearchForm, Searchbar, Table as Table$1, Thead, Tr, Th, Tooltip, Tbody, Td, Loader } from '@strapi/design-system';
|
|
6
4
|
import invariant from 'invariant';
|
|
7
5
|
import isFunction from 'lodash/isFunction';
|
|
8
6
|
import merge from 'lodash/merge';
|
|
9
7
|
import pick from 'lodash/pick';
|
|
8
|
+
import { NavLink, useLocation, useNavigate, Outlet, useRouteError, Link as Link$1, useBlocker, useMatch, Navigate, createMemoryRouter, createBrowserRouter, RouterProvider } from 'react-router-dom';
|
|
9
|
+
import { x as createContext, S as StrapiAppProvider, A as AuthProvider, L as LanguageProvider, T as Theme, N as NotificationsProvider, y as TrackingProvider, z as ConfigurationProvider, B as LANGUAGE_LOCAL_STORAGE_KEY, P as Page, D as getIn, E as setIn, p as useConfiguration, b as useTypedSelector, e as useTypedDispatch, F as setLocale, u as useAuth, f as useAPIErrorHandler, G as useForgotPasswordMutation, a as useNotification, n as useAppInfo, d as useTracking, H as useGetRegistrationInfoQuery, I as useRegisterAdminMutation, J as useRegisterUserMutation, m as login, K as useResetPasswordMutation, r as reducer$3, M as logout, R as RBAC, O as THEME_LOCAL_STORAGE_KEY, q as getStoredToken, Q as useTypedStore } from './Theme-PrUuuGtN.mjs';
|
|
10
10
|
import { Provider as Provider$1 } from 'react-redux';
|
|
11
|
-
import
|
|
12
|
-
import {
|
|
11
|
+
import * as React from 'react';
|
|
12
|
+
import { useEffect, Suspense, useCallback, useMemo, useState, forwardRef, memo } from 'react';
|
|
13
13
|
import { QueryClient, QueryClientProvider } from 'react-query';
|
|
14
|
-
import { ArrowLeft, WarningCircle, Duplicate, Eye, EyeStriked, Cross,
|
|
14
|
+
import { ArrowLeft, WarningCircle, Duplicate, ArrowRight, Eye, EyeStriked, Cross, Filter, Plus, Search, CaretDown } from '@strapi/icons';
|
|
15
15
|
import { produce } from 'immer';
|
|
16
16
|
import { useIntl } from 'react-intl';
|
|
17
17
|
import get from 'lodash/get';
|
|
18
18
|
import set from 'lodash/set';
|
|
19
19
|
import { styled } from 'styled-components';
|
|
20
|
-
import {
|
|
21
|
-
import { b as adminApi, i as isBaseQueryError, e as useInitQuery, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
|
|
20
|
+
import { EmptyPictures, EmptyDocuments } from '@strapi/icons/symbols';
|
|
22
21
|
import { u as useEnterprise } from './useEnterprise-jpsYZWzn.mjs';
|
|
22
|
+
import { i as isBaseQueryError, e as useInitQuery, b as adminApi, j as createAbsoluteUrl, k as getFetchClient } from './admin-B6AW0Kov.mjs';
|
|
23
23
|
import camelCase from 'lodash/camelCase';
|
|
24
24
|
import * as yup from 'yup';
|
|
25
25
|
import { ValidationError } from 'yup';
|
|
26
26
|
import { generateNKeysBetween } from 'fractional-indexing';
|
|
27
27
|
import isEqual from 'lodash/isEqual';
|
|
28
|
-
import
|
|
29
|
-
import toPath from 'lodash/toPath';
|
|
28
|
+
import { getLocalTimeZone, parseAbsolute, toCalendarDate } from '@internationalized/date';
|
|
30
29
|
import omit from 'lodash/omit';
|
|
31
30
|
import { Formik, Form as Form$1 } from 'formik';
|
|
32
|
-
import {
|
|
31
|
+
import { configureStore, isRejected, combineReducers } from '@reduxjs/toolkit';
|
|
33
32
|
import throttle from 'lodash/throttle';
|
|
34
33
|
import { parse, stringify } from 'qs';
|
|
35
34
|
|
|
@@ -61,6 +60,20 @@ const ADMIN_PERMISSIONS_EE = {
|
|
|
61
60
|
main: [{ action: "admin::provider-login.read", subject: null }],
|
|
62
61
|
read: [{ action: "admin::provider-login.read", subject: null }],
|
|
63
62
|
update: [{ action: "admin::provider-login.update", subject: null }]
|
|
63
|
+
},
|
|
64
|
+
releases: {
|
|
65
|
+
read: [
|
|
66
|
+
{
|
|
67
|
+
action: "plugin::content-releases.settings.read",
|
|
68
|
+
subject: null
|
|
69
|
+
}
|
|
70
|
+
],
|
|
71
|
+
update: [
|
|
72
|
+
{
|
|
73
|
+
action: "plugin::content-releases.settings.update",
|
|
74
|
+
subject: null
|
|
75
|
+
}
|
|
76
|
+
]
|
|
64
77
|
}
|
|
65
78
|
}
|
|
66
79
|
};
|
|
@@ -68,7 +81,7 @@ const getEERoutes$1 = () => window.strapi.isEE ? [
|
|
|
68
81
|
{
|
|
69
82
|
path: "auth/login/:authResponse",
|
|
70
83
|
lazy: async () => {
|
|
71
|
-
const { AuthResponse } = await import('./AuthResponse-
|
|
84
|
+
const { AuthResponse } = await import('./AuthResponse-J8A48xdo.mjs');
|
|
72
85
|
return {
|
|
73
86
|
Component: AuthResponse
|
|
74
87
|
};
|
|
@@ -103,245 +116,521 @@ const constants = /*#__PURE__*/Object.freeze(/*#__PURE__*/Object.defineProperty(
|
|
|
103
116
|
getEERoutes: getEERoutes$1
|
|
104
117
|
}, Symbol.toStringTag, { value: 'Module' }));
|
|
105
118
|
|
|
106
|
-
const
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
119
|
+
const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
|
|
120
|
+
|
|
121
|
+
const ADMIN_PERMISSIONS_CE = {
|
|
122
|
+
contentManager: {
|
|
123
|
+
main: [],
|
|
124
|
+
collectionTypesConfigurations: [
|
|
125
|
+
{
|
|
126
|
+
action: "plugin::content-manager.collection-types.configure-view",
|
|
127
|
+
subject: null
|
|
115
128
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
lazy: async () => {
|
|
122
|
-
const { ProtectedSSO } = await import('./SingleSignOnPage-wPZ1tqEk.mjs');
|
|
123
|
-
return {
|
|
124
|
-
Component: ProtectedSSO
|
|
125
|
-
};
|
|
129
|
+
],
|
|
130
|
+
componentsConfigurations: [
|
|
131
|
+
{
|
|
132
|
+
action: "plugin::content-manager.components.configure-layout",
|
|
133
|
+
subject: null
|
|
126
134
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
history: [],
|
|
133
|
-
currentLocationIndex: 0,
|
|
134
|
-
currentLocation: "",
|
|
135
|
-
canGoBack: false,
|
|
136
|
-
pushState: () => {
|
|
137
|
-
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
138
|
-
},
|
|
139
|
-
goBack: () => {
|
|
140
|
-
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
const HistoryProvider = ({ children }) => {
|
|
144
|
-
const location = useLocation();
|
|
145
|
-
const navigate = useNavigate();
|
|
146
|
-
const [state, dispatch] = React.useReducer(reducer$2, {
|
|
147
|
-
history: [],
|
|
148
|
-
currentLocationIndex: 0,
|
|
149
|
-
currentLocation: "",
|
|
150
|
-
canGoBack: false
|
|
151
|
-
});
|
|
152
|
-
const isGoingBack = React.useRef(false);
|
|
153
|
-
const pushState = React.useCallback((path) => {
|
|
154
|
-
dispatch({
|
|
155
|
-
type: "PUSH_STATE",
|
|
156
|
-
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
157
|
-
});
|
|
158
|
-
}, []);
|
|
159
|
-
const goBack = React.useCallback(() => {
|
|
160
|
-
navigate(-1);
|
|
161
|
-
dispatch({ type: "GO_BACK" });
|
|
162
|
-
isGoingBack.current = true;
|
|
163
|
-
}, [navigate]);
|
|
164
|
-
const prevIndex = React.useRef(state.currentLocationIndex);
|
|
165
|
-
React.useEffect(() => {
|
|
166
|
-
if (state.currentLocationIndex !== prevIndex.current) {
|
|
167
|
-
dispatch({
|
|
168
|
-
type: "SET_CAN_GO_BACK",
|
|
169
|
-
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
170
|
-
});
|
|
171
|
-
prevIndex.current = state.currentLocationIndex;
|
|
172
|
-
}
|
|
173
|
-
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
174
|
-
React.useLayoutEffect(() => {
|
|
175
|
-
if (isGoingBack.current) {
|
|
176
|
-
isGoingBack.current = false;
|
|
177
|
-
} else {
|
|
178
|
-
dispatch({
|
|
179
|
-
type: "PUSH_STATE",
|
|
180
|
-
payload: { to: location.pathname, search: location.search }
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
}, [dispatch, location.pathname, location.search]);
|
|
184
|
-
return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
|
|
185
|
-
};
|
|
186
|
-
const reducer$2 = (state, action) => produce(state, (draft) => {
|
|
187
|
-
switch (action.type) {
|
|
188
|
-
case "PUSH_STATE": {
|
|
189
|
-
const path = `${action.payload.to}${action.payload.search}`;
|
|
190
|
-
if (state.currentLocationIndex === state.history.length) {
|
|
191
|
-
draft.history = [...state.history, path];
|
|
192
|
-
} else {
|
|
193
|
-
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
135
|
+
],
|
|
136
|
+
singleTypesConfigurations: [
|
|
137
|
+
{
|
|
138
|
+
action: "plugin::content-manager.single-types.configure-view",
|
|
139
|
+
subject: null
|
|
194
140
|
}
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
141
|
+
]
|
|
142
|
+
},
|
|
143
|
+
marketplace: {
|
|
144
|
+
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
145
|
+
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
146
|
+
},
|
|
147
|
+
settings: {
|
|
148
|
+
roles: {
|
|
149
|
+
main: [
|
|
150
|
+
{ action: "admin::roles.create", subject: null },
|
|
151
|
+
{ action: "admin::roles.update", subject: null },
|
|
152
|
+
{ action: "admin::roles.read", subject: null },
|
|
153
|
+
{ action: "admin::roles.delete", subject: null }
|
|
154
|
+
],
|
|
155
|
+
create: [{ action: "admin::roles.create", subject: null }],
|
|
156
|
+
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
157
|
+
read: [{ action: "admin::roles.read", subject: null }],
|
|
158
|
+
update: [{ action: "admin::roles.update", subject: null }]
|
|
159
|
+
},
|
|
160
|
+
users: {
|
|
161
|
+
main: [
|
|
162
|
+
{ action: "admin::users.create", subject: null },
|
|
163
|
+
{ action: "admin::users.read", subject: null },
|
|
164
|
+
{ action: "admin::users.update", subject: null },
|
|
165
|
+
{ action: "admin::users.delete", subject: null }
|
|
166
|
+
],
|
|
167
|
+
create: [{ action: "admin::users.create", subject: null }],
|
|
168
|
+
delete: [{ action: "admin::users.delete", subject: null }],
|
|
169
|
+
read: [{ action: "admin::users.read", subject: null }],
|
|
170
|
+
update: [{ action: "admin::users.update", subject: null }]
|
|
171
|
+
},
|
|
172
|
+
webhooks: {
|
|
173
|
+
main: [
|
|
174
|
+
{ action: "admin::webhooks.create", subject: null },
|
|
175
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
176
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
177
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
178
|
+
],
|
|
179
|
+
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
180
|
+
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
181
|
+
read: [
|
|
182
|
+
{ action: "admin::webhooks.read", subject: null },
|
|
183
|
+
// NOTE: We need to check with the API
|
|
184
|
+
{ action: "admin::webhooks.update", subject: null },
|
|
185
|
+
{ action: "admin::webhooks.delete", subject: null }
|
|
186
|
+
],
|
|
187
|
+
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
188
|
+
},
|
|
189
|
+
"api-tokens": {
|
|
190
|
+
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
191
|
+
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
192
|
+
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
193
|
+
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
194
|
+
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
195
|
+
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
196
|
+
},
|
|
197
|
+
"transfer-tokens": {
|
|
198
|
+
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
199
|
+
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
200
|
+
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
201
|
+
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
202
|
+
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
203
|
+
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
204
|
+
},
|
|
205
|
+
"project-settings": {
|
|
206
|
+
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
207
|
+
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
}
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
210
|
+
};
|
|
211
|
+
const HOOKS = {
|
|
212
|
+
/**
|
|
213
|
+
* Hook that allows to mutate the displayed headers of the list view table
|
|
214
|
+
* @constant
|
|
215
|
+
* @type {string}
|
|
216
|
+
*/
|
|
217
|
+
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
218
|
+
/**
|
|
219
|
+
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
220
|
+
* @constant
|
|
221
|
+
* @type {string}
|
|
222
|
+
*/
|
|
223
|
+
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
224
|
+
/**
|
|
225
|
+
* Hook that allows to mutate the CM's edit view layout
|
|
226
|
+
* @constant
|
|
227
|
+
* @type {string}
|
|
228
|
+
*/
|
|
229
|
+
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
230
|
+
/**
|
|
231
|
+
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
232
|
+
* @constant
|
|
233
|
+
* @type {string}
|
|
234
|
+
*/
|
|
235
|
+
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
236
|
+
};
|
|
237
|
+
const SETTINGS_LINKS_CE = () => ({
|
|
238
|
+
global: [
|
|
222
239
|
{
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
"
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
251
|
-
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
252
|
-
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
253
|
-
return null;
|
|
240
|
+
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
241
|
+
to: "/settings/application-infos",
|
|
242
|
+
id: "000-application-infos"
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
246
|
+
to: "/settings/webhooks",
|
|
247
|
+
id: "webhooks"
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
251
|
+
to: "/settings/api-tokens?sort=name:ASC",
|
|
252
|
+
id: "api-tokens"
|
|
253
|
+
},
|
|
254
|
+
{
|
|
255
|
+
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
256
|
+
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
257
|
+
id: "transfer-tokens"
|
|
258
|
+
},
|
|
259
|
+
// If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
|
|
260
|
+
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
261
|
+
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
262
|
+
{
|
|
263
|
+
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
264
|
+
to: "/settings/purchase-single-sign-on",
|
|
265
|
+
id: "sso-purchase-page",
|
|
266
|
+
licenseOnly: true
|
|
254
267
|
}
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
268
|
+
] : []
|
|
269
|
+
],
|
|
270
|
+
admin: [
|
|
271
|
+
{
|
|
272
|
+
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
273
|
+
to: "/settings/roles",
|
|
274
|
+
id: "roles"
|
|
275
|
+
},
|
|
276
|
+
{
|
|
277
|
+
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
278
|
+
// Init the search params directly
|
|
279
|
+
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
280
|
+
id: "users"
|
|
281
|
+
},
|
|
282
|
+
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
283
|
+
{
|
|
284
|
+
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
285
|
+
to: "/settings/purchase-audit-logs",
|
|
286
|
+
id: "auditLogs-purchase-page",
|
|
287
|
+
licenseOnly: true
|
|
288
|
+
}
|
|
289
|
+
] : []
|
|
290
|
+
]
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
const ALLOWED_TYPES = [
|
|
294
|
+
"biginteger",
|
|
295
|
+
"boolean",
|
|
296
|
+
"date",
|
|
297
|
+
"datetime",
|
|
298
|
+
"decimal",
|
|
299
|
+
"email",
|
|
300
|
+
"enumeration",
|
|
301
|
+
"float",
|
|
302
|
+
"integer",
|
|
303
|
+
"json",
|
|
304
|
+
"password",
|
|
305
|
+
"richtext",
|
|
306
|
+
"string",
|
|
307
|
+
"text",
|
|
308
|
+
"time",
|
|
309
|
+
"uid"
|
|
310
|
+
];
|
|
311
|
+
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
312
|
+
"min",
|
|
313
|
+
"minLength",
|
|
314
|
+
"max",
|
|
315
|
+
"maxLength",
|
|
316
|
+
"required",
|
|
317
|
+
"regex",
|
|
318
|
+
"enum",
|
|
319
|
+
"unique",
|
|
320
|
+
"private",
|
|
321
|
+
"default"
|
|
322
|
+
];
|
|
323
|
+
class CustomFields {
|
|
324
|
+
customFields;
|
|
325
|
+
constructor() {
|
|
326
|
+
this.customFields = {};
|
|
327
|
+
}
|
|
328
|
+
register = (customFields) => {
|
|
329
|
+
if (Array.isArray(customFields)) {
|
|
330
|
+
customFields.forEach((customField) => {
|
|
331
|
+
this.register(customField);
|
|
332
|
+
});
|
|
333
|
+
} else {
|
|
334
|
+
const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
|
|
335
|
+
invariant(name, "A name must be provided");
|
|
336
|
+
invariant(type, "A type must be provided");
|
|
337
|
+
invariant(intlLabel, "An intlLabel must be provided");
|
|
338
|
+
invariant(intlDescription, "An intlDescription must be provided");
|
|
339
|
+
invariant(components, "A components object must be provided");
|
|
340
|
+
invariant(components.Input, "An Input component must be provided");
|
|
341
|
+
invariant(
|
|
342
|
+
ALLOWED_TYPES.includes(type),
|
|
343
|
+
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
284
344
|
);
|
|
285
|
-
const
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
345
|
+
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
346
|
+
invariant(
|
|
347
|
+
isValidObjectKey.test(name),
|
|
348
|
+
`Custom field name: '${name}' is not a valid object key`
|
|
349
|
+
);
|
|
350
|
+
const allFormOptions = [...options?.base || [], ...options?.advanced || []];
|
|
351
|
+
if (allFormOptions.length) {
|
|
352
|
+
const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
|
|
353
|
+
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
354
|
+
invariant(isValidOptionPath, errorMessage);
|
|
355
|
+
});
|
|
289
356
|
}
|
|
357
|
+
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
358
|
+
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
359
|
+
invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
360
|
+
this.customFields[uid] = customFields;
|
|
290
361
|
}
|
|
291
362
|
};
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
dispatch({
|
|
295
|
-
type: "SET_SKIPPED",
|
|
296
|
-
value
|
|
297
|
-
});
|
|
363
|
+
getAll = () => {
|
|
364
|
+
return this.customFields;
|
|
298
365
|
};
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
create: false,
|
|
320
|
-
success: false
|
|
321
|
-
},
|
|
322
|
-
contentManager: {
|
|
323
|
-
create: false,
|
|
324
|
-
success: false
|
|
325
|
-
},
|
|
326
|
-
apiTokens: {
|
|
327
|
-
create: false,
|
|
328
|
-
success: false
|
|
329
|
-
},
|
|
330
|
-
transferTokens: {
|
|
331
|
-
create: false,
|
|
332
|
-
success: false
|
|
333
|
-
}
|
|
334
|
-
},
|
|
335
|
-
isGuidedTourVisible: false,
|
|
336
|
-
isSkipped: false
|
|
366
|
+
get = (uid) => {
|
|
367
|
+
return this.customFields[uid];
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
const optionsValidationReducer = (acc, option) => {
|
|
371
|
+
if ("items" in option) {
|
|
372
|
+
return option.items.reduce(optionsValidationReducer, acc);
|
|
373
|
+
}
|
|
374
|
+
if (!option.name) {
|
|
375
|
+
acc.push({
|
|
376
|
+
isValidOptionPath: false,
|
|
377
|
+
errorMessage: "The 'name' property is required on an options object"
|
|
378
|
+
});
|
|
379
|
+
} else {
|
|
380
|
+
acc.push({
|
|
381
|
+
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
382
|
+
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
383
|
+
});
|
|
384
|
+
}
|
|
385
|
+
return acc;
|
|
337
386
|
};
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
387
|
+
|
|
388
|
+
class Plugin {
|
|
389
|
+
apis;
|
|
390
|
+
initializer;
|
|
391
|
+
injectionZones;
|
|
392
|
+
isReady;
|
|
393
|
+
name;
|
|
394
|
+
pluginId;
|
|
395
|
+
constructor(pluginConf) {
|
|
396
|
+
this.apis = pluginConf.apis || {};
|
|
397
|
+
this.initializer = pluginConf.initializer || null;
|
|
398
|
+
this.injectionZones = pluginConf.injectionZones || {};
|
|
399
|
+
this.isReady = pluginConf.isReady !== void 0 ? pluginConf.isReady : true;
|
|
400
|
+
this.name = pluginConf.name;
|
|
401
|
+
this.pluginId = pluginConf.id;
|
|
402
|
+
}
|
|
403
|
+
getInjectedComponents(containerName, blockName) {
|
|
404
|
+
try {
|
|
405
|
+
return this.injectionZones[containerName][blockName] || [];
|
|
406
|
+
} catch (err) {
|
|
407
|
+
console.error("Cannot get injected component", err);
|
|
408
|
+
return [];
|
|
343
409
|
}
|
|
344
|
-
|
|
410
|
+
}
|
|
411
|
+
injectComponent(containerName, blockName, component) {
|
|
412
|
+
try {
|
|
413
|
+
this.injectionZones[containerName][blockName].push(component);
|
|
414
|
+
} catch (err) {
|
|
415
|
+
console.error("Cannot inject component", err);
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
const [Provider, useHistory] = createContext("History", {
|
|
421
|
+
history: [],
|
|
422
|
+
currentLocationIndex: 0,
|
|
423
|
+
currentLocation: "",
|
|
424
|
+
canGoBack: false,
|
|
425
|
+
pushState: () => {
|
|
426
|
+
throw new Error("You must use the `HistoryProvider` to access the `pushState` function.");
|
|
427
|
+
},
|
|
428
|
+
goBack: () => {
|
|
429
|
+
throw new Error("You must use the `HistoryProvider` to access the `goBack` function.");
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
const HistoryProvider = ({ children }) => {
|
|
433
|
+
const location = useLocation();
|
|
434
|
+
const navigate = useNavigate();
|
|
435
|
+
const [state, dispatch] = React.useReducer(reducer$2, {
|
|
436
|
+
history: [],
|
|
437
|
+
currentLocationIndex: 0,
|
|
438
|
+
currentLocation: "",
|
|
439
|
+
canGoBack: false
|
|
440
|
+
});
|
|
441
|
+
const isGoingBack = React.useRef(false);
|
|
442
|
+
const pushState = React.useCallback((path) => {
|
|
443
|
+
dispatch({
|
|
444
|
+
type: "PUSH_STATE",
|
|
445
|
+
payload: typeof path === "string" ? { to: path, search: "" } : path
|
|
446
|
+
});
|
|
447
|
+
}, []);
|
|
448
|
+
const goBack = React.useCallback(() => {
|
|
449
|
+
navigate(-1);
|
|
450
|
+
dispatch({ type: "GO_BACK" });
|
|
451
|
+
isGoingBack.current = true;
|
|
452
|
+
}, [navigate]);
|
|
453
|
+
const prevIndex = React.useRef(state.currentLocationIndex);
|
|
454
|
+
React.useEffect(() => {
|
|
455
|
+
if (state.currentLocationIndex !== prevIndex.current) {
|
|
456
|
+
dispatch({
|
|
457
|
+
type: "SET_CAN_GO_BACK",
|
|
458
|
+
payload: state.currentLocationIndex > 1 && state.history.length > 1
|
|
459
|
+
});
|
|
460
|
+
prevIndex.current = state.currentLocationIndex;
|
|
461
|
+
}
|
|
462
|
+
}, [prevIndex, state.currentLocationIndex, state.history.length]);
|
|
463
|
+
React.useLayoutEffect(() => {
|
|
464
|
+
if (isGoingBack.current) {
|
|
465
|
+
isGoingBack.current = false;
|
|
466
|
+
} else {
|
|
467
|
+
dispatch({
|
|
468
|
+
type: "PUSH_STATE",
|
|
469
|
+
payload: { to: location.pathname, search: location.search }
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
}, [dispatch, location.pathname, location.search]);
|
|
473
|
+
return /* @__PURE__ */ jsx(Provider, { pushState, goBack, ...state, children });
|
|
474
|
+
};
|
|
475
|
+
const reducer$2 = (state, action) => produce(state, (draft) => {
|
|
476
|
+
switch (action.type) {
|
|
477
|
+
case "PUSH_STATE": {
|
|
478
|
+
const path = `${action.payload.to}${action.payload.search}`;
|
|
479
|
+
if (state.currentLocationIndex === state.history.length) {
|
|
480
|
+
draft.history = [...state.history, path];
|
|
481
|
+
} else {
|
|
482
|
+
draft.history = [...state.history.slice(0, state.currentLocationIndex), path];
|
|
483
|
+
}
|
|
484
|
+
draft.currentLocation = path;
|
|
485
|
+
draft.currentLocationIndex += 1;
|
|
486
|
+
break;
|
|
487
|
+
}
|
|
488
|
+
case "GO_BACK": {
|
|
489
|
+
const newIndex = state.currentLocationIndex - 1;
|
|
490
|
+
draft.currentLocation = state.history[newIndex - 1];
|
|
491
|
+
draft.currentLocationIndex = newIndex;
|
|
492
|
+
break;
|
|
493
|
+
}
|
|
494
|
+
case "SET_CAN_GO_BACK": {
|
|
495
|
+
draft.canGoBack = action.payload;
|
|
496
|
+
break;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
});
|
|
500
|
+
const BackButton = React.forwardRef(({ disabled }, ref) => {
|
|
501
|
+
const { formatMessage } = useIntl();
|
|
502
|
+
const canGoBack = useHistory("BackButton", (state) => state.canGoBack);
|
|
503
|
+
const goBack = useHistory("BackButton", (state) => state.goBack);
|
|
504
|
+
const history = useHistory("BackButton", (state) => state.history);
|
|
505
|
+
const handleClick = (e) => {
|
|
506
|
+
e.preventDefault();
|
|
507
|
+
goBack();
|
|
508
|
+
};
|
|
509
|
+
return /* @__PURE__ */ jsx(
|
|
510
|
+
Link,
|
|
511
|
+
{
|
|
512
|
+
ref,
|
|
513
|
+
tag: NavLink,
|
|
514
|
+
to: history.at(-1) ?? "",
|
|
515
|
+
onClick: handleClick,
|
|
516
|
+
disabled: disabled || !canGoBack,
|
|
517
|
+
"aria-disabled": disabled || !canGoBack,
|
|
518
|
+
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
|
519
|
+
children: formatMessage({
|
|
520
|
+
id: "global.back",
|
|
521
|
+
defaultMessage: "Back"
|
|
522
|
+
})
|
|
523
|
+
}
|
|
524
|
+
);
|
|
525
|
+
});
|
|
526
|
+
|
|
527
|
+
const GUIDED_TOUR_COMPLETED_STEPS = "GUIDED_TOUR_COMPLETED_STEPS";
|
|
528
|
+
const GUIDED_TOUR_CURRENT_STEP = "GUIDED_TOUR_CURRENT_STEP";
|
|
529
|
+
const GUIDED_TOUR_SKIPPED = "GUIDED_TOUR_SKIPPED";
|
|
530
|
+
const [GuidedTourProviderImpl, useGuidedTour] = createContext("GuidedTour");
|
|
531
|
+
const GuidedTourProvider = ({ children }) => {
|
|
532
|
+
const [{ currentStep, guidedTourState, isGuidedTourVisible, isSkipped }, dispatch] = React.useReducer(reducer$1, initialState, initialiseState);
|
|
533
|
+
const setCurrentStep = (step) => {
|
|
534
|
+
if (step !== null) {
|
|
535
|
+
const isStepAlreadyDone = get(guidedTourState, step);
|
|
536
|
+
const [sectionName, stepName] = step.split(".");
|
|
537
|
+
const sectionArray = Object.entries(guidedTourState[sectionName]);
|
|
538
|
+
const currentStepIndex = sectionArray.findIndex(([key]) => key === stepName);
|
|
539
|
+
const previousSteps = sectionArray.slice(0, currentStepIndex);
|
|
540
|
+
const isStepToShow = previousSteps.every(([, sectionValue]) => sectionValue);
|
|
541
|
+
if (isStepAlreadyDone || isSkipped || !isStepToShow) {
|
|
542
|
+
return null;
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
window.localStorage.setItem(GUIDED_TOUR_CURRENT_STEP, JSON.stringify(null));
|
|
546
|
+
return dispatch({
|
|
547
|
+
type: "SET_CURRENT_STEP",
|
|
548
|
+
step
|
|
549
|
+
});
|
|
550
|
+
};
|
|
551
|
+
const setGuidedTourVisibility = (value) => {
|
|
552
|
+
dispatch({
|
|
553
|
+
type: "SET_GUIDED_TOUR_VISIBILITY",
|
|
554
|
+
value
|
|
555
|
+
});
|
|
556
|
+
};
|
|
557
|
+
const setStepState = (currentStep2, value) => {
|
|
558
|
+
addCompletedStep(currentStep2);
|
|
559
|
+
dispatch({
|
|
560
|
+
type: "SET_STEP_STATE",
|
|
561
|
+
currentStep: currentStep2,
|
|
562
|
+
value
|
|
563
|
+
});
|
|
564
|
+
};
|
|
565
|
+
const startSection = (sectionName) => {
|
|
566
|
+
const sectionSteps = guidedTourState[sectionName];
|
|
567
|
+
if (sectionSteps) {
|
|
568
|
+
const guidedTourArray = Object.entries(guidedTourState);
|
|
569
|
+
const currentSectionIndex = guidedTourArray.findIndex(([key]) => key === sectionName);
|
|
570
|
+
const previousSections = guidedTourArray.slice(0, currentSectionIndex);
|
|
571
|
+
const isSectionToShow = previousSections.every(
|
|
572
|
+
([, sectionValue]) => Object.values(sectionValue).every(Boolean)
|
|
573
|
+
);
|
|
574
|
+
const [firstStep] = Object.keys(sectionSteps);
|
|
575
|
+
const isFirstStepDone = sectionSteps[firstStep];
|
|
576
|
+
if (isSectionToShow && !currentStep && !isFirstStepDone) {
|
|
577
|
+
setCurrentStep(`${sectionName}.${firstStep}`);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
};
|
|
581
|
+
const setSkipped = (value) => {
|
|
582
|
+
window.localStorage.setItem(GUIDED_TOUR_SKIPPED, JSON.stringify(value));
|
|
583
|
+
dispatch({
|
|
584
|
+
type: "SET_SKIPPED",
|
|
585
|
+
value
|
|
586
|
+
});
|
|
587
|
+
};
|
|
588
|
+
return /* @__PURE__ */ jsx(
|
|
589
|
+
GuidedTourProviderImpl,
|
|
590
|
+
{
|
|
591
|
+
guidedTourState,
|
|
592
|
+
currentStep,
|
|
593
|
+
setCurrentStep,
|
|
594
|
+
setGuidedTourVisibility,
|
|
595
|
+
setSkipped,
|
|
596
|
+
setStepState,
|
|
597
|
+
startSection,
|
|
598
|
+
isGuidedTourVisible,
|
|
599
|
+
isSkipped,
|
|
600
|
+
children
|
|
601
|
+
}
|
|
602
|
+
);
|
|
603
|
+
};
|
|
604
|
+
const initialState = {
|
|
605
|
+
currentStep: null,
|
|
606
|
+
guidedTourState: {
|
|
607
|
+
contentTypeBuilder: {
|
|
608
|
+
create: false,
|
|
609
|
+
success: false
|
|
610
|
+
},
|
|
611
|
+
contentManager: {
|
|
612
|
+
create: false,
|
|
613
|
+
success: false
|
|
614
|
+
},
|
|
615
|
+
apiTokens: {
|
|
616
|
+
create: false,
|
|
617
|
+
success: false
|
|
618
|
+
},
|
|
619
|
+
transferTokens: {
|
|
620
|
+
create: false,
|
|
621
|
+
success: false
|
|
622
|
+
}
|
|
623
|
+
},
|
|
624
|
+
isGuidedTourVisible: false,
|
|
625
|
+
isSkipped: false
|
|
626
|
+
};
|
|
627
|
+
const reducer$1 = (state = initialState, action) => produce(state, (draftState) => {
|
|
628
|
+
switch (action.type) {
|
|
629
|
+
case "SET_CURRENT_STEP": {
|
|
630
|
+
draftState.currentStep = action.step;
|
|
631
|
+
break;
|
|
632
|
+
}
|
|
633
|
+
case "SET_STEP_STATE": {
|
|
345
634
|
const [section, step] = action.currentStep.split(".");
|
|
346
635
|
draftState.guidedTourState[section][step] = action.value;
|
|
347
636
|
break;
|
|
@@ -416,7 +705,7 @@ const Providers = ({ children, strapi, store }) => {
|
|
|
416
705
|
components: strapi.library.components,
|
|
417
706
|
customFields: strapi.customFields,
|
|
418
707
|
fields: strapi.library.fields,
|
|
419
|
-
menu: strapi.menu,
|
|
708
|
+
menu: strapi.router.menu,
|
|
420
709
|
getAdminInjectedComponents: strapi.getAdminInjectedComponents,
|
|
421
710
|
getPlugin: strapi.getPlugin,
|
|
422
711
|
plugins: strapi.plugins,
|
|
@@ -424,7 +713,7 @@ const Providers = ({ children, strapi, store }) => {
|
|
|
424
713
|
runHookParallel: strapi.runHookParallel,
|
|
425
714
|
runHookWaterfall: (name, initialValue) => strapi.runHookWaterfall(name, initialValue, store),
|
|
426
715
|
runHookSeries: strapi.runHookSeries,
|
|
427
|
-
settings: strapi.settings,
|
|
716
|
+
settings: strapi.router.settings,
|
|
428
717
|
children: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(QueryClientProvider, { client: queryClient, children: /* @__PURE__ */ jsx(AuthProvider, { children: /* @__PURE__ */ jsx(HistoryProvider, { children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(NotificationsProvider, { children: /* @__PURE__ */ jsx(TrackingProvider, { children: /* @__PURE__ */ jsx(GuidedTourProvider, { children: /* @__PURE__ */ jsx(
|
|
429
718
|
ConfigurationProvider,
|
|
430
719
|
{
|
|
@@ -449,8 +738,6 @@ const App = ({ strapi, store }) => {
|
|
|
449
738
|
return /* @__PURE__ */ jsx(Providers, { strapi, store, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Outlet, {}) }) });
|
|
450
739
|
};
|
|
451
740
|
|
|
452
|
-
const StrapiLogo = "data:image/svg+xml,%3csvg%20width='800'%20height='800'%20viewBox='0%200%20800%20800'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M39%20282c0-118%200-176.9%2036.6-213.5C112.2%2032%20171.1%2032%20288.9%2032h221.2c117.8%200%20176.7%200%20213.3%2036.6C760%20105.2%20760%20164.1%20760%20281.9v221.2c0%20117.8%200%20176.7-36.6%20213.3C686.8%20753%20627.9%20753%20510.1%20753H288.9c-117.8%200-176.7%200-213.3-36.6C39%20679.8%2039%20620.9%2039%20503.1V281.9Z'%20fill='%234945FF'/%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M536.4%20250.7H293.7v123.8h123.8v123.7h123.8V255.5c0-2.6-2.2-4.8-4.9-4.8Z'%20fill='%23fff'/%3e%3cpath%20fill='%23fff'%20d='M412.7%20374.5h4.8v4.8h-4.8z'/%3e%3cpath%20d='M293.8%20374.5h119c2.6%200%204.8%202.1%204.8%204.8v119h-119a4.8%204.8%200%200%201-4.8-4.9v-119Z'%20fill='%239593FF'/%3e%3cpath%20d='M417.5%20498.2h123.8L421.6%20618a2.4%202.4%200%200%201-4-1.7v-118ZM293.8%20374.5h-118a2.4%202.4%200%200%201-1.7-4.1l119.7-119.7v123.8Z'%20fill='%239593FF'/%3e%3c/svg%3e";
|
|
453
|
-
|
|
454
741
|
const useClipboard = () => {
|
|
455
742
|
const copy = useCallback(async (value) => {
|
|
456
743
|
try {
|
|
@@ -552,431 +839,245 @@ const ErrorType = styled(Typography)`
|
|
|
552
839
|
color: ${({ theme }) => theme.colors.danger600};
|
|
553
840
|
`;
|
|
554
841
|
|
|
555
|
-
const
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
collectionTypesConfigurations: [
|
|
559
|
-
{
|
|
560
|
-
action: "plugin::content-manager.collection-types.configure-view",
|
|
561
|
-
subject: null
|
|
562
|
-
}
|
|
563
|
-
],
|
|
564
|
-
componentsConfigurations: [
|
|
565
|
-
{
|
|
566
|
-
action: "plugin::content-manager.components.configure-layout",
|
|
567
|
-
subject: null
|
|
568
|
-
}
|
|
569
|
-
],
|
|
570
|
-
singleTypesConfigurations: [
|
|
571
|
-
{
|
|
572
|
-
action: "plugin::content-manager.single-types.configure-view",
|
|
573
|
-
subject: null
|
|
574
|
-
}
|
|
575
|
-
]
|
|
576
|
-
},
|
|
577
|
-
marketplace: {
|
|
578
|
-
main: [{ action: "admin::marketplace.read", subject: null }],
|
|
579
|
-
read: [{ action: "admin::marketplace.read", subject: null }]
|
|
580
|
-
},
|
|
581
|
-
settings: {
|
|
582
|
-
roles: {
|
|
583
|
-
main: [
|
|
584
|
-
{ action: "admin::roles.create", subject: null },
|
|
585
|
-
{ action: "admin::roles.update", subject: null },
|
|
586
|
-
{ action: "admin::roles.read", subject: null },
|
|
587
|
-
{ action: "admin::roles.delete", subject: null }
|
|
588
|
-
],
|
|
589
|
-
create: [{ action: "admin::roles.create", subject: null }],
|
|
590
|
-
delete: [{ action: "admin::roles.delete", subject: null }],
|
|
591
|
-
read: [{ action: "admin::roles.read", subject: null }],
|
|
592
|
-
update: [{ action: "admin::roles.update", subject: null }]
|
|
593
|
-
},
|
|
594
|
-
users: {
|
|
595
|
-
main: [
|
|
596
|
-
{ action: "admin::users.create", subject: null },
|
|
597
|
-
{ action: "admin::users.read", subject: null },
|
|
598
|
-
{ action: "admin::users.update", subject: null },
|
|
599
|
-
{ action: "admin::users.delete", subject: null }
|
|
600
|
-
],
|
|
601
|
-
create: [{ action: "admin::users.create", subject: null }],
|
|
602
|
-
delete: [{ action: "admin::users.delete", subject: null }],
|
|
603
|
-
read: [{ action: "admin::users.read", subject: null }],
|
|
604
|
-
update: [{ action: "admin::users.update", subject: null }]
|
|
605
|
-
},
|
|
606
|
-
webhooks: {
|
|
607
|
-
main: [
|
|
608
|
-
{ action: "admin::webhooks.create", subject: null },
|
|
609
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
610
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
611
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
612
|
-
],
|
|
613
|
-
create: [{ action: "admin::webhooks.create", subject: null }],
|
|
614
|
-
delete: [{ action: "admin::webhooks.delete", subject: null }],
|
|
615
|
-
read: [
|
|
616
|
-
{ action: "admin::webhooks.read", subject: null },
|
|
617
|
-
// NOTE: We need to check with the API
|
|
618
|
-
{ action: "admin::webhooks.update", subject: null },
|
|
619
|
-
{ action: "admin::webhooks.delete", subject: null }
|
|
620
|
-
],
|
|
621
|
-
update: [{ action: "admin::webhooks.update", subject: null }]
|
|
622
|
-
},
|
|
623
|
-
"api-tokens": {
|
|
624
|
-
main: [{ action: "admin::api-tokens.access", subject: null }],
|
|
625
|
-
create: [{ action: "admin::api-tokens.create", subject: null }],
|
|
626
|
-
delete: [{ action: "admin::api-tokens.delete", subject: null }],
|
|
627
|
-
read: [{ action: "admin::api-tokens.read", subject: null }],
|
|
628
|
-
update: [{ action: "admin::api-tokens.update", subject: null }],
|
|
629
|
-
regenerate: [{ action: "admin::api-tokens.regenerate", subject: null }]
|
|
630
|
-
},
|
|
631
|
-
"transfer-tokens": {
|
|
632
|
-
main: [{ action: "admin::transfer.tokens.access", subject: null }],
|
|
633
|
-
create: [{ action: "admin::transfer.tokens.create", subject: null }],
|
|
634
|
-
delete: [{ action: "admin::transfer.tokens.delete", subject: null }],
|
|
635
|
-
read: [{ action: "admin::transfer.tokens.read", subject: null }],
|
|
636
|
-
update: [{ action: "admin::transfer.tokens.update", subject: null }],
|
|
637
|
-
regenerate: [{ action: "admin::transfer.tokens.regenerate", subject: null }]
|
|
638
|
-
},
|
|
639
|
-
"project-settings": {
|
|
640
|
-
read: [{ action: "admin::project-settings.read", subject: null }],
|
|
641
|
-
update: [{ action: "admin::project-settings.update", subject: null }]
|
|
642
|
-
}
|
|
842
|
+
const ActionLayout = ({ startActions, endActions }) => {
|
|
843
|
+
if (!startActions && !endActions) {
|
|
844
|
+
return null;
|
|
643
845
|
}
|
|
846
|
+
return /* @__PURE__ */ jsxs(
|
|
847
|
+
Flex,
|
|
848
|
+
{
|
|
849
|
+
justifyContent: "space-between",
|
|
850
|
+
alignItems: "flex-start",
|
|
851
|
+
paddingBottom: 4,
|
|
852
|
+
paddingLeft: 10,
|
|
853
|
+
paddingRight: 10,
|
|
854
|
+
children: [
|
|
855
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
856
|
+
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
857
|
+
]
|
|
858
|
+
}
|
|
859
|
+
);
|
|
644
860
|
};
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
* @constant
|
|
649
|
-
* @type {string}
|
|
650
|
-
*/
|
|
651
|
-
INJECT_COLUMN_IN_TABLE: "Admin/CM/pages/ListView/inject-column-in-table",
|
|
652
|
-
/**
|
|
653
|
-
* Hook that allows to mutate the CM's collection types links pre-set filters
|
|
654
|
-
* @constant
|
|
655
|
-
* @type {string}
|
|
656
|
-
*/
|
|
657
|
-
MUTATE_COLLECTION_TYPES_LINKS: "Admin/CM/pages/App/mutate-collection-types-links",
|
|
658
|
-
/**
|
|
659
|
-
* Hook that allows to mutate the CM's edit view layout
|
|
660
|
-
* @constant
|
|
661
|
-
* @type {string}
|
|
662
|
-
*/
|
|
663
|
-
MUTATE_EDIT_VIEW_LAYOUT: "Admin/CM/pages/EditView/mutate-edit-view-layout",
|
|
664
|
-
/**
|
|
665
|
-
* Hook that allows to mutate the CM's single types links pre-set filters
|
|
666
|
-
* @constant
|
|
667
|
-
* @type {string}
|
|
668
|
-
*/
|
|
669
|
-
MUTATE_SINGLE_TYPES_LINKS: "Admin/CM/pages/App/mutate-single-types-links"
|
|
861
|
+
|
|
862
|
+
const ContentLayout = ({ children }) => {
|
|
863
|
+
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
670
864
|
};
|
|
671
|
-
const SETTINGS_LINKS_CE = () => ({
|
|
672
|
-
global: [
|
|
673
|
-
{
|
|
674
|
-
intlLabel: { id: "Settings.application.title", defaultMessage: "Overview" },
|
|
675
|
-
to: "/settings/application-infos",
|
|
676
|
-
id: "000-application-infos"
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
intlLabel: { id: "Settings.webhooks.title", defaultMessage: "Webhooks" },
|
|
680
|
-
to: "/settings/webhooks",
|
|
681
|
-
id: "webhooks"
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
intlLabel: { id: "Settings.apiTokens.title", defaultMessage: "API Tokens" },
|
|
685
|
-
to: "/settings/api-tokens?sort=name:ASC",
|
|
686
|
-
id: "api-tokens"
|
|
687
|
-
},
|
|
688
|
-
{
|
|
689
|
-
intlLabel: { id: "Settings.transferTokens.title", defaultMessage: "Transfer Tokens" },
|
|
690
|
-
to: "/settings/transfer-tokens?sort=name:ASC",
|
|
691
|
-
id: "transfer-tokens"
|
|
692
|
-
},
|
|
693
|
-
// If the Enterprise/Cloud feature is not enabled and if the config doesn't disable it, we promote the Enterprise/Cloud feature by displaying them in the settings menu.
|
|
694
|
-
// Disable this by adding "promoteEE: false" to your `./config/admin.js` file
|
|
695
|
-
...!window.strapi.features.isEnabled(window.strapi.features.SSO) && window.strapi?.flags?.promoteEE ? [
|
|
696
|
-
{
|
|
697
|
-
intlLabel: { id: "Settings.sso.title", defaultMessage: "Single Sign-On" },
|
|
698
|
-
to: "/settings/purchase-single-sign-on",
|
|
699
|
-
id: "sso-purchase-page",
|
|
700
|
-
lockIcon: true
|
|
701
|
-
}
|
|
702
|
-
] : []
|
|
703
|
-
],
|
|
704
|
-
admin: [
|
|
705
|
-
{
|
|
706
|
-
intlLabel: { id: "global.roles", defaultMessage: "Roles" },
|
|
707
|
-
to: "/settings/roles",
|
|
708
|
-
id: "roles"
|
|
709
|
-
},
|
|
710
|
-
{
|
|
711
|
-
intlLabel: { id: "global.users", defaultMessage: "Users" },
|
|
712
|
-
// Init the search params directly
|
|
713
|
-
to: "/settings/users?pageSize=10&page=1&sort=firstname",
|
|
714
|
-
id: "users"
|
|
715
|
-
},
|
|
716
|
-
...!window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) && window.strapi?.flags?.promoteEE ? [
|
|
717
|
-
{
|
|
718
|
-
intlLabel: { id: "global.auditLogs", defaultMessage: "Audit Logs" },
|
|
719
|
-
to: "/settings/purchase-audit-logs",
|
|
720
|
-
id: "auditLogs-purchase-page",
|
|
721
|
-
lockIcon: true
|
|
722
|
-
}
|
|
723
|
-
] : []
|
|
724
|
-
]
|
|
725
|
-
});
|
|
726
865
|
|
|
727
|
-
const
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
"text",
|
|
742
|
-
"time",
|
|
743
|
-
"uid"
|
|
744
|
-
];
|
|
745
|
-
const ALLOWED_ROOT_LEVEL_OPTIONS = [
|
|
746
|
-
"min",
|
|
747
|
-
"minLength",
|
|
748
|
-
"max",
|
|
749
|
-
"maxLength",
|
|
750
|
-
"required",
|
|
751
|
-
"regex",
|
|
752
|
-
"enum",
|
|
753
|
-
"unique",
|
|
754
|
-
"private",
|
|
755
|
-
"default"
|
|
756
|
-
];
|
|
757
|
-
class CustomFields {
|
|
758
|
-
customFields;
|
|
759
|
-
constructor() {
|
|
760
|
-
this.customFields = {};
|
|
761
|
-
}
|
|
762
|
-
register = (customFields) => {
|
|
763
|
-
if (Array.isArray(customFields)) {
|
|
764
|
-
customFields.forEach((customField) => {
|
|
765
|
-
this.register(customField);
|
|
766
|
-
});
|
|
767
|
-
} else {
|
|
768
|
-
const { name, pluginId, type, intlLabel, intlDescription, components, options } = customFields;
|
|
769
|
-
invariant(name, "A name must be provided");
|
|
770
|
-
invariant(type, "A type must be provided");
|
|
771
|
-
invariant(intlLabel, "An intlLabel must be provided");
|
|
772
|
-
invariant(intlDescription, "An intlDescription must be provided");
|
|
773
|
-
invariant(components, "A components object must be provided");
|
|
774
|
-
invariant(components.Input, "An Input component must be provided");
|
|
775
|
-
invariant(
|
|
776
|
-
ALLOWED_TYPES.includes(type),
|
|
777
|
-
`Custom field type: '${type}' is not a valid Strapi type or it can't be used with a Custom Field`
|
|
778
|
-
);
|
|
779
|
-
const isValidObjectKey = /^(?![0-9])[a-zA-Z0-9$_-]+$/g;
|
|
780
|
-
invariant(
|
|
781
|
-
isValidObjectKey.test(name),
|
|
782
|
-
`Custom field name: '${name}' is not a valid object key`
|
|
783
|
-
);
|
|
784
|
-
const allFormOptions = [...options?.base || [], ...options?.advanced || []];
|
|
785
|
-
if (allFormOptions.length) {
|
|
786
|
-
const optionPathValidations = allFormOptions.reduce(optionsValidationReducer, []);
|
|
787
|
-
optionPathValidations.forEach(({ isValidOptionPath, errorMessage }) => {
|
|
788
|
-
invariant(isValidOptionPath, errorMessage);
|
|
789
|
-
});
|
|
790
|
-
}
|
|
791
|
-
const uid = pluginId ? `plugin::${pluginId}.${name}` : `global::${name}`;
|
|
792
|
-
const uidAlreadyUsed = Object.prototype.hasOwnProperty.call(this.customFields, uid);
|
|
793
|
-
invariant(!uidAlreadyUsed, `Custom field: '${uid}' has already been registered`);
|
|
794
|
-
this.customFields[uid] = customFields;
|
|
795
|
-
}
|
|
796
|
-
};
|
|
797
|
-
getAll = () => {
|
|
798
|
-
return this.customFields;
|
|
799
|
-
};
|
|
800
|
-
get = (uid) => {
|
|
801
|
-
return this.customFields[uid];
|
|
802
|
-
};
|
|
803
|
-
}
|
|
804
|
-
const optionsValidationReducer = (acc, option) => {
|
|
805
|
-
if ("items" in option) {
|
|
806
|
-
return option.items.reduce(optionsValidationReducer, acc);
|
|
807
|
-
}
|
|
808
|
-
if (!option.name) {
|
|
809
|
-
acc.push({
|
|
810
|
-
isValidOptionPath: false,
|
|
811
|
-
errorMessage: "The 'name' property is required on an options object"
|
|
812
|
-
});
|
|
813
|
-
} else {
|
|
814
|
-
acc.push({
|
|
815
|
-
isValidOptionPath: option.name.startsWith("options") || ALLOWED_ROOT_LEVEL_OPTIONS.includes(option.name),
|
|
816
|
-
errorMessage: `'${option.name}' must be prefixed with 'options.'`
|
|
817
|
-
});
|
|
818
|
-
}
|
|
819
|
-
return acc;
|
|
866
|
+
const GridColSize = {
|
|
867
|
+
S: 180,
|
|
868
|
+
M: 250
|
|
869
|
+
};
|
|
870
|
+
const StyledGrid = styled(Box)`
|
|
871
|
+
display: grid;
|
|
872
|
+
grid-template-columns: repeat(
|
|
873
|
+
auto-fit,
|
|
874
|
+
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
875
|
+
);
|
|
876
|
+
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
877
|
+
`;
|
|
878
|
+
const GridLayout = ({ size, children }) => {
|
|
879
|
+
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
820
880
|
};
|
|
821
881
|
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
882
|
+
const BaseHeaderLayout = React.forwardRef(
|
|
883
|
+
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
884
|
+
const isSubtitleString = typeof subtitle === "string";
|
|
885
|
+
if (sticky) {
|
|
886
|
+
return /* @__PURE__ */ jsx(
|
|
887
|
+
Box,
|
|
888
|
+
{
|
|
889
|
+
paddingLeft: 6,
|
|
890
|
+
paddingRight: 6,
|
|
891
|
+
paddingTop: 3,
|
|
892
|
+
paddingBottom: 3,
|
|
893
|
+
position: "fixed",
|
|
894
|
+
top: 0,
|
|
895
|
+
right: 0,
|
|
896
|
+
background: "neutral0",
|
|
897
|
+
shadow: "tableShadow",
|
|
898
|
+
width: `${width}rem`,
|
|
899
|
+
zIndex: 1,
|
|
900
|
+
"data-strapi-header-sticky": true,
|
|
901
|
+
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
902
|
+
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
903
|
+
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
904
|
+
/* @__PURE__ */ jsxs(Box, { children: [
|
|
905
|
+
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
906
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
907
|
+
] }),
|
|
908
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
909
|
+
] }),
|
|
910
|
+
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
911
|
+
] })
|
|
912
|
+
}
|
|
913
|
+
);
|
|
843
914
|
}
|
|
915
|
+
return /* @__PURE__ */ jsxs(
|
|
916
|
+
Box,
|
|
917
|
+
{
|
|
918
|
+
ref,
|
|
919
|
+
paddingLeft: 10,
|
|
920
|
+
paddingRight: 10,
|
|
921
|
+
paddingBottom: 8,
|
|
922
|
+
paddingTop: navigationAction ? 6 : 8,
|
|
923
|
+
background: "neutral100",
|
|
924
|
+
"data-strapi-header": true,
|
|
925
|
+
children: [
|
|
926
|
+
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
927
|
+
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
928
|
+
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
929
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
930
|
+
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
931
|
+
] }),
|
|
932
|
+
primaryAction
|
|
933
|
+
] }),
|
|
934
|
+
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
935
|
+
]
|
|
936
|
+
}
|
|
937
|
+
);
|
|
844
938
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
939
|
+
);
|
|
940
|
+
const HeaderLayout = (props) => {
|
|
941
|
+
const baseHeaderLayoutRef = React.useRef(null);
|
|
942
|
+
const [headerSize, setHeaderSize] = React.useState(null);
|
|
943
|
+
const [containerRef, isVisible] = useElementOnScreen({
|
|
944
|
+
root: null,
|
|
945
|
+
rootMargin: "0px",
|
|
946
|
+
threshold: 0
|
|
947
|
+
});
|
|
948
|
+
useResizeObserver(containerRef, () => {
|
|
949
|
+
if (containerRef.current) {
|
|
950
|
+
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
850
951
|
}
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
[adminApi.reducerPath]: adminApi.reducer,
|
|
856
|
-
admin_app: reducer$3
|
|
857
|
-
};
|
|
858
|
-
const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
|
|
859
|
-
const store = next(...args);
|
|
860
|
-
const asyncReducers = {};
|
|
861
|
-
return {
|
|
862
|
-
...store,
|
|
863
|
-
asyncReducers,
|
|
864
|
-
injectReducer: (key, asyncReducer) => {
|
|
865
|
-
asyncReducers[key] = asyncReducer;
|
|
866
|
-
store.replaceReducer(
|
|
867
|
-
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
868
|
-
combineReducers({
|
|
869
|
-
...appReducers,
|
|
870
|
-
...asyncReducers
|
|
871
|
-
})
|
|
872
|
-
);
|
|
952
|
+
});
|
|
953
|
+
React.useEffect(() => {
|
|
954
|
+
if (baseHeaderLayoutRef.current) {
|
|
955
|
+
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
873
956
|
}
|
|
957
|
+
}, [baseHeaderLayoutRef]);
|
|
958
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
959
|
+
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
960
|
+
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
961
|
+
] });
|
|
962
|
+
};
|
|
963
|
+
HeaderLayout.displayName = "HeaderLayout";
|
|
964
|
+
const useElementOnScreen = (options) => {
|
|
965
|
+
const containerRef = React.useRef(null);
|
|
966
|
+
const [isVisible, setIsVisible] = React.useState(true);
|
|
967
|
+
const callback = ([entry]) => {
|
|
968
|
+
setIsVisible(entry.isIntersecting);
|
|
874
969
|
};
|
|
970
|
+
React.useEffect(() => {
|
|
971
|
+
const containerEl = containerRef.current;
|
|
972
|
+
const observer = new IntersectionObserver(callback, options);
|
|
973
|
+
if (containerEl) {
|
|
974
|
+
observer.observe(containerRef.current);
|
|
975
|
+
}
|
|
976
|
+
return () => {
|
|
977
|
+
if (containerEl) {
|
|
978
|
+
observer.disconnect();
|
|
979
|
+
}
|
|
980
|
+
};
|
|
981
|
+
}, [containerRef, options]);
|
|
982
|
+
return [containerRef, isVisible];
|
|
875
983
|
};
|
|
876
|
-
const
|
|
877
|
-
const
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
}
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
],
|
|
894
|
-
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
895
|
-
});
|
|
896
|
-
return store;
|
|
984
|
+
const useResizeObserver = (sources, onResize) => {
|
|
985
|
+
const handleResize = useCallbackRef(onResize);
|
|
986
|
+
React.useLayoutEffect(() => {
|
|
987
|
+
const resizeObs = new ResizeObserver(handleResize);
|
|
988
|
+
if (Array.isArray(sources)) {
|
|
989
|
+
sources.forEach((source) => {
|
|
990
|
+
if (source.current) {
|
|
991
|
+
resizeObs.observe(source.current);
|
|
992
|
+
}
|
|
993
|
+
});
|
|
994
|
+
} else if (sources.current) {
|
|
995
|
+
resizeObs.observe(sources.current);
|
|
996
|
+
}
|
|
997
|
+
return () => {
|
|
998
|
+
resizeObs.disconnect();
|
|
999
|
+
};
|
|
1000
|
+
}, [sources, handleResize]);
|
|
897
1001
|
};
|
|
898
1002
|
|
|
899
|
-
const
|
|
1003
|
+
const GridContainer = styled(Box)`
|
|
1004
|
+
display: grid;
|
|
1005
|
+
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
1006
|
+
`;
|
|
1007
|
+
const OverflowingItem = styled(Box)`
|
|
1008
|
+
overflow-x: hidden;
|
|
1009
|
+
`;
|
|
1010
|
+
const RootLayout = ({ sideNav, children }) => {
|
|
1011
|
+
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
1012
|
+
sideNav,
|
|
1013
|
+
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
1014
|
+
] });
|
|
1015
|
+
};
|
|
1016
|
+
const Layouts = {
|
|
1017
|
+
Root: RootLayout,
|
|
1018
|
+
Header: HeaderLayout,
|
|
1019
|
+
BaseHeader: BaseHeaderLayout,
|
|
1020
|
+
Grid: GridLayout,
|
|
1021
|
+
Action: ActionLayout,
|
|
1022
|
+
Content: ContentLayout
|
|
1023
|
+
};
|
|
900
1024
|
|
|
901
|
-
const
|
|
902
|
-
const
|
|
903
|
-
return {
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
},
|
|
913
|
-
async runWaterfallAsync(args, store) {
|
|
914
|
-
let result = args;
|
|
915
|
-
for (const fn of _handlers) {
|
|
916
|
-
result = await fn(result, store);
|
|
1025
|
+
const NotFoundPage = () => {
|
|
1026
|
+
const { formatMessage } = useIntl();
|
|
1027
|
+
return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
|
|
1028
|
+
/* @__PURE__ */ jsx(
|
|
1029
|
+
Layouts.Header,
|
|
1030
|
+
{
|
|
1031
|
+
id: "title",
|
|
1032
|
+
title: formatMessage({
|
|
1033
|
+
id: "content-manager.pageNotFound",
|
|
1034
|
+
defaultMessage: "Page not found"
|
|
1035
|
+
})
|
|
917
1036
|
}
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
1037
|
+
),
|
|
1038
|
+
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
|
|
1039
|
+
EmptyStateLayout,
|
|
1040
|
+
{
|
|
1041
|
+
action: /* @__PURE__ */ jsx(LinkButton, { tag: Link$1, variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
|
|
1042
|
+
id: "app.components.NotFoundPage.back",
|
|
1043
|
+
defaultMessage: "Back to homepage"
|
|
1044
|
+
}) }),
|
|
1045
|
+
content: formatMessage({
|
|
1046
|
+
id: "app.page.not.found",
|
|
1047
|
+
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
1048
|
+
}),
|
|
1049
|
+
hasRadius: true,
|
|
1050
|
+
icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
|
|
1051
|
+
shadow: "tableShadow"
|
|
927
1052
|
}
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
runParallel(...args) {
|
|
931
|
-
return Promise.all(
|
|
932
|
-
_handlers.map((fn) => {
|
|
933
|
-
return fn(...args);
|
|
934
|
-
})
|
|
935
|
-
);
|
|
936
|
-
}
|
|
937
|
-
};
|
|
1053
|
+
) })
|
|
1054
|
+
] });
|
|
938
1055
|
};
|
|
939
1056
|
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
}
|
|
950
|
-
const isObject = (obj) => obj !== null && typeof obj === "object" && !Array.isArray(obj);
|
|
951
|
-
const isInteger = (obj) => String(Math.floor(Number(obj))) === obj;
|
|
952
|
-
function setIn(obj, path, value) {
|
|
953
|
-
const res = clone(obj);
|
|
954
|
-
let resVal = res;
|
|
955
|
-
let i = 0;
|
|
956
|
-
const pathArray = toPath(path);
|
|
957
|
-
for (; i < pathArray.length - 1; i++) {
|
|
958
|
-
const currentPath = pathArray[i];
|
|
959
|
-
const currentObj = getIn(obj, pathArray.slice(0, i + 1));
|
|
960
|
-
if (currentObj && (isObject(currentObj) || Array.isArray(currentObj))) {
|
|
961
|
-
resVal = resVal[currentPath] = clone(currentObj);
|
|
962
|
-
} else {
|
|
963
|
-
const nextPath = pathArray[i + 1];
|
|
964
|
-
resVal = resVal[currentPath] = isInteger(nextPath) && Number(nextPath) >= 0 ? [] : {};
|
|
1057
|
+
const getEERoutes = () => [
|
|
1058
|
+
...window.strapi.features.isEnabled(window.strapi.features.AUDIT_LOGS) ? [
|
|
1059
|
+
{
|
|
1060
|
+
path: "audit-logs",
|
|
1061
|
+
lazy: async () => {
|
|
1062
|
+
const { ProtectedListPage } = await import('./ListPage-P4Apgmd-.mjs');
|
|
1063
|
+
return {
|
|
1064
|
+
Component: ProtectedListPage
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
965
1067
|
}
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
}
|
|
1068
|
+
] : [],
|
|
1069
|
+
...window.strapi.features.isEnabled(window.strapi.features.SSO) ? [
|
|
1070
|
+
{
|
|
1071
|
+
path: "single-sign-on",
|
|
1072
|
+
lazy: async () => {
|
|
1073
|
+
const { ProtectedSSO } = await import('./SingleSignOnPage-9l6JRqDd.mjs');
|
|
1074
|
+
return {
|
|
1075
|
+
Component: ProtectedSSO
|
|
1076
|
+
};
|
|
1077
|
+
}
|
|
1078
|
+
}
|
|
1079
|
+
] : []
|
|
1080
|
+
];
|
|
980
1081
|
|
|
981
1082
|
const ERR_MSG = "The Form Component has not been initialised, ensure you are using this hook within a Form component";
|
|
982
1083
|
const [FormProvider, useForm] = createContext("Form", {
|
|
@@ -1015,11 +1116,11 @@ const [FormProvider, useForm] = createContext("Form", {
|
|
|
1015
1116
|
values: {}
|
|
1016
1117
|
});
|
|
1017
1118
|
const Form = React.forwardRef(
|
|
1018
|
-
({ disabled = false, method, onSubmit, ...props }, ref) => {
|
|
1119
|
+
({ disabled = false, method, onSubmit, initialErrors, ...props }, ref) => {
|
|
1019
1120
|
const formRef = React.useRef(null);
|
|
1020
1121
|
const initialValues = React.useRef(props.initialValues ?? {});
|
|
1021
1122
|
const [state, dispatch] = React.useReducer(reducer, {
|
|
1022
|
-
errors: {},
|
|
1123
|
+
errors: initialErrors ?? {},
|
|
1023
1124
|
isSubmitting: false,
|
|
1024
1125
|
values: props.initialValues ?? {}
|
|
1025
1126
|
});
|
|
@@ -1327,7 +1428,7 @@ const reducer = (state, action) => produce(state, (draft) => {
|
|
|
1327
1428
|
draft.values = setIn(
|
|
1328
1429
|
state.values,
|
|
1329
1430
|
action.payload.field,
|
|
1330
|
-
newValue.length > 0 ? newValue :
|
|
1431
|
+
newValue.length > 0 ? newValue : []
|
|
1331
1432
|
);
|
|
1332
1433
|
break;
|
|
1333
1434
|
}
|
|
@@ -1357,11 +1458,18 @@ const useField = (path) => {
|
|
|
1357
1458
|
(state) => getIn(state.values, path)
|
|
1358
1459
|
);
|
|
1359
1460
|
const handleChange = useForm("useField", (state) => state.onChange);
|
|
1360
|
-
const error = useForm("useField", (state) =>
|
|
1461
|
+
const error = useForm("useField", (state) => {
|
|
1462
|
+
const error2 = getIn(state.errors, path);
|
|
1463
|
+
if (isErrorMessageDescriptor(error2)) {
|
|
1464
|
+
const { values, ...message } = error2;
|
|
1465
|
+
return formatMessage(message, values);
|
|
1466
|
+
}
|
|
1467
|
+
return error2;
|
|
1468
|
+
});
|
|
1361
1469
|
return {
|
|
1362
1470
|
initialValue,
|
|
1363
1471
|
/**
|
|
1364
|
-
* Errors can be a string, or a
|
|
1472
|
+
* Errors can be a string, or a MessageDescriptor, so we need to handle both cases.
|
|
1365
1473
|
* If it's anything else, we don't return it.
|
|
1366
1474
|
*/
|
|
1367
1475
|
error: isErrorMessageDescriptor(error) ? formatMessage(
|
|
@@ -1376,7 +1484,7 @@ const useField = (path) => {
|
|
|
1376
1484
|
};
|
|
1377
1485
|
};
|
|
1378
1486
|
const isErrorMessageDescriptor = (object) => {
|
|
1379
|
-
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
|
1487
|
+
return typeof object === "object" && object !== null && !Array.isArray(object) && "id" in object && "defaultMessage" in object;
|
|
1380
1488
|
};
|
|
1381
1489
|
const Blocker = ({ onProceed = () => {
|
|
1382
1490
|
}, onCancel = () => {
|
|
@@ -1388,53 +1496,42 @@ const Blocker = ({ onProceed = () => {
|
|
|
1388
1496
|
return !isSubmitting && modified && (currentLocation.pathname !== nextLocation.pathname || currentLocation.search !== nextLocation.search);
|
|
1389
1497
|
});
|
|
1390
1498
|
if (blocker.state === "blocked") {
|
|
1391
|
-
const handleCancel = () => {
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
return /* @__PURE__ */ jsxs(
|
|
1396
|
-
Dialog,
|
|
1397
|
-
{
|
|
1398
|
-
isOpen: true,
|
|
1399
|
-
title: formatMessage({
|
|
1400
|
-
id: "app.components.ConfirmDialog.title",
|
|
1401
|
-
defaultMessage: "Confirmation"
|
|
1402
|
-
}),
|
|
1403
|
-
onClose: handleCancel,
|
|
1404
|
-
children: [
|
|
1405
|
-
/* @__PURE__ */ jsx(DialogBody, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
|
1406
|
-
/* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
|
1407
|
-
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
|
|
1408
|
-
id: "global.prompt.unsaved",
|
|
1409
|
-
defaultMessage: "You have unsaved changes, are you sure you want to leave?"
|
|
1410
|
-
}) })
|
|
1411
|
-
] }) }),
|
|
1412
|
-
/* @__PURE__ */ jsx(
|
|
1413
|
-
DialogFooter,
|
|
1414
|
-
{
|
|
1415
|
-
startAction: /* @__PURE__ */ jsx(Button, { onClick: handleCancel, variant: "tertiary", children: formatMessage({
|
|
1416
|
-
id: "app.components.Button.cancel",
|
|
1417
|
-
defaultMessage: "Cancel"
|
|
1418
|
-
}) }),
|
|
1419
|
-
endAction: /* @__PURE__ */ jsx(
|
|
1420
|
-
Button,
|
|
1421
|
-
{
|
|
1422
|
-
onClick: () => {
|
|
1423
|
-
onProceed();
|
|
1424
|
-
blocker.proceed();
|
|
1425
|
-
},
|
|
1426
|
-
variant: "danger",
|
|
1427
|
-
children: formatMessage({
|
|
1428
|
-
id: "app.components.Button.confirm",
|
|
1429
|
-
defaultMessage: "Confirm"
|
|
1430
|
-
})
|
|
1431
|
-
}
|
|
1432
|
-
)
|
|
1433
|
-
}
|
|
1434
|
-
)
|
|
1435
|
-
]
|
|
1499
|
+
const handleCancel = (isOpen) => {
|
|
1500
|
+
if (!isOpen) {
|
|
1501
|
+
onCancel();
|
|
1502
|
+
blocker.reset();
|
|
1436
1503
|
}
|
|
1437
|
-
|
|
1504
|
+
};
|
|
1505
|
+
return /* @__PURE__ */ jsx(Dialog.Root, { open: true, onOpenChange: handleCancel, children: /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
1506
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: formatMessage({
|
|
1507
|
+
id: "app.components.ConfirmDialog.title",
|
|
1508
|
+
defaultMessage: "Confirmation"
|
|
1509
|
+
}) }),
|
|
1510
|
+
/* @__PURE__ */ jsx(Dialog.Body, { icon: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }), children: formatMessage({
|
|
1511
|
+
id: "global.prompt.unsaved",
|
|
1512
|
+
defaultMessage: "You have unsaved changes, are you sure you want to leave?"
|
|
1513
|
+
}) }),
|
|
1514
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
1515
|
+
/* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", children: formatMessage({
|
|
1516
|
+
id: "app.components.Button.cancel",
|
|
1517
|
+
defaultMessage: "Cancel"
|
|
1518
|
+
}) }) }),
|
|
1519
|
+
/* @__PURE__ */ jsx(
|
|
1520
|
+
Button,
|
|
1521
|
+
{
|
|
1522
|
+
onClick: () => {
|
|
1523
|
+
onProceed();
|
|
1524
|
+
blocker.proceed();
|
|
1525
|
+
},
|
|
1526
|
+
variant: "danger",
|
|
1527
|
+
children: formatMessage({
|
|
1528
|
+
id: "app.components.Button.confirm",
|
|
1529
|
+
defaultMessage: "Confirm"
|
|
1530
|
+
})
|
|
1531
|
+
}
|
|
1532
|
+
)
|
|
1533
|
+
] })
|
|
1534
|
+
] }) });
|
|
1438
1535
|
}
|
|
1439
1536
|
return null;
|
|
1440
1537
|
};
|
|
@@ -1487,7 +1584,7 @@ const BooleanInput = forwardRef(
|
|
|
1487
1584
|
const MemoizedBooleanInput = memo(BooleanInput);
|
|
1488
1585
|
|
|
1489
1586
|
const CheckboxInput = forwardRef(
|
|
1490
|
-
({ name, required, label, hint, ...props }, ref) => {
|
|
1587
|
+
({ name, required, label, hint, type: _type, ...props }, ref) => {
|
|
1491
1588
|
const field = useField(name);
|
|
1492
1589
|
const fieldRef = useFocusInputField(name);
|
|
1493
1590
|
const composedRefs = useComposedRefs(ref, fieldRef);
|
|
@@ -1495,9 +1592,9 @@ const CheckboxInput = forwardRef(
|
|
|
1495
1592
|
/* @__PURE__ */ jsx(
|
|
1496
1593
|
Checkbox,
|
|
1497
1594
|
{
|
|
1498
|
-
|
|
1595
|
+
onCheckedChange: (checked) => field.onChange(name, !!checked),
|
|
1499
1596
|
ref: composedRefs,
|
|
1500
|
-
|
|
1597
|
+
checked: field.value,
|
|
1501
1598
|
...props,
|
|
1502
1599
|
children: label || props["aria-label"]
|
|
1503
1600
|
}
|
|
@@ -1524,10 +1621,10 @@ const DateInput = forwardRef(
|
|
|
1524
1621
|
ref: composedRefs,
|
|
1525
1622
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1526
1623
|
onChange: (date) => {
|
|
1527
|
-
field.onChange(name, date);
|
|
1624
|
+
field.onChange(name, date ? convertLocalDateToUTCDate(date) : null);
|
|
1528
1625
|
},
|
|
1529
|
-
onClear: () => field.onChange(name,
|
|
1530
|
-
value,
|
|
1626
|
+
onClear: () => field.onChange(name, null),
|
|
1627
|
+
value: value ? convertLocalDateToUTCDate(value) : value,
|
|
1531
1628
|
...props
|
|
1532
1629
|
}
|
|
1533
1630
|
),
|
|
@@ -1536,6 +1633,12 @@ const DateInput = forwardRef(
|
|
|
1536
1633
|
] });
|
|
1537
1634
|
}
|
|
1538
1635
|
);
|
|
1636
|
+
const convertLocalDateToUTCDate = (date) => {
|
|
1637
|
+
const utcDateString = date.toISOString();
|
|
1638
|
+
const timeZone = getLocalTimeZone();
|
|
1639
|
+
const zonedDateTime = parseAbsolute(utcDateString, timeZone);
|
|
1640
|
+
return toCalendarDate(zonedDateTime).toDate("UTC");
|
|
1641
|
+
};
|
|
1539
1642
|
const MemoizedDateInput = memo(DateInput);
|
|
1540
1643
|
|
|
1541
1644
|
const DateTimeInput = forwardRef(
|
|
@@ -1553,9 +1656,9 @@ const DateTimeInput = forwardRef(
|
|
|
1553
1656
|
ref: composedRefs,
|
|
1554
1657
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1555
1658
|
onChange: (date) => {
|
|
1556
|
-
field.onChange(name, date);
|
|
1659
|
+
field.onChange(name, date ? date : null);
|
|
1557
1660
|
},
|
|
1558
|
-
onClear: () => field.onChange(name,
|
|
1661
|
+
onClear: () => field.onChange(name, null),
|
|
1559
1662
|
value,
|
|
1560
1663
|
...props
|
|
1561
1664
|
}
|
|
@@ -1785,7 +1888,7 @@ const TimeInput = forwardRef(
|
|
|
1785
1888
|
ref: composedRefs,
|
|
1786
1889
|
clearLabel: formatMessage({ id: "clearLabel", defaultMessage: "Clear" }),
|
|
1787
1890
|
onChange: (time) => {
|
|
1788
|
-
field.onChange(name, time);
|
|
1891
|
+
field.onChange(name, `${time}:00.000`);
|
|
1789
1892
|
},
|
|
1790
1893
|
onClear: () => field.onChange(name, void 0),
|
|
1791
1894
|
value: field.value ?? "",
|
|
@@ -1805,6 +1908,7 @@ const InputRenderer = memo(
|
|
|
1805
1908
|
case "biginteger":
|
|
1806
1909
|
case "timestamp":
|
|
1807
1910
|
case "string":
|
|
1911
|
+
case "uid":
|
|
1808
1912
|
return /* @__PURE__ */ jsx(MemoizedStringInput, { ref: forwardRef2, ...props });
|
|
1809
1913
|
case "boolean":
|
|
1810
1914
|
return /* @__PURE__ */ jsx(MemoizedBooleanInput, { ref: forwardRef2, ...props });
|
|
@@ -2229,12 +2333,12 @@ const FieldWrapper = styled(Field.Root)`
|
|
|
2229
2333
|
const delays = {
|
|
2230
2334
|
postResponse: 90 * 24 * 60 * 60 * 1e3,
|
|
2231
2335
|
// 90 days in ms
|
|
2232
|
-
postFirstDismissal:
|
|
2233
|
-
//
|
|
2336
|
+
postFirstDismissal: 14 * 24 * 60 * 60 * 1e3,
|
|
2337
|
+
// 14 days in ms
|
|
2234
2338
|
postSubsequentDismissal: 90 * 24 * 60 * 60 * 1e3,
|
|
2235
2339
|
// 90 days in ms
|
|
2236
|
-
display:
|
|
2237
|
-
//
|
|
2340
|
+
display: 30 * 60 * 1e3
|
|
2341
|
+
// 30 minutes in ms
|
|
2238
2342
|
};
|
|
2239
2343
|
const ratingArray = [...Array(11).keys()];
|
|
2240
2344
|
const checkIfShouldShowSurvey = (settings) => {
|
|
@@ -2371,7 +2475,7 @@ const NpsSurvey = () => {
|
|
|
2371
2475
|
bottom: 0,
|
|
2372
2476
|
left: "50%",
|
|
2373
2477
|
transform: "translateX(-50%)",
|
|
2374
|
-
zIndex: "
|
|
2478
|
+
zIndex: "200",
|
|
2375
2479
|
width: "50%",
|
|
2376
2480
|
children: isFeedbackResponse ? /* @__PURE__ */ jsx(Typography, { fontWeight: "semiBold", children: formatMessage({
|
|
2377
2481
|
id: "app.components.NpsSurvey.feedback-response",
|
|
@@ -2588,11 +2692,11 @@ const Register = ({ hasAdmin }) => {
|
|
|
2588
2692
|
}, [error, formatAPIError, navigate, toggleNotification]);
|
|
2589
2693
|
const [registerAdmin] = useRegisterAdminMutation();
|
|
2590
2694
|
const [registerUser] = useRegisterUserMutation();
|
|
2591
|
-
const
|
|
2695
|
+
const dispatch = useTypedDispatch();
|
|
2592
2696
|
const handleRegisterAdmin = async ({ news, ...body }, setFormErrors) => {
|
|
2593
2697
|
const res = await registerAdmin(body);
|
|
2594
2698
|
if ("data" in res) {
|
|
2595
|
-
|
|
2699
|
+
dispatch(login({ token: res.data.token }));
|
|
2596
2700
|
const { roles } = res.data.user;
|
|
2597
2701
|
if (roles) {
|
|
2598
2702
|
const isUserSuperAdmin = roles.find(({ code }) => code === "strapi-super-admin");
|
|
@@ -2625,7 +2729,7 @@ const Register = ({ hasAdmin }) => {
|
|
|
2625
2729
|
const handleRegisterUser = async ({ news, ...body }, setFormErrors) => {
|
|
2626
2730
|
const res = await registerUser(body);
|
|
2627
2731
|
if ("data" in res) {
|
|
2628
|
-
|
|
2732
|
+
dispatch(login({ token: res.data.token }));
|
|
2629
2733
|
if (news) {
|
|
2630
2734
|
setNpsSurveySettings((s) => ({ ...s, enabled: true }));
|
|
2631
2735
|
navigate({
|
|
@@ -2719,7 +2823,7 @@ const Register = ({ hasAdmin }) => {
|
|
|
2719
2823
|
}
|
|
2720
2824
|
},
|
|
2721
2825
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, marginTop: 7, children: [
|
|
2722
|
-
/* @__PURE__ */ jsx(Grid, { gap: 4, children: [
|
|
2826
|
+
/* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: [
|
|
2723
2827
|
{
|
|
2724
2828
|
label: formatMessage({
|
|
2725
2829
|
id: "Auth.form.firstname.label",
|
|
@@ -2795,7 +2899,7 @@ const Register = ({ hasAdmin }) => {
|
|
|
2795
2899
|
size: 12,
|
|
2796
2900
|
type: "checkbox"
|
|
2797
2901
|
}
|
|
2798
|
-
].map(({ size, ...field }) => /* @__PURE__ */ jsx(
|
|
2902
|
+
].map(({ size, ...field }) => /* @__PURE__ */ jsx(Grid.Item, { col: size, children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }) }, field.name)) }),
|
|
2799
2903
|
/* @__PURE__ */ jsx(Button, { fullWidth: true, size: "L", type: "submit", children: formatMessage({
|
|
2800
2904
|
id: "Auth.form.button.register",
|
|
2801
2905
|
defaultMessage: "Let's start"
|
|
@@ -2863,16 +2967,16 @@ const RESET_PASSWORD_SCHEMA = yup.object().shape({
|
|
|
2863
2967
|
});
|
|
2864
2968
|
const ResetPassword = () => {
|
|
2865
2969
|
const { formatMessage } = useIntl();
|
|
2970
|
+
const dispatch = useTypedDispatch();
|
|
2866
2971
|
const navigate = useNavigate();
|
|
2867
2972
|
const { search: searchString } = useLocation();
|
|
2868
2973
|
const query = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
|
2869
2974
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
|
2870
|
-
const { setToken } = useAuth("ResetPassword", (auth) => auth);
|
|
2871
2975
|
const [resetPassword, { error }] = useResetPasswordMutation();
|
|
2872
2976
|
const handleSubmit = async (body) => {
|
|
2873
2977
|
const res = await resetPassword(body);
|
|
2874
2978
|
if ("data" in res) {
|
|
2875
|
-
|
|
2979
|
+
dispatch(login({ token: res.data.token }));
|
|
2876
2980
|
navigate("/");
|
|
2877
2981
|
}
|
|
2878
2982
|
};
|
|
@@ -2962,11 +3066,11 @@ const AuthPage = () => {
|
|
|
2962
3066
|
const { hasAdmin } = data ?? {};
|
|
2963
3067
|
const Login$1 = useEnterprise(
|
|
2964
3068
|
Login,
|
|
2965
|
-
async () => (await import('./Login-
|
|
3069
|
+
async () => (await import('./Login-qOZJMFOX.mjs')).LoginEE
|
|
2966
3070
|
);
|
|
2967
3071
|
const forms = useEnterprise(
|
|
2968
3072
|
FORMS,
|
|
2969
|
-
async () => (await import('./constants-
|
|
3073
|
+
async () => (await import('./constants-nzCvle10.mjs')).FORMS,
|
|
2970
3074
|
{
|
|
2971
3075
|
combine(ceForms, eeForms) {
|
|
2972
3076
|
return {
|
|
@@ -3003,228 +3107,13 @@ const AuthPage = () => {
|
|
|
3003
3107
|
} else if (authType === "login" && !Login$1) {
|
|
3004
3108
|
return null;
|
|
3005
3109
|
}
|
|
3006
|
-
return /* @__PURE__ */ jsx(Component, { hasAdmin });
|
|
3007
|
-
};
|
|
3008
|
-
|
|
3009
|
-
const ActionLayout = ({ startActions, endActions }) => {
|
|
3010
|
-
if (!startActions && !endActions) {
|
|
3011
|
-
return null;
|
|
3012
|
-
}
|
|
3013
|
-
return /* @__PURE__ */ jsxs(
|
|
3014
|
-
Flex,
|
|
3015
|
-
{
|
|
3016
|
-
justifyContent: "space-between",
|
|
3017
|
-
alignItems: "flex-start",
|
|
3018
|
-
paddingBottom: 4,
|
|
3019
|
-
paddingLeft: 10,
|
|
3020
|
-
paddingRight: 10,
|
|
3021
|
-
children: [
|
|
3022
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, wrap: "wrap", children: startActions }),
|
|
3023
|
-
/* @__PURE__ */ jsx(Flex, { gap: 2, shrink: 0, wrap: "wrap", children: endActions })
|
|
3024
|
-
]
|
|
3025
|
-
}
|
|
3026
|
-
);
|
|
3027
|
-
};
|
|
3028
|
-
|
|
3029
|
-
const ContentLayout = ({ children }) => {
|
|
3030
|
-
return /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children });
|
|
3031
|
-
};
|
|
3032
|
-
|
|
3033
|
-
const GridColSize = {
|
|
3034
|
-
S: 180,
|
|
3035
|
-
M: 250
|
|
3036
|
-
};
|
|
3037
|
-
const StyledGrid = styled(Box)`
|
|
3038
|
-
display: grid;
|
|
3039
|
-
grid-template-columns: repeat(
|
|
3040
|
-
auto-fit,
|
|
3041
|
-
minmax(${({ $size }) => `${GridColSize[$size]}px`}, 1fr)
|
|
3042
|
-
);
|
|
3043
|
-
grid-gap: ${({ theme }) => theme.spaces[4]};
|
|
3044
|
-
`;
|
|
3045
|
-
const GridLayout = ({ size, children }) => {
|
|
3046
|
-
return /* @__PURE__ */ jsx(StyledGrid, { $size: size, children });
|
|
3047
|
-
};
|
|
3048
|
-
|
|
3049
|
-
const BaseHeaderLayout = React.forwardRef(
|
|
3050
|
-
({ navigationAction, primaryAction, secondaryAction, subtitle, title, sticky, width, ...props }, ref) => {
|
|
3051
|
-
const isSubtitleString = typeof subtitle === "string";
|
|
3052
|
-
if (sticky) {
|
|
3053
|
-
return /* @__PURE__ */ jsx(
|
|
3054
|
-
Box,
|
|
3055
|
-
{
|
|
3056
|
-
paddingLeft: 6,
|
|
3057
|
-
paddingRight: 6,
|
|
3058
|
-
paddingTop: 3,
|
|
3059
|
-
paddingBottom: 3,
|
|
3060
|
-
position: "fixed",
|
|
3061
|
-
top: 0,
|
|
3062
|
-
right: 0,
|
|
3063
|
-
background: "neutral0",
|
|
3064
|
-
shadow: "tableShadow",
|
|
3065
|
-
width: `${width}rem`,
|
|
3066
|
-
zIndex: 1,
|
|
3067
|
-
"data-strapi-header-sticky": true,
|
|
3068
|
-
children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
3069
|
-
/* @__PURE__ */ jsxs(Flex, { children: [
|
|
3070
|
-
navigationAction && /* @__PURE__ */ jsx(Box, { paddingRight: 3, children: navigationAction }),
|
|
3071
|
-
/* @__PURE__ */ jsxs(Box, { children: [
|
|
3072
|
-
/* @__PURE__ */ jsx(Typography, { variant: "beta", tag: "h1", ...props, children: title }),
|
|
3073
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: subtitle }) : subtitle
|
|
3074
|
-
] }),
|
|
3075
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3076
|
-
] }),
|
|
3077
|
-
/* @__PURE__ */ jsx(Flex, { children: primaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 2, children: primaryAction }) : void 0 })
|
|
3078
|
-
] })
|
|
3079
|
-
}
|
|
3080
|
-
);
|
|
3081
|
-
}
|
|
3082
|
-
return /* @__PURE__ */ jsxs(
|
|
3083
|
-
Box,
|
|
3084
|
-
{
|
|
3085
|
-
ref,
|
|
3086
|
-
paddingLeft: 10,
|
|
3087
|
-
paddingRight: 10,
|
|
3088
|
-
paddingBottom: 8,
|
|
3089
|
-
paddingTop: navigationAction ? 6 : 8,
|
|
3090
|
-
background: "neutral100",
|
|
3091
|
-
"data-strapi-header": true,
|
|
3092
|
-
children: [
|
|
3093
|
-
navigationAction ? /* @__PURE__ */ jsx(Box, { paddingBottom: 2, children: navigationAction }) : null,
|
|
3094
|
-
/* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
|
|
3095
|
-
/* @__PURE__ */ jsxs(Flex, { minWidth: 0, children: [
|
|
3096
|
-
/* @__PURE__ */ jsx(Typography, { tag: "h1", variant: "alpha", ...props, children: title }),
|
|
3097
|
-
secondaryAction ? /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: secondaryAction }) : null
|
|
3098
|
-
] }),
|
|
3099
|
-
primaryAction
|
|
3100
|
-
] }),
|
|
3101
|
-
isSubtitleString ? /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", tag: "p", children: subtitle }) : subtitle
|
|
3102
|
-
]
|
|
3103
|
-
}
|
|
3104
|
-
);
|
|
3105
|
-
}
|
|
3106
|
-
);
|
|
3107
|
-
const HeaderLayout = (props) => {
|
|
3108
|
-
const baseHeaderLayoutRef = React.useRef(null);
|
|
3109
|
-
const [headerSize, setHeaderSize] = React.useState(null);
|
|
3110
|
-
const [containerRef, isVisible] = useElementOnScreen({
|
|
3111
|
-
root: null,
|
|
3112
|
-
rootMargin: "0px",
|
|
3113
|
-
threshold: 0
|
|
3114
|
-
});
|
|
3115
|
-
useResizeObserver(containerRef, () => {
|
|
3116
|
-
if (containerRef.current) {
|
|
3117
|
-
setHeaderSize(containerRef.current.getBoundingClientRect());
|
|
3118
|
-
}
|
|
3119
|
-
});
|
|
3120
|
-
React.useEffect(() => {
|
|
3121
|
-
if (baseHeaderLayoutRef.current) {
|
|
3122
|
-
setHeaderSize(baseHeaderLayoutRef.current.getBoundingClientRect());
|
|
3123
|
-
}
|
|
3124
|
-
}, [baseHeaderLayoutRef]);
|
|
3125
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
3126
|
-
/* @__PURE__ */ jsx("div", { style: { height: headerSize?.height }, ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ref: baseHeaderLayoutRef, ...props }) }),
|
|
3127
|
-
!isVisible && /* @__PURE__ */ jsx(BaseHeaderLayout, { ...props, sticky: true, width: headerSize?.width })
|
|
3128
|
-
] });
|
|
3129
|
-
};
|
|
3130
|
-
HeaderLayout.displayName = "HeaderLayout";
|
|
3131
|
-
const useElementOnScreen = (options) => {
|
|
3132
|
-
const containerRef = React.useRef(null);
|
|
3133
|
-
const [isVisible, setIsVisible] = React.useState(true);
|
|
3134
|
-
const callback = ([entry]) => {
|
|
3135
|
-
setIsVisible(entry.isIntersecting);
|
|
3136
|
-
};
|
|
3137
|
-
React.useEffect(() => {
|
|
3138
|
-
const containerEl = containerRef.current;
|
|
3139
|
-
const observer = new IntersectionObserver(callback, options);
|
|
3140
|
-
if (containerEl) {
|
|
3141
|
-
observer.observe(containerRef.current);
|
|
3142
|
-
}
|
|
3143
|
-
return () => {
|
|
3144
|
-
if (containerEl) {
|
|
3145
|
-
observer.disconnect();
|
|
3146
|
-
}
|
|
3147
|
-
};
|
|
3148
|
-
}, [containerRef, options]);
|
|
3149
|
-
return [containerRef, isVisible];
|
|
3150
|
-
};
|
|
3151
|
-
const useResizeObserver = (sources, onResize) => {
|
|
3152
|
-
const handleResize = useCallbackRef(onResize);
|
|
3153
|
-
React.useLayoutEffect(() => {
|
|
3154
|
-
const resizeObs = new ResizeObserver(handleResize);
|
|
3155
|
-
if (Array.isArray(sources)) {
|
|
3156
|
-
sources.forEach((source) => {
|
|
3157
|
-
if (source.current) {
|
|
3158
|
-
resizeObs.observe(source.current);
|
|
3159
|
-
}
|
|
3160
|
-
});
|
|
3161
|
-
} else if (sources.current) {
|
|
3162
|
-
resizeObs.observe(sources.current);
|
|
3163
|
-
}
|
|
3164
|
-
return () => {
|
|
3165
|
-
resizeObs.disconnect();
|
|
3166
|
-
};
|
|
3167
|
-
}, [sources, handleResize]);
|
|
3168
|
-
};
|
|
3169
|
-
|
|
3170
|
-
const GridContainer = styled(Box)`
|
|
3171
|
-
display: grid;
|
|
3172
|
-
grid-template-columns: ${({ $hasSideNav }) => $hasSideNav ? `auto 1fr` : "1fr"};
|
|
3173
|
-
`;
|
|
3174
|
-
const OverflowingItem = styled(Box)`
|
|
3175
|
-
overflow-x: hidden;
|
|
3176
|
-
`;
|
|
3177
|
-
const RootLayout = ({ sideNav, children }) => {
|
|
3178
|
-
return /* @__PURE__ */ jsxs(GridContainer, { $hasSideNav: Boolean(sideNav), children: [
|
|
3179
|
-
sideNav,
|
|
3180
|
-
/* @__PURE__ */ jsx(OverflowingItem, { paddingBottom: 10, children })
|
|
3181
|
-
] });
|
|
3182
|
-
};
|
|
3183
|
-
const Layouts = {
|
|
3184
|
-
Root: RootLayout,
|
|
3185
|
-
Header: HeaderLayout,
|
|
3186
|
-
BaseHeader: BaseHeaderLayout,
|
|
3187
|
-
Grid: GridLayout,
|
|
3188
|
-
Action: ActionLayout,
|
|
3189
|
-
Content: ContentLayout
|
|
3190
|
-
};
|
|
3191
|
-
|
|
3192
|
-
const NotFoundPage = () => {
|
|
3193
|
-
const { formatMessage } = useIntl();
|
|
3194
|
-
return /* @__PURE__ */ jsxs(Page.Main, { labelledBy: "title", children: [
|
|
3195
|
-
/* @__PURE__ */ jsx(
|
|
3196
|
-
Layouts.Header,
|
|
3197
|
-
{
|
|
3198
|
-
id: "title",
|
|
3199
|
-
title: formatMessage({
|
|
3200
|
-
id: "content-manager.pageNotFound",
|
|
3201
|
-
defaultMessage: "Page not found"
|
|
3202
|
-
})
|
|
3203
|
-
}
|
|
3204
|
-
),
|
|
3205
|
-
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
|
|
3206
|
-
EmptyStateLayout,
|
|
3207
|
-
{
|
|
3208
|
-
action: /* @__PURE__ */ jsx(LinkButton, { tag: Link$1, variant: "secondary", endIcon: /* @__PURE__ */ jsx(ArrowRight, {}), to: "/", children: formatMessage({
|
|
3209
|
-
id: "app.components.NotFoundPage.back",
|
|
3210
|
-
defaultMessage: "Back to homepage"
|
|
3211
|
-
}) }),
|
|
3212
|
-
content: formatMessage({
|
|
3213
|
-
id: "app.page.not.found",
|
|
3214
|
-
defaultMessage: "Oops! We can't seem to find the page you're looging for..."
|
|
3215
|
-
}),
|
|
3216
|
-
hasRadius: true,
|
|
3217
|
-
icon: /* @__PURE__ */ jsx(EmptyPictures, { width: "16rem" }),
|
|
3218
|
-
shadow: "tableShadow"
|
|
3219
|
-
}
|
|
3220
|
-
) })
|
|
3221
|
-
] });
|
|
3110
|
+
return /* @__PURE__ */ jsx(Component, { hasAdmin });
|
|
3222
3111
|
};
|
|
3223
3112
|
|
|
3224
3113
|
const ROUTES_CE = [
|
|
3225
3114
|
{
|
|
3226
3115
|
lazy: async () => {
|
|
3227
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3116
|
+
const { ProtectedListPage } = await import('./ListPage-_sJsfVLq.mjs');
|
|
3228
3117
|
return {
|
|
3229
3118
|
Component: ProtectedListPage
|
|
3230
3119
|
};
|
|
@@ -3233,7 +3122,7 @@ const ROUTES_CE = [
|
|
|
3233
3122
|
},
|
|
3234
3123
|
{
|
|
3235
3124
|
lazy: async () => {
|
|
3236
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3125
|
+
const { ProtectedCreatePage } = await import('./CreatePage-UzCNaW8h.mjs');
|
|
3237
3126
|
return {
|
|
3238
3127
|
Component: ProtectedCreatePage
|
|
3239
3128
|
};
|
|
@@ -3242,7 +3131,7 @@ const ROUTES_CE = [
|
|
|
3242
3131
|
},
|
|
3243
3132
|
{
|
|
3244
3133
|
lazy: async () => {
|
|
3245
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3134
|
+
const { ProtectedCreatePage } = await import('./CreatePage-UzCNaW8h.mjs');
|
|
3246
3135
|
return {
|
|
3247
3136
|
Component: ProtectedCreatePage
|
|
3248
3137
|
};
|
|
@@ -3251,7 +3140,7 @@ const ROUTES_CE = [
|
|
|
3251
3140
|
},
|
|
3252
3141
|
{
|
|
3253
3142
|
lazy: async () => {
|
|
3254
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3143
|
+
const { ProtectedEditPage } = await import('./EditPage-riE7hBMx.mjs');
|
|
3255
3144
|
return {
|
|
3256
3145
|
Component: ProtectedEditPage
|
|
3257
3146
|
};
|
|
@@ -3260,7 +3149,7 @@ const ROUTES_CE = [
|
|
|
3260
3149
|
},
|
|
3261
3150
|
{
|
|
3262
3151
|
lazy: async () => {
|
|
3263
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3152
|
+
const { ProtectedListPage } = await import('./ListPage-Ka430VWJ.mjs');
|
|
3264
3153
|
return {
|
|
3265
3154
|
Component: ProtectedListPage
|
|
3266
3155
|
};
|
|
@@ -3269,7 +3158,7 @@ const ROUTES_CE = [
|
|
|
3269
3158
|
},
|
|
3270
3159
|
{
|
|
3271
3160
|
lazy: async () => {
|
|
3272
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3161
|
+
const { ProtectedEditPage } = await import('./EditPage-QHC3cITE.mjs');
|
|
3273
3162
|
return {
|
|
3274
3163
|
Component: ProtectedEditPage
|
|
3275
3164
|
};
|
|
@@ -3278,7 +3167,7 @@ const ROUTES_CE = [
|
|
|
3278
3167
|
},
|
|
3279
3168
|
{
|
|
3280
3169
|
lazy: async () => {
|
|
3281
|
-
const { ProtectedCreatePage } = await import('./CreatePage-
|
|
3170
|
+
const { ProtectedCreatePage } = await import('./CreatePage-embavU6j.mjs');
|
|
3282
3171
|
return {
|
|
3283
3172
|
Component: ProtectedCreatePage
|
|
3284
3173
|
};
|
|
@@ -3287,7 +3176,7 @@ const ROUTES_CE = [
|
|
|
3287
3176
|
},
|
|
3288
3177
|
{
|
|
3289
3178
|
lazy: async () => {
|
|
3290
|
-
const { ProtectedEditPage } = await import('./EditPage-
|
|
3179
|
+
const { ProtectedEditPage } = await import('./EditPage-xDZwHLDD.mjs').then(n => n.b);
|
|
3291
3180
|
return {
|
|
3292
3181
|
Component: ProtectedEditPage
|
|
3293
3182
|
};
|
|
@@ -3296,7 +3185,7 @@ const ROUTES_CE = [
|
|
|
3296
3185
|
},
|
|
3297
3186
|
{
|
|
3298
3187
|
lazy: async () => {
|
|
3299
|
-
const { ProtectedListPage } = await import('./ListPage-
|
|
3188
|
+
const { ProtectedListPage } = await import('./ListPage-PfBDJtky.mjs');
|
|
3300
3189
|
return {
|
|
3301
3190
|
Component: ProtectedListPage
|
|
3302
3191
|
};
|
|
@@ -3305,7 +3194,7 @@ const ROUTES_CE = [
|
|
|
3305
3194
|
},
|
|
3306
3195
|
{
|
|
3307
3196
|
lazy: async () => {
|
|
3308
|
-
const { ProtectedListView } = await import('./ListView-
|
|
3197
|
+
const { ProtectedListView } = await import('./ListView-udsJ7zMT.mjs');
|
|
3309
3198
|
return {
|
|
3310
3199
|
Component: ProtectedListView
|
|
3311
3200
|
};
|
|
@@ -3314,7 +3203,7 @@ const ROUTES_CE = [
|
|
|
3314
3203
|
},
|
|
3315
3204
|
{
|
|
3316
3205
|
lazy: async () => {
|
|
3317
|
-
const { ProtectedCreateView } = await import('./CreateView-
|
|
3206
|
+
const { ProtectedCreateView } = await import('./CreateView-SQFk7zP8.mjs');
|
|
3318
3207
|
return {
|
|
3319
3208
|
Component: ProtectedCreateView
|
|
3320
3209
|
};
|
|
@@ -3323,7 +3212,7 @@ const ROUTES_CE = [
|
|
|
3323
3212
|
},
|
|
3324
3213
|
{
|
|
3325
3214
|
lazy: async () => {
|
|
3326
|
-
const { ProtectedEditView } = await import('./EditViewPage-
|
|
3215
|
+
const { ProtectedEditView } = await import('./EditViewPage-M5Bto2f0.mjs');
|
|
3327
3216
|
return {
|
|
3328
3217
|
Component: ProtectedEditView
|
|
3329
3218
|
};
|
|
@@ -3332,7 +3221,7 @@ const ROUTES_CE = [
|
|
|
3332
3221
|
},
|
|
3333
3222
|
{
|
|
3334
3223
|
lazy: async () => {
|
|
3335
|
-
const { ProtectedCreateView } = await import('./CreateView-
|
|
3224
|
+
const { ProtectedCreateView } = await import('./CreateView-phBO6q6q.mjs');
|
|
3336
3225
|
return {
|
|
3337
3226
|
Component: ProtectedCreateView
|
|
3338
3227
|
};
|
|
@@ -3341,7 +3230,7 @@ const ROUTES_CE = [
|
|
|
3341
3230
|
},
|
|
3342
3231
|
{
|
|
3343
3232
|
lazy: async () => {
|
|
3344
|
-
const { ProtectedListView } = await import('./ListView-
|
|
3233
|
+
const { ProtectedListView } = await import('./ListView-UKJyJnd2.mjs');
|
|
3345
3234
|
return {
|
|
3346
3235
|
Component: ProtectedListView
|
|
3347
3236
|
};
|
|
@@ -3350,32 +3239,455 @@ const ROUTES_CE = [
|
|
|
3350
3239
|
},
|
|
3351
3240
|
{
|
|
3352
3241
|
lazy: async () => {
|
|
3353
|
-
const { ProtectedEditView } = await import('./EditView-
|
|
3242
|
+
const { ProtectedEditView } = await import('./EditView-3TBDETCw.mjs');
|
|
3354
3243
|
return {
|
|
3355
3244
|
Component: ProtectedEditView
|
|
3356
3245
|
};
|
|
3357
3246
|
},
|
|
3358
|
-
path: "transfer-tokens/:id"
|
|
3359
|
-
},
|
|
3360
|
-
{
|
|
3361
|
-
lazy: async () => {
|
|
3362
|
-
const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-
|
|
3363
|
-
return {
|
|
3364
|
-
Component: PurchaseAuditLogs
|
|
3365
|
-
};
|
|
3247
|
+
path: "transfer-tokens/:id"
|
|
3248
|
+
},
|
|
3249
|
+
{
|
|
3250
|
+
lazy: async () => {
|
|
3251
|
+
const { PurchaseAuditLogs } = await import('./PurchaseAuditLogs-K5ZTiR8K.mjs');
|
|
3252
|
+
return {
|
|
3253
|
+
Component: PurchaseAuditLogs
|
|
3254
|
+
};
|
|
3255
|
+
},
|
|
3256
|
+
path: "purchase-audit-logs"
|
|
3257
|
+
},
|
|
3258
|
+
{
|
|
3259
|
+
lazy: async () => {
|
|
3260
|
+
const { PurchaseSingleSignOn } = await import('./PurchaseSingleSignOn-c143s7mz.mjs');
|
|
3261
|
+
return {
|
|
3262
|
+
Component: PurchaseSingleSignOn
|
|
3263
|
+
};
|
|
3264
|
+
},
|
|
3265
|
+
path: "purchase-single-sign-on"
|
|
3266
|
+
}
|
|
3267
|
+
];
|
|
3268
|
+
|
|
3269
|
+
const getImmutableRoutes = () => [
|
|
3270
|
+
{
|
|
3271
|
+
path: "usecase",
|
|
3272
|
+
lazy: async () => {
|
|
3273
|
+
const { PrivateUseCasePage } = await import('./UseCasePage-fXNd00ES.mjs');
|
|
3274
|
+
return {
|
|
3275
|
+
Component: PrivateUseCasePage
|
|
3276
|
+
};
|
|
3277
|
+
}
|
|
3278
|
+
},
|
|
3279
|
+
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3280
|
+
...getEERoutes$1(),
|
|
3281
|
+
{
|
|
3282
|
+
path: "auth/:authType",
|
|
3283
|
+
element: /* @__PURE__ */ jsx(AuthPage, {})
|
|
3284
|
+
}
|
|
3285
|
+
];
|
|
3286
|
+
const getInitialRoutes = () => [
|
|
3287
|
+
{
|
|
3288
|
+
index: true,
|
|
3289
|
+
lazy: async () => {
|
|
3290
|
+
const { HomePage } = await import('./HomePage-pBVsiRLB.mjs');
|
|
3291
|
+
return {
|
|
3292
|
+
Component: HomePage
|
|
3293
|
+
};
|
|
3294
|
+
}
|
|
3295
|
+
},
|
|
3296
|
+
{
|
|
3297
|
+
path: "me",
|
|
3298
|
+
lazy: async () => {
|
|
3299
|
+
const { ProfilePage } = await import('./ProfilePage-4dKn6UUc.mjs');
|
|
3300
|
+
return {
|
|
3301
|
+
Component: ProfilePage
|
|
3302
|
+
};
|
|
3303
|
+
}
|
|
3304
|
+
},
|
|
3305
|
+
{
|
|
3306
|
+
path: "list-plugins",
|
|
3307
|
+
lazy: async () => {
|
|
3308
|
+
const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-wwA3VULI.mjs');
|
|
3309
|
+
return {
|
|
3310
|
+
Component: ProtectedInstalledPluginsPage
|
|
3311
|
+
};
|
|
3312
|
+
}
|
|
3313
|
+
},
|
|
3314
|
+
{
|
|
3315
|
+
path: "marketplace",
|
|
3316
|
+
lazy: async () => {
|
|
3317
|
+
const { ProtectedMarketplacePage } = await import('./MarketplacePage-KyupKstI.mjs');
|
|
3318
|
+
return {
|
|
3319
|
+
Component: ProtectedMarketplacePage
|
|
3320
|
+
};
|
|
3321
|
+
}
|
|
3322
|
+
},
|
|
3323
|
+
{
|
|
3324
|
+
path: "settings/*",
|
|
3325
|
+
lazy: async () => {
|
|
3326
|
+
const { Layout } = await import('./Layout-Dg3BpNCD.mjs');
|
|
3327
|
+
return {
|
|
3328
|
+
Component: Layout
|
|
3329
|
+
};
|
|
3330
|
+
},
|
|
3331
|
+
children: [
|
|
3332
|
+
{
|
|
3333
|
+
path: "application-infos",
|
|
3334
|
+
lazy: async () => {
|
|
3335
|
+
const { ApplicationInfoPage } = await import('./ApplicationInfoPage-FvuI2dqs.mjs');
|
|
3336
|
+
return {
|
|
3337
|
+
Component: ApplicationInfoPage
|
|
3338
|
+
};
|
|
3339
|
+
}
|
|
3340
|
+
},
|
|
3341
|
+
// ...Object.values(this.settings).flatMap(({ links }) =>
|
|
3342
|
+
// links.map(({ to, Component }) => ({
|
|
3343
|
+
// path: `${to}/*`,
|
|
3344
|
+
// element: (
|
|
3345
|
+
// <React.Suspense fallback={<Page.Loading />}>
|
|
3346
|
+
// <Component />
|
|
3347
|
+
// </React.Suspense>
|
|
3348
|
+
// ),
|
|
3349
|
+
// }))
|
|
3350
|
+
// ),
|
|
3351
|
+
...[...getEERoutes(), ...ROUTES_CE].filter(
|
|
3352
|
+
(route, index, refArray) => refArray.findIndex((obj) => obj.path === route.path) === index
|
|
3353
|
+
)
|
|
3354
|
+
]
|
|
3355
|
+
}
|
|
3356
|
+
];
|
|
3357
|
+
|
|
3358
|
+
class Router {
|
|
3359
|
+
_routes = [];
|
|
3360
|
+
router = null;
|
|
3361
|
+
_menu = [];
|
|
3362
|
+
_settings = {
|
|
3363
|
+
global: {
|
|
3364
|
+
id: "global",
|
|
3365
|
+
intlLabel: {
|
|
3366
|
+
id: "Settings.global",
|
|
3367
|
+
defaultMessage: "Global Settings"
|
|
3368
|
+
},
|
|
3369
|
+
links: []
|
|
3370
|
+
}
|
|
3371
|
+
};
|
|
3372
|
+
constructor(initialRoutes) {
|
|
3373
|
+
this._routes = initialRoutes;
|
|
3374
|
+
}
|
|
3375
|
+
get routes() {
|
|
3376
|
+
return this._routes;
|
|
3377
|
+
}
|
|
3378
|
+
get menu() {
|
|
3379
|
+
return this._menu;
|
|
3380
|
+
}
|
|
3381
|
+
get settings() {
|
|
3382
|
+
return this._settings;
|
|
3383
|
+
}
|
|
3384
|
+
/**
|
|
3385
|
+
* @internal This method is used internally by Strapi to create the router.
|
|
3386
|
+
* It should not be used by plugins, doing so will likely break the application.
|
|
3387
|
+
*/
|
|
3388
|
+
createRouter(strapi, { memory, ...opts } = {}) {
|
|
3389
|
+
const routes = [
|
|
3390
|
+
{
|
|
3391
|
+
path: "/*",
|
|
3392
|
+
errorElement: /* @__PURE__ */ jsx(Provider$1, { store: strapi.store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: strapi.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: strapi.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
|
|
3393
|
+
element: /* @__PURE__ */ jsx(App, { strapi, store: strapi.store }),
|
|
3394
|
+
children: [
|
|
3395
|
+
...getImmutableRoutes(),
|
|
3396
|
+
{
|
|
3397
|
+
path: "/*",
|
|
3398
|
+
lazy: async () => {
|
|
3399
|
+
const { PrivateAdminLayout } = await import('./AuthenticatedLayout-1zXrNSte.mjs');
|
|
3400
|
+
return {
|
|
3401
|
+
Component: PrivateAdminLayout
|
|
3402
|
+
};
|
|
3403
|
+
},
|
|
3404
|
+
children: [
|
|
3405
|
+
...this.routes,
|
|
3406
|
+
{
|
|
3407
|
+
path: "*",
|
|
3408
|
+
element: /* @__PURE__ */ jsx(NotFoundPage, {})
|
|
3409
|
+
}
|
|
3410
|
+
]
|
|
3411
|
+
}
|
|
3412
|
+
]
|
|
3413
|
+
}
|
|
3414
|
+
];
|
|
3415
|
+
if (memory) {
|
|
3416
|
+
this.router = createMemoryRouter(routes, opts);
|
|
3417
|
+
} else {
|
|
3418
|
+
this.router = createBrowserRouter(routes, opts);
|
|
3419
|
+
}
|
|
3420
|
+
return this.router;
|
|
3421
|
+
}
|
|
3422
|
+
addMenuLink = (link) => {
|
|
3423
|
+
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3424
|
+
invariant(
|
|
3425
|
+
typeof link.to === "string",
|
|
3426
|
+
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3427
|
+
);
|
|
3428
|
+
invariant(
|
|
3429
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3430
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3431
|
+
);
|
|
3432
|
+
invariant(
|
|
3433
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3434
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3435
|
+
);
|
|
3436
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3437
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3438
|
+
console.warn(
|
|
3439
|
+
`
|
|
3440
|
+
[${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3441
|
+
`.trim()
|
|
3442
|
+
);
|
|
3443
|
+
}
|
|
3444
|
+
if (link.to.startsWith("/")) {
|
|
3445
|
+
console.warn(
|
|
3446
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3447
|
+
);
|
|
3448
|
+
link.to = link.to.slice(1);
|
|
3449
|
+
}
|
|
3450
|
+
const { Component, ...restLink } = link;
|
|
3451
|
+
if (Component) {
|
|
3452
|
+
this._routes.push({
|
|
3453
|
+
path: `${link.to}/*`,
|
|
3454
|
+
lazy: async () => {
|
|
3455
|
+
const mod = await Component();
|
|
3456
|
+
if ("default" in mod) {
|
|
3457
|
+
return { Component: mod.default };
|
|
3458
|
+
} else {
|
|
3459
|
+
return { Component: mod };
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
});
|
|
3463
|
+
}
|
|
3464
|
+
this.menu.push(restLink);
|
|
3465
|
+
};
|
|
3466
|
+
addSettingsLink(section, link) {
|
|
3467
|
+
if (typeof section === "object" && "links" in section) {
|
|
3468
|
+
invariant(section.id, "section.id should be defined");
|
|
3469
|
+
invariant(
|
|
3470
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3471
|
+
"section.intlLabel should be defined"
|
|
3472
|
+
);
|
|
3473
|
+
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3474
|
+
invariant(Array.isArray(section.links), "TypeError expected links to be an array");
|
|
3475
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3476
|
+
section.links.forEach((link2) => {
|
|
3477
|
+
this.createSettingsLink(section.id, link2);
|
|
3478
|
+
});
|
|
3479
|
+
} else if (typeof section === "object" && link) {
|
|
3480
|
+
invariant(section.id, "section.id should be defined");
|
|
3481
|
+
invariant(
|
|
3482
|
+
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3483
|
+
"section.intlLabel should be defined"
|
|
3484
|
+
);
|
|
3485
|
+
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3486
|
+
this.settings[section.id] = { ...section, links: [] };
|
|
3487
|
+
if (Array.isArray(link)) {
|
|
3488
|
+
link.forEach((l) => this.createSettingsLink(section.id, l));
|
|
3489
|
+
} else {
|
|
3490
|
+
this.createSettingsLink(section.id, link);
|
|
3491
|
+
}
|
|
3492
|
+
} else if (typeof section === "string" && link) {
|
|
3493
|
+
if (Array.isArray(link)) {
|
|
3494
|
+
link.forEach((l) => this.createSettingsLink(section, l));
|
|
3495
|
+
} else {
|
|
3496
|
+
this.createSettingsLink(section, link);
|
|
3497
|
+
}
|
|
3498
|
+
} else {
|
|
3499
|
+
throw new Error(
|
|
3500
|
+
"Invalid arguments provided to addSettingsLink, at minimum a sectionId and link are required."
|
|
3501
|
+
);
|
|
3502
|
+
}
|
|
3503
|
+
}
|
|
3504
|
+
createSettingsLink = (sectionId, link) => {
|
|
3505
|
+
invariant(this._settings[sectionId], "The section does not exist");
|
|
3506
|
+
invariant(link.id, `[${link.intlLabel.defaultMessage}]: link.id should be defined`);
|
|
3507
|
+
invariant(
|
|
3508
|
+
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3509
|
+
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3510
|
+
);
|
|
3511
|
+
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3512
|
+
invariant(
|
|
3513
|
+
!link.Component || link.Component && typeof link.Component === "function",
|
|
3514
|
+
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3515
|
+
);
|
|
3516
|
+
if (!link.Component || link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3517
|
+
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3518
|
+
console.warn(
|
|
3519
|
+
`
|
|
3520
|
+
[${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3521
|
+
`.trim()
|
|
3522
|
+
);
|
|
3523
|
+
}
|
|
3524
|
+
if (link.to.startsWith("/")) {
|
|
3525
|
+
console.warn(
|
|
3526
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3527
|
+
);
|
|
3528
|
+
link.to = link.to.slice(1);
|
|
3529
|
+
}
|
|
3530
|
+
if (link.to.split("/")[0] === "settings") {
|
|
3531
|
+
console.warn(
|
|
3532
|
+
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3533
|
+
);
|
|
3534
|
+
link.to = link.to.split("/").slice(1).join("/");
|
|
3535
|
+
}
|
|
3536
|
+
const { Component, ...restLink } = link;
|
|
3537
|
+
const settingsIndex = this._routes.findIndex((route) => route.path === "settings/*");
|
|
3538
|
+
if (!settingsIndex) {
|
|
3539
|
+
console.warn(
|
|
3540
|
+
"A third party plugin has removed the settings section, the settings link cannot be added."
|
|
3541
|
+
);
|
|
3542
|
+
return;
|
|
3543
|
+
} else if (!this._routes[settingsIndex].children) {
|
|
3544
|
+
this._routes[settingsIndex].children = [];
|
|
3545
|
+
}
|
|
3546
|
+
if (Component) {
|
|
3547
|
+
this._routes[settingsIndex].children.push({
|
|
3548
|
+
path: `${link.to}/*`,
|
|
3549
|
+
lazy: async () => {
|
|
3550
|
+
const mod = await Component();
|
|
3551
|
+
if ("default" in mod) {
|
|
3552
|
+
return { Component: mod.default };
|
|
3553
|
+
} else {
|
|
3554
|
+
return { Component: mod };
|
|
3555
|
+
}
|
|
3556
|
+
}
|
|
3557
|
+
});
|
|
3558
|
+
}
|
|
3559
|
+
this._settings[sectionId].links.push(restLink);
|
|
3560
|
+
};
|
|
3561
|
+
/**
|
|
3562
|
+
* @alpha
|
|
3563
|
+
* @description Adds a route or an array of routes to the router.
|
|
3564
|
+
* Otherwise, pass a function that receives the current routes and
|
|
3565
|
+
* returns the new routes in a reducer like fashion.
|
|
3566
|
+
*/
|
|
3567
|
+
addRoute(route) {
|
|
3568
|
+
if (Array.isArray(route)) {
|
|
3569
|
+
this._routes = [...this._routes, ...route];
|
|
3570
|
+
} else if (typeof route === "object" && route !== null) {
|
|
3571
|
+
this._routes.push(route);
|
|
3572
|
+
} else if (typeof route === "function") {
|
|
3573
|
+
this._routes = route(this._routes);
|
|
3574
|
+
} else {
|
|
3575
|
+
throw new Error(
|
|
3576
|
+
`Expected the \`route\` passed to \`addRoute\` to be an array or a function, but received ${getPrintableType(
|
|
3577
|
+
route
|
|
3578
|
+
)}`
|
|
3579
|
+
);
|
|
3580
|
+
}
|
|
3581
|
+
}
|
|
3582
|
+
}
|
|
3583
|
+
const getPrintableType = (value) => {
|
|
3584
|
+
const nativeType = typeof value;
|
|
3585
|
+
if (nativeType === "object") {
|
|
3586
|
+
if (value === null)
|
|
3587
|
+
return "null";
|
|
3588
|
+
if (Array.isArray(value))
|
|
3589
|
+
return "array";
|
|
3590
|
+
if (value instanceof Object && value.constructor.name !== "Object") {
|
|
3591
|
+
return value.constructor.name;
|
|
3592
|
+
}
|
|
3593
|
+
}
|
|
3594
|
+
return nativeType;
|
|
3595
|
+
};
|
|
3596
|
+
|
|
3597
|
+
const staticReducers = {
|
|
3598
|
+
[adminApi.reducerPath]: adminApi.reducer,
|
|
3599
|
+
admin_app: reducer$3
|
|
3600
|
+
};
|
|
3601
|
+
const injectReducerStoreEnhancer = (appReducers) => (next) => (...args) => {
|
|
3602
|
+
const store = next(...args);
|
|
3603
|
+
const asyncReducers = {};
|
|
3604
|
+
return {
|
|
3605
|
+
...store,
|
|
3606
|
+
asyncReducers,
|
|
3607
|
+
injectReducer: (key, asyncReducer) => {
|
|
3608
|
+
asyncReducers[key] = asyncReducer;
|
|
3609
|
+
store.replaceReducer(
|
|
3610
|
+
// @ts-expect-error we dynamically add reducers which makes the types uncomfortable.
|
|
3611
|
+
combineReducers({
|
|
3612
|
+
...appReducers,
|
|
3613
|
+
...asyncReducers
|
|
3614
|
+
})
|
|
3615
|
+
);
|
|
3616
|
+
}
|
|
3617
|
+
};
|
|
3618
|
+
};
|
|
3619
|
+
const configureStoreImpl = (preloadedState = {}, appMiddlewares = [], injectedReducers = {}) => {
|
|
3620
|
+
const coreReducers = { ...staticReducers, ...injectedReducers };
|
|
3621
|
+
const defaultMiddlewareOptions = {};
|
|
3622
|
+
if (process.env.NODE_ENV === "test") {
|
|
3623
|
+
defaultMiddlewareOptions.serializableCheck = false;
|
|
3624
|
+
defaultMiddlewareOptions.immutableCheck = false;
|
|
3625
|
+
}
|
|
3626
|
+
const store = configureStore({
|
|
3627
|
+
preloadedState: {
|
|
3628
|
+
admin_app: preloadedState.admin_app
|
|
3629
|
+
},
|
|
3630
|
+
reducer: coreReducers,
|
|
3631
|
+
devTools: process.env.NODE_ENV !== "production",
|
|
3632
|
+
middleware: (getDefaultMiddleware) => [
|
|
3633
|
+
...getDefaultMiddleware(defaultMiddlewareOptions),
|
|
3634
|
+
rtkQueryUnauthorizedMiddleware,
|
|
3635
|
+
adminApi.middleware,
|
|
3636
|
+
...appMiddlewares.map((m) => m())
|
|
3637
|
+
],
|
|
3638
|
+
enhancers: [injectReducerStoreEnhancer(coreReducers)]
|
|
3639
|
+
});
|
|
3640
|
+
return store;
|
|
3641
|
+
};
|
|
3642
|
+
const rtkQueryUnauthorizedMiddleware = ({ dispatch }) => (next) => (action) => {
|
|
3643
|
+
if (isRejected(action) && action.payload?.status === 401) {
|
|
3644
|
+
dispatch(logout());
|
|
3645
|
+
window.location.href = "/admin/auth/login";
|
|
3646
|
+
return;
|
|
3647
|
+
}
|
|
3648
|
+
return next(action);
|
|
3649
|
+
};
|
|
3650
|
+
|
|
3651
|
+
const getBasename = () => (process.env.ADMIN_PATH ?? "").replace(window.location.origin, "");
|
|
3652
|
+
|
|
3653
|
+
const createHook = () => {
|
|
3654
|
+
const _handlers = [];
|
|
3655
|
+
return {
|
|
3656
|
+
register(fn) {
|
|
3657
|
+
_handlers.push(fn);
|
|
3658
|
+
},
|
|
3659
|
+
delete(handler) {
|
|
3660
|
+
_handlers.splice(_handlers.indexOf(handler), 1);
|
|
3661
|
+
},
|
|
3662
|
+
runWaterfall(args, store) {
|
|
3663
|
+
return _handlers.reduce((acc, fn) => fn(acc, store), args);
|
|
3664
|
+
},
|
|
3665
|
+
async runWaterfallAsync(args, store) {
|
|
3666
|
+
let result = args;
|
|
3667
|
+
for (const fn of _handlers) {
|
|
3668
|
+
result = await fn(result, store);
|
|
3669
|
+
}
|
|
3670
|
+
return result;
|
|
3671
|
+
},
|
|
3672
|
+
runSeries(...args) {
|
|
3673
|
+
return _handlers.map((fn) => fn(...args));
|
|
3366
3674
|
},
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
return
|
|
3373
|
-
Component: PurchaseSingleSignOn
|
|
3374
|
-
};
|
|
3675
|
+
async runSeriesAsync(...args) {
|
|
3676
|
+
const result = [];
|
|
3677
|
+
for (const fn of _handlers) {
|
|
3678
|
+
result.push(await fn(...args));
|
|
3679
|
+
}
|
|
3680
|
+
return result;
|
|
3375
3681
|
},
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3682
|
+
runParallel(...args) {
|
|
3683
|
+
return Promise.all(
|
|
3684
|
+
_handlers.map((fn) => {
|
|
3685
|
+
return fn(...args);
|
|
3686
|
+
})
|
|
3687
|
+
);
|
|
3688
|
+
}
|
|
3689
|
+
};
|
|
3690
|
+
};
|
|
3379
3691
|
|
|
3380
3692
|
const languageNativeNames = {
|
|
3381
3693
|
ar: "العربية",
|
|
@@ -3428,20 +3740,6 @@ class StrapiApp {
|
|
|
3428
3740
|
injectionZones: {}
|
|
3429
3741
|
};
|
|
3430
3742
|
translations = {};
|
|
3431
|
-
/**
|
|
3432
|
-
* MENU API
|
|
3433
|
-
*/
|
|
3434
|
-
menu = [];
|
|
3435
|
-
settings = {
|
|
3436
|
-
global: {
|
|
3437
|
-
id: "global",
|
|
3438
|
-
intlLabel: {
|
|
3439
|
-
id: "Settings.global",
|
|
3440
|
-
defaultMessage: "Global Settings"
|
|
3441
|
-
},
|
|
3442
|
-
links: []
|
|
3443
|
-
}
|
|
3444
|
-
};
|
|
3445
3743
|
configurations = {
|
|
3446
3744
|
authLogo: StrapiLogo,
|
|
3447
3745
|
head: { favicon: "" },
|
|
@@ -3456,12 +3754,14 @@ class StrapiApp {
|
|
|
3456
3754
|
* APIs
|
|
3457
3755
|
*/
|
|
3458
3756
|
rbac = new RBAC();
|
|
3757
|
+
router;
|
|
3459
3758
|
library = {
|
|
3460
3759
|
components: {},
|
|
3461
3760
|
fields: {}
|
|
3462
3761
|
};
|
|
3463
3762
|
middlewares = [];
|
|
3464
3763
|
reducers = {};
|
|
3764
|
+
store = null;
|
|
3465
3765
|
customFields = new CustomFields();
|
|
3466
3766
|
constructor({ config, appPlugins } = {}) {
|
|
3467
3767
|
this.appPlugins = appPlugins || {};
|
|
@@ -3470,6 +3770,7 @@ class StrapiApp {
|
|
|
3470
3770
|
this.createHook(MUTATE_COLLECTION_TYPES_LINKS);
|
|
3471
3771
|
this.createHook(MUTATE_SINGLE_TYPES_LINKS);
|
|
3472
3772
|
this.createHook(MUTATE_EDIT_VIEW_LAYOUT);
|
|
3773
|
+
this.router = new Router(getInitialRoutes());
|
|
3473
3774
|
}
|
|
3474
3775
|
addComponents = (components) => {
|
|
3475
3776
|
if (Array.isArray(components)) {
|
|
@@ -3497,46 +3798,6 @@ class StrapiApp {
|
|
|
3497
3798
|
this.library.fields[fields.type] = fields.Component;
|
|
3498
3799
|
}
|
|
3499
3800
|
};
|
|
3500
|
-
addMenuLink = (link) => {
|
|
3501
|
-
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3502
|
-
invariant(
|
|
3503
|
-
typeof link.to === "string",
|
|
3504
|
-
`[${link.intlLabel.defaultMessage}]: Expected link.to to be a string instead received ${typeof link.to}`
|
|
3505
|
-
);
|
|
3506
|
-
invariant(
|
|
3507
|
-
link.intlLabel?.id && link.intlLabel?.defaultMessage,
|
|
3508
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage should be defined`
|
|
3509
|
-
);
|
|
3510
|
-
invariant(
|
|
3511
|
-
link.Component && typeof link.Component === "function",
|
|
3512
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise that returns a default component. Please use: \`Component: () => import(path)\` instead.`
|
|
3513
|
-
);
|
|
3514
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3515
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3516
|
-
console.warn(
|
|
3517
|
-
`
|
|
3518
|
-
[${link.intlLabel.defaultMessage}]: [deprecated] addMenuLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3519
|
-
`.trim()
|
|
3520
|
-
);
|
|
3521
|
-
}
|
|
3522
|
-
if (link.to.startsWith("/")) {
|
|
3523
|
-
console.warn(
|
|
3524
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your menu link is an absolute path, it should be relative to the root of the application. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3525
|
-
);
|
|
3526
|
-
link.to = link.to.slice(1);
|
|
3527
|
-
}
|
|
3528
|
-
this.menu.push({
|
|
3529
|
-
...link,
|
|
3530
|
-
Component: React.lazy(async () => {
|
|
3531
|
-
const mod = await link.Component();
|
|
3532
|
-
if ("default" in mod) {
|
|
3533
|
-
return mod;
|
|
3534
|
-
} else {
|
|
3535
|
-
return { default: mod };
|
|
3536
|
-
}
|
|
3537
|
-
})
|
|
3538
|
-
});
|
|
3539
|
-
};
|
|
3540
3801
|
addMiddlewares = (middlewares) => {
|
|
3541
3802
|
middlewares.forEach((middleware) => {
|
|
3542
3803
|
this.middlewares.push(middleware);
|
|
@@ -3554,56 +3815,22 @@ class StrapiApp {
|
|
|
3554
3815
|
this.reducers[name] = reducer;
|
|
3555
3816
|
});
|
|
3556
3817
|
};
|
|
3557
|
-
|
|
3558
|
-
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
`[${link.intlLabel.defaultMessage}]: link.intlLabel.id & link.intlLabel.defaultMessage`
|
|
3563
|
-
);
|
|
3564
|
-
invariant(link.to, `[${link.intlLabel.defaultMessage}]: link.to should be defined`);
|
|
3565
|
-
invariant(
|
|
3566
|
-
link.Component && typeof link.Component === "function",
|
|
3567
|
-
`[${link.intlLabel.defaultMessage}]: link.Component must be a function returning a Promise. Please use: \`Component: () => import(path)\` instead.`
|
|
3568
|
-
);
|
|
3569
|
-
if (link.Component && typeof link.Component === "function" && // @ts-expect-error – shh
|
|
3570
|
-
link.Component[Symbol.toStringTag] === "AsyncFunction") {
|
|
3571
|
-
console.warn(
|
|
3572
|
-
`
|
|
3573
|
-
[${link.intlLabel.defaultMessage}]: [deprecated] addSettingsLink() was called with an async Component from the plugin "${link.intlLabel.defaultMessage}". This will be removed in the future. Please use: \`Component: () => import(path)\` ensuring you return a default export instead.
|
|
3574
|
-
`.trim()
|
|
3575
|
-
);
|
|
3576
|
-
}
|
|
3577
|
-
if (link.to.startsWith("/")) {
|
|
3578
|
-
console.warn(
|
|
3579
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link is an absolute path. It should be relative to \`/settings\`. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3580
|
-
);
|
|
3581
|
-
link.to = link.to.slice(1);
|
|
3582
|
-
}
|
|
3583
|
-
if (link.to.split("/")[0] === "settings") {
|
|
3584
|
-
console.warn(
|
|
3585
|
-
`[${link.intlLabel.defaultMessage}]: the \`to\` property of your settings link has \`settings\` as the first part of it's path. It should be relative to \`settings\` and therefore, not include it. This has been corrected for you but will be removed in a future version of Strapi.`
|
|
3586
|
-
);
|
|
3587
|
-
link.to = link.to.split("/").slice(1).join("/");
|
|
3588
|
-
}
|
|
3589
|
-
this.settings[sectionId].links.push({
|
|
3590
|
-
...link,
|
|
3591
|
-
Component: React.lazy(async () => {
|
|
3592
|
-
const mod = await link.Component();
|
|
3593
|
-
if ("default" in mod) {
|
|
3594
|
-
return mod;
|
|
3595
|
-
} else {
|
|
3596
|
-
return { default: mod };
|
|
3597
|
-
}
|
|
3598
|
-
})
|
|
3599
|
-
});
|
|
3600
|
-
};
|
|
3818
|
+
addMenuLink = (link) => this.router.addMenuLink(link);
|
|
3819
|
+
/**
|
|
3820
|
+
* @deprecated use `addSettingsLink` instead, it internally supports
|
|
3821
|
+
* adding multiple links at once.
|
|
3822
|
+
*/
|
|
3601
3823
|
addSettingsLinks = (sectionId, links) => {
|
|
3602
|
-
invariant(this.settings[sectionId], "The section does not exist");
|
|
3603
3824
|
invariant(Array.isArray(links), "TypeError expected links to be an array");
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3825
|
+
this.router.addSettingsLink(sectionId, links);
|
|
3826
|
+
};
|
|
3827
|
+
/**
|
|
3828
|
+
* @deprecated use `addSettingsLink` instead, you can pass a section object to
|
|
3829
|
+
* create the section and links at the same time.
|
|
3830
|
+
*/
|
|
3831
|
+
createSettingSection = (section, links) => this.router.addSettingsLink(section, links);
|
|
3832
|
+
addSettingsLink = (sectionId, link) => {
|
|
3833
|
+
this.router.addSettingsLink(sectionId, link);
|
|
3607
3834
|
};
|
|
3608
3835
|
async bootstrap(customBootstrap) {
|
|
3609
3836
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
@@ -3670,19 +3897,6 @@ class StrapiApp {
|
|
|
3670
3897
|
createHook = (name) => {
|
|
3671
3898
|
this.hooksDict[name] = createHook();
|
|
3672
3899
|
};
|
|
3673
|
-
createSettingSection = (section, links) => {
|
|
3674
|
-
invariant(section.id, "section.id should be defined");
|
|
3675
|
-
invariant(
|
|
3676
|
-
section.intlLabel?.id && section.intlLabel?.defaultMessage,
|
|
3677
|
-
"section.intlLabel should be defined"
|
|
3678
|
-
);
|
|
3679
|
-
invariant(Array.isArray(links), "TypeError expected links to be an array");
|
|
3680
|
-
invariant(this.settings[section.id] === void 0, "A similar section already exists");
|
|
3681
|
-
this.settings[section.id] = { ...section, links: [] };
|
|
3682
|
-
links.forEach((link) => {
|
|
3683
|
-
this.addSettingsLink(section.id, link);
|
|
3684
|
-
});
|
|
3685
|
-
};
|
|
3686
3900
|
getAdminInjectedComponents = (moduleName, containerName, blockName) => {
|
|
3687
3901
|
try {
|
|
3688
3902
|
return this.admin.injectionZones[moduleName][containerName][blockName] || [];
|
|
@@ -3692,16 +3906,19 @@ class StrapiApp {
|
|
|
3692
3906
|
}
|
|
3693
3907
|
};
|
|
3694
3908
|
getPlugin = (pluginId) => this.plugins[pluginId];
|
|
3695
|
-
async register() {
|
|
3909
|
+
async register(customRegister) {
|
|
3696
3910
|
Object.keys(this.appPlugins).forEach((plugin) => {
|
|
3697
3911
|
this.appPlugins[plugin].register(this);
|
|
3698
3912
|
});
|
|
3913
|
+
if (isFunction(customRegister)) {
|
|
3914
|
+
customRegister(this);
|
|
3915
|
+
}
|
|
3699
3916
|
}
|
|
3700
3917
|
async loadAdminTrads() {
|
|
3701
3918
|
const adminLocales = await Promise.all(
|
|
3702
3919
|
this.configurations.locales.map(async (locale) => {
|
|
3703
3920
|
try {
|
|
3704
|
-
const { default: data } = await __variableDynamicImportRuntimeHelper((/* #__PURE__ */ Object.assign({"./translations/ar.json": () => import('./ar-gTQs8p7A.mjs'),"./translations/ca.json": () => import('./ca-A-U5stlG.mjs'),"./translations/cs.json": () => import('./cs-iYqoHUVt.mjs'),"./translations/de.json": () => import('./de-uZBjRd6a.mjs'),"./translations/dk.json": () => import('./dk-nXAO32DE.mjs'),"./translations/en.json": () => import('./en-
|
|
3921
|
+
const { default: data } = await __variableDynamicImportRuntimeHelper((/* #__PURE__ */ Object.assign({"./translations/ar.json": () => import('./ar-gTQs8p7A.mjs'),"./translations/ca.json": () => import('./ca-A-U5stlG.mjs'),"./translations/cs.json": () => import('./cs-iYqoHUVt.mjs'),"./translations/de.json": () => import('./de-uZBjRd6a.mjs'),"./translations/dk.json": () => import('./dk-nXAO32DE.mjs'),"./translations/en.json": () => import('./en-0Ld-ipyI.mjs'),"./translations/es.json": () => import('./es-i0dEHPPQ.mjs'),"./translations/eu.json": () => import('./eu-wFmYHERY.mjs'),"./translations/fr.json": () => import('./fr-OI7VyC_k.mjs'),"./translations/gu.json": () => import('./gu-zSaMc-a6.mjs'),"./translations/he.json": () => import('./he-YzAGShlQ.mjs'),"./translations/hi.json": () => import('./hi-ZQ4t6UdY.mjs'),"./translations/hu.json": () => import('./hu-O1FJoY8c.mjs'),"./translations/id.json": () => import('./id-Lb_0kPQU.mjs'),"./translations/it.json": () => import('./it-136monzD.mjs'),"./translations/ja.json": () => import('./ja-0-FUC0T4.mjs'),"./translations/ko.json": () => import('./ko-H3Y8GpnD.mjs'),"./translations/ml.json": () => import('./ml-NPdcpJoN.mjs'),"./translations/ms.json": () => import('./ms-v9c434YI.mjs'),"./translations/nl.json": () => import('./nl-qHmOt3d1.mjs'),"./translations/no.json": () => import('./no-XGZQN-Ji.mjs'),"./translations/pl.json": () => import('./pl-Id5YX-Pw.mjs'),"./translations/pt-BR.json": () => import('./pt-BR-0o0Gf-P8.mjs'),"./translations/pt.json": () => import('./pt-f52AXrxz.mjs'),"./translations/ru.json": () => import('./ru-FpmG9SEf.mjs'),"./translations/sa.json": () => import('./sa-KUwV8aRB.mjs'),"./translations/sk.json": () => import('./sk-g_1C955P.mjs'),"./translations/sv.json": () => import('./sv-lzyY1dsz.mjs'),"./translations/th.json": () => import('./th-7LJ9Y8EL.mjs'),"./translations/tr.json": () => import('./tr-09v-DLMg.mjs'),"./translations/uk.json": () => import('./uk-38IblmOr.mjs'),"./translations/vi.json": () => import('./vi-ryNZtXtk.mjs'),"./translations/zh-Hans.json": () => import('./zh-Hans-HlxDUeVA.mjs'),"./translations/zh.json": () => import('./zh-WEteLuNm.mjs')})), `./translations/${locale}.json`);
|
|
3705
3922
|
return { data, locale };
|
|
3706
3923
|
} catch {
|
|
3707
3924
|
return { data: null, locale };
|
|
@@ -3775,7 +3992,7 @@ class StrapiApp {
|
|
|
3775
3992
|
render() {
|
|
3776
3993
|
const localeNames = pick(languageNativeNames, this.configurations.locales || []);
|
|
3777
3994
|
const locale = localStorage.getItem(LANGUAGE_LOCAL_STORAGE_KEY) || "en";
|
|
3778
|
-
|
|
3995
|
+
this.store = configureStoreImpl(
|
|
3779
3996
|
{
|
|
3780
3997
|
admin_app: {
|
|
3781
3998
|
permissions: merge({}, ADMIN_PERMISSIONS_CE, ADMIN_PERMISSIONS_EE),
|
|
@@ -3786,126 +4003,16 @@ class StrapiApp {
|
|
|
3786
4003
|
language: {
|
|
3787
4004
|
locale: localeNames[locale] ? locale : "en",
|
|
3788
4005
|
localeNames
|
|
3789
|
-
}
|
|
4006
|
+
},
|
|
4007
|
+
token: getStoredToken()
|
|
3790
4008
|
}
|
|
3791
4009
|
},
|
|
3792
4010
|
this.middlewares,
|
|
3793
4011
|
this.reducers
|
|
3794
4012
|
);
|
|
3795
|
-
const
|
|
3796
|
-
|
|
3797
|
-
);
|
|
3798
|
-
const router = createBrowserRouter(
|
|
3799
|
-
[
|
|
3800
|
-
{
|
|
3801
|
-
path: "/*",
|
|
3802
|
-
errorElement: /* @__PURE__ */ jsx(Provider$1, { store, children: /* @__PURE__ */ jsx(LanguageProvider, { messages: this.configurations.translations, children: /* @__PURE__ */ jsx(Theme, { themes: this.configurations.themes, children: /* @__PURE__ */ jsx(ErrorElement, {}) }) }) }),
|
|
3803
|
-
element: /* @__PURE__ */ jsx(App, { strapi: this, store }),
|
|
3804
|
-
children: [
|
|
3805
|
-
{
|
|
3806
|
-
path: "usecase",
|
|
3807
|
-
lazy: async () => {
|
|
3808
|
-
const { PrivateUseCasePage } = await import('./UseCasePage-P4AFdcDQ.mjs');
|
|
3809
|
-
return {
|
|
3810
|
-
Component: PrivateUseCasePage
|
|
3811
|
-
};
|
|
3812
|
-
}
|
|
3813
|
-
},
|
|
3814
|
-
// this needs to go before auth/:authType because otherwise it won't match the route
|
|
3815
|
-
...getEERoutes$1(),
|
|
3816
|
-
{
|
|
3817
|
-
path: "auth/:authType",
|
|
3818
|
-
element: /* @__PURE__ */ jsx(AuthPage, {})
|
|
3819
|
-
},
|
|
3820
|
-
{
|
|
3821
|
-
path: "/*",
|
|
3822
|
-
lazy: async () => {
|
|
3823
|
-
const { PrivateAdminLayout } = await import('./AuthenticatedLayout-gOaUXjO8.mjs');
|
|
3824
|
-
return {
|
|
3825
|
-
Component: PrivateAdminLayout
|
|
3826
|
-
};
|
|
3827
|
-
},
|
|
3828
|
-
children: [
|
|
3829
|
-
{
|
|
3830
|
-
index: true,
|
|
3831
|
-
lazy: async () => {
|
|
3832
|
-
const { HomePage } = await import('./HomePage-d4h0KEnw.mjs');
|
|
3833
|
-
return {
|
|
3834
|
-
Component: HomePage
|
|
3835
|
-
};
|
|
3836
|
-
}
|
|
3837
|
-
},
|
|
3838
|
-
{
|
|
3839
|
-
path: "me",
|
|
3840
|
-
lazy: async () => {
|
|
3841
|
-
const { ProfilePage } = await import('./ProfilePage-zk-Py9wt.mjs');
|
|
3842
|
-
return {
|
|
3843
|
-
Component: ProfilePage
|
|
3844
|
-
};
|
|
3845
|
-
}
|
|
3846
|
-
},
|
|
3847
|
-
{
|
|
3848
|
-
path: "list-plugins",
|
|
3849
|
-
lazy: async () => {
|
|
3850
|
-
const { ProtectedInstalledPluginsPage } = await import('./InstalledPluginsPage-nCdAsAAu.mjs');
|
|
3851
|
-
return {
|
|
3852
|
-
Component: ProtectedInstalledPluginsPage
|
|
3853
|
-
};
|
|
3854
|
-
}
|
|
3855
|
-
},
|
|
3856
|
-
{
|
|
3857
|
-
path: "marketplace",
|
|
3858
|
-
lazy: async () => {
|
|
3859
|
-
const { ProtectedMarketplacePage } = await import('./MarketplacePage-oGhZBKgX.mjs');
|
|
3860
|
-
return {
|
|
3861
|
-
Component: ProtectedMarketplacePage
|
|
3862
|
-
};
|
|
3863
|
-
}
|
|
3864
|
-
},
|
|
3865
|
-
{
|
|
3866
|
-
path: "settings/*",
|
|
3867
|
-
lazy: async () => {
|
|
3868
|
-
const { Layout } = await import('./Layout-Ax9QtxH1.mjs');
|
|
3869
|
-
return {
|
|
3870
|
-
Component: Layout
|
|
3871
|
-
};
|
|
3872
|
-
},
|
|
3873
|
-
children: [
|
|
3874
|
-
{
|
|
3875
|
-
path: "application-infos",
|
|
3876
|
-
lazy: async () => {
|
|
3877
|
-
const { ApplicationInfoPage } = await import('./ApplicationInfoPage-6PD2owY8.mjs');
|
|
3878
|
-
return {
|
|
3879
|
-
Component: ApplicationInfoPage
|
|
3880
|
-
};
|
|
3881
|
-
}
|
|
3882
|
-
},
|
|
3883
|
-
...Object.values(this.settings).flatMap(
|
|
3884
|
-
({ links }) => links.map(({ to, Component }) => ({
|
|
3885
|
-
path: `${to}/*`,
|
|
3886
|
-
element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
|
|
3887
|
-
}))
|
|
3888
|
-
),
|
|
3889
|
-
...settingsRoutes
|
|
3890
|
-
]
|
|
3891
|
-
},
|
|
3892
|
-
...this.menu.map(({ to, Component }) => ({
|
|
3893
|
-
path: `${to}/*`,
|
|
3894
|
-
element: /* @__PURE__ */ jsx(React.Suspense, { fallback: /* @__PURE__ */ jsx(Page.Loading, {}), children: /* @__PURE__ */ jsx(Component, {}) })
|
|
3895
|
-
})),
|
|
3896
|
-
{
|
|
3897
|
-
path: "*",
|
|
3898
|
-
element: /* @__PURE__ */ jsx(NotFoundPage, {})
|
|
3899
|
-
}
|
|
3900
|
-
]
|
|
3901
|
-
}
|
|
3902
|
-
]
|
|
3903
|
-
}
|
|
3904
|
-
],
|
|
3905
|
-
{
|
|
3906
|
-
basename: getBasename()
|
|
3907
|
-
}
|
|
3908
|
-
);
|
|
4013
|
+
const router = this.router.createRouter(this, {
|
|
4014
|
+
basename: getBasename()
|
|
4015
|
+
});
|
|
3909
4016
|
return /* @__PURE__ */ jsx(RouterProvider, { router });
|
|
3910
4017
|
}
|
|
3911
4018
|
}
|
|
@@ -3967,7 +4074,7 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
|
|
|
3967
4074
|
config: customisations?.config,
|
|
3968
4075
|
appPlugins: plugins
|
|
3969
4076
|
});
|
|
3970
|
-
await app.register();
|
|
4077
|
+
await app.register(customisations?.register);
|
|
3971
4078
|
await app.bootstrap(customisations?.bootstrap);
|
|
3972
4079
|
await app.loadTrads(customisations?.config?.translations);
|
|
3973
4080
|
createRoot(mountNode).render(app.render());
|
|
@@ -3978,13 +4085,12 @@ const renderAdmin = async (mountNode, { plugins, customisations, features }) =>
|
|
|
3978
4085
|
|
|
3979
4086
|
const ConfirmDialog = ({
|
|
3980
4087
|
children,
|
|
3981
|
-
icon = /* @__PURE__ */ jsx(
|
|
3982
|
-
onClose,
|
|
4088
|
+
icon = /* @__PURE__ */ jsx(StyledWarning, {}),
|
|
3983
4089
|
onConfirm,
|
|
3984
|
-
variant = "danger",
|
|
4090
|
+
variant = "danger-light",
|
|
3985
4091
|
startAction,
|
|
3986
4092
|
endAction,
|
|
3987
|
-
|
|
4093
|
+
title
|
|
3988
4094
|
}) => {
|
|
3989
4095
|
const { formatMessage } = useIntl();
|
|
3990
4096
|
const [isConfirming, setIsConfirming] = React.useState(false);
|
|
@@ -3992,49 +4098,53 @@ const ConfirmDialog = ({
|
|
|
3992
4098
|
id: "app.confirm.body",
|
|
3993
4099
|
defaultMessage: "Are you sure?"
|
|
3994
4100
|
});
|
|
3995
|
-
const handleConfirm = async () => {
|
|
4101
|
+
const handleConfirm = async (e) => {
|
|
3996
4102
|
if (!onConfirm) {
|
|
3997
4103
|
return;
|
|
3998
4104
|
}
|
|
3999
4105
|
try {
|
|
4000
4106
|
setIsConfirming(true);
|
|
4001
|
-
await onConfirm();
|
|
4002
|
-
onClose();
|
|
4107
|
+
await onConfirm(e);
|
|
4003
4108
|
} finally {
|
|
4004
4109
|
setIsConfirming(false);
|
|
4005
4110
|
}
|
|
4006
4111
|
};
|
|
4007
|
-
return /* @__PURE__ */ jsxs(
|
|
4008
|
-
Dialog,
|
|
4009
|
-
|
|
4010
|
-
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
|
|
4015
|
-
|
|
4016
|
-
|
|
4017
|
-
|
|
4018
|
-
|
|
4019
|
-
|
|
4020
|
-
|
|
4021
|
-
|
|
4022
|
-
|
|
4023
|
-
|
|
4024
|
-
|
|
4025
|
-
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
}
|
|
4033
|
-
);
|
|
4034
|
-
};
|
|
4035
|
-
const DefaultBodyWrapper = ({ children }) => {
|
|
4036
|
-
return /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 2, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children }) }) });
|
|
4112
|
+
return /* @__PURE__ */ jsxs(Dialog.Content, { children: [
|
|
4113
|
+
/* @__PURE__ */ jsx(Dialog.Header, { children: title || formatMessage({
|
|
4114
|
+
id: "app.components.ConfirmDialog.title",
|
|
4115
|
+
defaultMessage: "Confirmation"
|
|
4116
|
+
}) }),
|
|
4117
|
+
/* @__PURE__ */ jsx(Dialog.Body, { icon, children: content }),
|
|
4118
|
+
/* @__PURE__ */ jsxs(Dialog.Footer, { children: [
|
|
4119
|
+
startAction || /* @__PURE__ */ jsx(Dialog.Cancel, { children: /* @__PURE__ */ jsx(
|
|
4120
|
+
Button,
|
|
4121
|
+
{
|
|
4122
|
+
fullWidth: true,
|
|
4123
|
+
variant: "tertiary",
|
|
4124
|
+
onClick: (e) => {
|
|
4125
|
+
e.stopPropagation();
|
|
4126
|
+
},
|
|
4127
|
+
children: formatMessage({
|
|
4128
|
+
id: "app.components.Button.cancel",
|
|
4129
|
+
defaultMessage: "Cancel"
|
|
4130
|
+
})
|
|
4131
|
+
}
|
|
4132
|
+
) }),
|
|
4133
|
+
endAction || /* @__PURE__ */ jsx(Dialog.Action, { children: /* @__PURE__ */ jsx(Button, { fullWidth: true, onClick: handleConfirm, variant, loading: isConfirming, children: formatMessage({
|
|
4134
|
+
id: "app.components.Button.confirm",
|
|
4135
|
+
defaultMessage: "Confirm"
|
|
4136
|
+
}) }) })
|
|
4137
|
+
] })
|
|
4138
|
+
] });
|
|
4037
4139
|
};
|
|
4140
|
+
const StyledWarning = styled(WarningCircle)`
|
|
4141
|
+
width: 24px;
|
|
4142
|
+
height: 24px;
|
|
4143
|
+
|
|
4144
|
+
path {
|
|
4145
|
+
fill: ${({ theme }) => theme.colors.danger600};
|
|
4146
|
+
}
|
|
4147
|
+
`;
|
|
4038
4148
|
|
|
4039
4149
|
const useIsMounted = () => {
|
|
4040
4150
|
const isMounted = React.useRef(false);
|
|
@@ -4299,6 +4409,7 @@ const STRING_PARSE_FILTERS = [
|
|
|
4299
4409
|
value: "$endsWithi"
|
|
4300
4410
|
}
|
|
4301
4411
|
];
|
|
4412
|
+
const FILTERS_WITH_NO_VALUE = ["$null", "$notNull"];
|
|
4302
4413
|
|
|
4303
4414
|
function useControllableState({
|
|
4304
4415
|
prop,
|
|
@@ -4376,90 +4487,78 @@ const Root$2 = ({
|
|
|
4376
4487
|
children,
|
|
4377
4488
|
disabled = false,
|
|
4378
4489
|
onChange,
|
|
4490
|
+
options = [],
|
|
4379
4491
|
onOpenChange,
|
|
4380
4492
|
open: openProp,
|
|
4381
4493
|
defaultOpen,
|
|
4382
|
-
|
|
4494
|
+
...restProps
|
|
4383
4495
|
}) => {
|
|
4384
|
-
const [triggerNode, setTriggerNode] = React.useState(null);
|
|
4385
|
-
const [open = false, setOpen] = useControllableState({
|
|
4386
|
-
prop: openProp,
|
|
4387
|
-
defaultProp: defaultOpen,
|
|
4388
|
-
onChange: onOpenChange
|
|
4389
|
-
});
|
|
4390
4496
|
const handleChange = (data) => {
|
|
4391
4497
|
if (onChange) {
|
|
4392
4498
|
onChange(data);
|
|
4393
4499
|
}
|
|
4394
4500
|
};
|
|
4395
|
-
|
|
4501
|
+
const [open = false, setOpen] = useControllableState({
|
|
4502
|
+
prop: openProp,
|
|
4503
|
+
defaultProp: defaultOpen,
|
|
4504
|
+
onChange: onOpenChange
|
|
4505
|
+
});
|
|
4506
|
+
return /* @__PURE__ */ jsx(Popover.Root, { open, onOpenChange: setOpen, ...restProps, children: /* @__PURE__ */ jsx(
|
|
4396
4507
|
FiltersProvider,
|
|
4397
4508
|
{
|
|
4509
|
+
setOpen,
|
|
4398
4510
|
disabled,
|
|
4399
4511
|
onChange: handleChange,
|
|
4400
|
-
open,
|
|
4401
4512
|
options,
|
|
4402
|
-
setOpen,
|
|
4403
|
-
setTriggerNode,
|
|
4404
|
-
triggerNode,
|
|
4405
4513
|
children
|
|
4406
4514
|
}
|
|
4407
|
-
);
|
|
4515
|
+
) });
|
|
4408
4516
|
};
|
|
4409
4517
|
const Trigger = React.forwardRef(
|
|
4410
4518
|
({ label }, forwardedRef) => {
|
|
4411
4519
|
const { formatMessage } = useIntl();
|
|
4412
|
-
const { setTriggerNode, setOpen } = useFilters("Trigger", ({ setTriggerNode: setTriggerNode2, setOpen: setOpen2 }) => ({
|
|
4413
|
-
setTriggerNode: setTriggerNode2,
|
|
4414
|
-
setOpen: setOpen2
|
|
4415
|
-
}));
|
|
4416
4520
|
const disabled = useFilters("Trigger", ({ disabled: disabled2 }) => disabled2);
|
|
4417
|
-
|
|
4418
|
-
const composedRefs = useComposedRefs(forwardedRef, setTriggerNode);
|
|
4419
|
-
const handleClick = () => setOpen(!open);
|
|
4420
|
-
return /* @__PURE__ */ jsx(
|
|
4521
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
4421
4522
|
Button,
|
|
4422
4523
|
{
|
|
4423
4524
|
variant: "tertiary",
|
|
4424
|
-
ref:
|
|
4525
|
+
ref: forwardedRef,
|
|
4425
4526
|
startIcon: /* @__PURE__ */ jsx(Filter, {}),
|
|
4426
|
-
onClick: handleClick,
|
|
4427
4527
|
size: "S",
|
|
4428
4528
|
disabled,
|
|
4429
4529
|
children: label || formatMessage({ id: "app.utils.filters", defaultMessage: "Filters" })
|
|
4430
4530
|
}
|
|
4431
|
-
);
|
|
4531
|
+
) });
|
|
4432
4532
|
}
|
|
4433
4533
|
);
|
|
4434
4534
|
const PopoverImpl = () => {
|
|
4435
4535
|
const [{ query }, setQuery] = useQueryParams();
|
|
4436
4536
|
const { formatMessage } = useIntl();
|
|
4437
|
-
const open = useFilters("Popover", ({ open: open2 }) => open2);
|
|
4438
4537
|
const options = useFilters("Popover", ({ options: options2 }) => options2);
|
|
4439
|
-
const triggerNode = useFilters("Popover", ({ triggerNode: triggerNode2 }) => triggerNode2);
|
|
4440
|
-
const setOpen = useFilters("Popover", ({ setOpen: setOpen2 }) => setOpen2);
|
|
4441
4538
|
const onChange = useFilters("Popover", ({ onChange: onChange2 }) => onChange2);
|
|
4442
|
-
|
|
4539
|
+
const setOpen = useFilters("Popover", ({ setOpen: setOpen2 }) => setOpen2);
|
|
4540
|
+
if (options.length === 0) {
|
|
4443
4541
|
return null;
|
|
4444
4542
|
}
|
|
4445
4543
|
const handleSubmit = (data) => {
|
|
4446
|
-
|
|
4544
|
+
const value = FILTERS_WITH_NO_VALUE.includes(data.filter) ? "true" : data.value;
|
|
4545
|
+
if (!value) {
|
|
4447
4546
|
return;
|
|
4448
4547
|
}
|
|
4449
4548
|
if (onChange) {
|
|
4450
4549
|
onChange(data);
|
|
4451
4550
|
}
|
|
4452
|
-
const
|
|
4551
|
+
const fieldOptions = options.find((filter) => filter.name === data.name);
|
|
4453
4552
|
const operatorValuePairing = {
|
|
4454
|
-
[data.filter]:
|
|
4553
|
+
[data.filter]: value
|
|
4455
4554
|
};
|
|
4456
4555
|
const newFilterQuery = {
|
|
4457
4556
|
...query.filters,
|
|
4458
4557
|
$and: [
|
|
4459
4558
|
...query.filters?.$and ?? [],
|
|
4460
4559
|
{
|
|
4461
|
-
[data.name]:
|
|
4462
|
-
id: operatorValuePairing
|
|
4560
|
+
[data.name]: fieldOptions.type === "relation" ? {
|
|
4561
|
+
[fieldOptions.mainField?.name ?? "id"]: operatorValuePairing
|
|
4463
4562
|
} : operatorValuePairing
|
|
4464
4563
|
}
|
|
4465
4564
|
]
|
|
@@ -4467,89 +4566,79 @@ const PopoverImpl = () => {
|
|
|
4467
4566
|
setQuery({ filters: newFilterQuery, page: 1 });
|
|
4468
4567
|
setOpen(false);
|
|
4469
4568
|
};
|
|
4470
|
-
return /* @__PURE__ */ jsx(
|
|
4471
|
-
|
|
4569
|
+
return /* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsx(Box, { padding: 3, children: /* @__PURE__ */ jsx(
|
|
4570
|
+
Form,
|
|
4472
4571
|
{
|
|
4473
|
-
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
|
|
4482
|
-
|
|
4483
|
-
|
|
4484
|
-
|
|
4485
|
-
|
|
4486
|
-
|
|
4487
|
-
|
|
4488
|
-
|
|
4489
|
-
|
|
4490
|
-
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
|
|
4494
|
-
|
|
4495
|
-
|
|
4496
|
-
|
|
4497
|
-
|
|
4498
|
-
|
|
4499
|
-
|
|
4500
|
-
|
|
4501
|
-
|
|
4502
|
-
|
|
4503
|
-
|
|
4504
|
-
|
|
4505
|
-
|
|
4506
|
-
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
startIcon: /* @__PURE__ */ jsx(Plus, {}),
|
|
4542
|
-
type: "submit",
|
|
4543
|
-
fullWidth: true,
|
|
4544
|
-
children: formatMessage({ id: "app.utils.add-filter", defaultMessage: "Add filter" })
|
|
4545
|
-
}
|
|
4546
|
-
)
|
|
4547
|
-
] });
|
|
4548
|
-
}
|
|
4549
|
-
}
|
|
4550
|
-
)
|
|
4572
|
+
method: "POST",
|
|
4573
|
+
initialValues: {
|
|
4574
|
+
name: options[0]?.name,
|
|
4575
|
+
filter: BASE_FILTERS[0].value
|
|
4576
|
+
},
|
|
4577
|
+
onSubmit: handleSubmit,
|
|
4578
|
+
children: ({ values: formValues, modified, isSubmitting }) => {
|
|
4579
|
+
const filter = options.find((filter2) => filter2.name === formValues.name);
|
|
4580
|
+
const Input = filter?.input || MemoizedInputRenderer;
|
|
4581
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 2, style: { minWidth: 184 }, children: [
|
|
4582
|
+
[
|
|
4583
|
+
{
|
|
4584
|
+
["aria-label"]: formatMessage({
|
|
4585
|
+
id: "app.utils.select-field",
|
|
4586
|
+
defaultMessage: "Select field"
|
|
4587
|
+
}),
|
|
4588
|
+
name: "name",
|
|
4589
|
+
options: options.map((filter2) => ({
|
|
4590
|
+
label: filter2.label,
|
|
4591
|
+
value: filter2.name
|
|
4592
|
+
})),
|
|
4593
|
+
placholder: formatMessage({
|
|
4594
|
+
id: "app.utils.select-field",
|
|
4595
|
+
defaultMessage: "Select field"
|
|
4596
|
+
}),
|
|
4597
|
+
type: "enumeration"
|
|
4598
|
+
},
|
|
4599
|
+
{
|
|
4600
|
+
["aria-label"]: formatMessage({
|
|
4601
|
+
id: "app.utils.select-filter",
|
|
4602
|
+
defaultMessage: "Select filter"
|
|
4603
|
+
}),
|
|
4604
|
+
name: "filter",
|
|
4605
|
+
options: filter?.operators || getFilterList(filter).map((opt) => ({
|
|
4606
|
+
label: formatMessage(opt.label),
|
|
4607
|
+
value: opt.value
|
|
4608
|
+
})),
|
|
4609
|
+
placeholder: formatMessage({
|
|
4610
|
+
id: "app.utils.select-filter",
|
|
4611
|
+
defaultMessage: "Select filter"
|
|
4612
|
+
}),
|
|
4613
|
+
type: "enumeration"
|
|
4614
|
+
}
|
|
4615
|
+
].map((field) => /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field }, field.name)),
|
|
4616
|
+
filter && formValues.filter && formValues.filter !== "$null" && formValues.filter !== "$notNull" ? /* @__PURE__ */ jsx(
|
|
4617
|
+
Input,
|
|
4618
|
+
{
|
|
4619
|
+
...filter,
|
|
4620
|
+
label: null,
|
|
4621
|
+
"aria-label": filter.label,
|
|
4622
|
+
name: "value",
|
|
4623
|
+
type: filter.mainField?.type ?? filter.type
|
|
4624
|
+
}
|
|
4625
|
+
) : null,
|
|
4626
|
+
/* @__PURE__ */ jsx(
|
|
4627
|
+
Button,
|
|
4628
|
+
{
|
|
4629
|
+
disabled: !modified || isSubmitting,
|
|
4630
|
+
size: "L",
|
|
4631
|
+
variant: "secondary",
|
|
4632
|
+
startIcon: /* @__PURE__ */ jsx(Plus, {}),
|
|
4633
|
+
type: "submit",
|
|
4634
|
+
fullWidth: true,
|
|
4635
|
+
children: formatMessage({ id: "app.utils.add-filter", defaultMessage: "Add filter" })
|
|
4636
|
+
}
|
|
4637
|
+
)
|
|
4638
|
+
] });
|
|
4639
|
+
}
|
|
4551
4640
|
}
|
|
4552
|
-
);
|
|
4641
|
+
) }) });
|
|
4553
4642
|
};
|
|
4554
4643
|
const getFilterList = (filter) => {
|
|
4555
4644
|
if (!filter) {
|
|
@@ -4559,7 +4648,6 @@ const getFilterList = (filter) => {
|
|
|
4559
4648
|
switch (type) {
|
|
4560
4649
|
case "email":
|
|
4561
4650
|
case "text":
|
|
4562
|
-
case "enumeration":
|
|
4563
4651
|
case "string": {
|
|
4564
4652
|
return [
|
|
4565
4653
|
...BASE_FILTERS,
|
|
@@ -4581,6 +4669,9 @@ const getFilterList = (filter) => {
|
|
|
4581
4669
|
case "datetime": {
|
|
4582
4670
|
return [...BASE_FILTERS, ...NUMERIC_FILTERS];
|
|
4583
4671
|
}
|
|
4672
|
+
case "enumeration": {
|
|
4673
|
+
return BASE_FILTERS;
|
|
4674
|
+
}
|
|
4584
4675
|
default:
|
|
4585
4676
|
return [...BASE_FILTERS, ...IS_SENSITIVE_FILTERS];
|
|
4586
4677
|
}
|
|
@@ -4733,18 +4824,28 @@ const Root$1 = React.forwardRef(
|
|
|
4733
4824
|
onPageSizeChange(pageSize);
|
|
4734
4825
|
}
|
|
4735
4826
|
};
|
|
4736
|
-
return /* @__PURE__ */ jsx(
|
|
4737
|
-
|
|
4827
|
+
return /* @__PURE__ */ jsx(
|
|
4828
|
+
Flex,
|
|
4738
4829
|
{
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
|
|
4742
|
-
|
|
4743
|
-
|
|
4744
|
-
|
|
4745
|
-
|
|
4830
|
+
ref: forwardedRef,
|
|
4831
|
+
paddingTop: 4,
|
|
4832
|
+
paddingBottom: 4,
|
|
4833
|
+
alignItems: "flex-end",
|
|
4834
|
+
justifyContent: "space-between",
|
|
4835
|
+
children: /* @__PURE__ */ jsx(
|
|
4836
|
+
PaginationProvider,
|
|
4837
|
+
{
|
|
4838
|
+
currentQuery: query,
|
|
4839
|
+
page: query.page,
|
|
4840
|
+
pageSize: query.pageSize,
|
|
4841
|
+
pageCount: pageCount.toString(),
|
|
4842
|
+
setPageSize,
|
|
4843
|
+
total,
|
|
4844
|
+
children
|
|
4845
|
+
}
|
|
4846
|
+
)
|
|
4746
4847
|
}
|
|
4747
|
-
)
|
|
4848
|
+
);
|
|
4748
4849
|
}
|
|
4749
4850
|
);
|
|
4750
4851
|
const PageSize = ({ options = ["10", "20", "50", "100"] }) => {
|
|
@@ -4920,7 +5021,7 @@ const SearchInput = ({
|
|
|
4920
5021
|
disabled,
|
|
4921
5022
|
label: formatMessage({ id: "global.search", defaultMessage: "Search" }),
|
|
4922
5023
|
onClick: handleToggle,
|
|
4923
|
-
children: /* @__PURE__ */ jsx(Search, {
|
|
5024
|
+
children: /* @__PURE__ */ jsx(Search, {})
|
|
4924
5025
|
}
|
|
4925
5026
|
);
|
|
4926
5027
|
};
|
|
@@ -5059,16 +5160,15 @@ const HeaderCheckboxCell = () => {
|
|
|
5059
5160
|
}
|
|
5060
5161
|
};
|
|
5061
5162
|
return /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsx(
|
|
5062
|
-
|
|
5163
|
+
Checkbox,
|
|
5063
5164
|
{
|
|
5064
5165
|
"aria-label": formatMessage({
|
|
5065
5166
|
id: "global.select-all-entries",
|
|
5066
5167
|
defaultMessage: "Select all entries"
|
|
5067
5168
|
}),
|
|
5068
5169
|
disabled: rows.length === 0,
|
|
5069
|
-
checked: areAllEntriesSelected,
|
|
5070
|
-
|
|
5071
|
-
onChange: handleSelectAll
|
|
5170
|
+
checked: isIndeterminate ? "indeterminate" : areAllEntriesSelected,
|
|
5171
|
+
onCheckedChange: handleSelectAll
|
|
5072
5172
|
}
|
|
5073
5173
|
) });
|
|
5074
5174
|
};
|
|
@@ -5112,7 +5212,9 @@ const Body = ({ children }) => {
|
|
|
5112
5212
|
const Row = (props) => {
|
|
5113
5213
|
return /* @__PURE__ */ jsx(Tr, { ...props });
|
|
5114
5214
|
};
|
|
5115
|
-
const Cell =
|
|
5215
|
+
const Cell = (props) => {
|
|
5216
|
+
return /* @__PURE__ */ jsx(Td, { ...props });
|
|
5217
|
+
};
|
|
5116
5218
|
const CheckboxCell = ({ id, ...props }) => {
|
|
5117
5219
|
const rows = useTable("CheckboxCell", (state) => state.rows);
|
|
5118
5220
|
const selectedRows = useTable("CheckboxCell", (state) => state.selectedRows);
|
|
@@ -5123,7 +5225,7 @@ const CheckboxCell = ({ id, ...props }) => {
|
|
|
5123
5225
|
};
|
|
5124
5226
|
const isChecked = selectedRows.findIndex((row) => row.id === id) > -1;
|
|
5125
5227
|
return /* @__PURE__ */ jsx(Cell, { ...props, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(
|
|
5126
|
-
|
|
5228
|
+
Checkbox,
|
|
5127
5229
|
{
|
|
5128
5230
|
"aria-label": formatMessage(
|
|
5129
5231
|
{
|
|
@@ -5134,7 +5236,7 @@ const CheckboxCell = ({ id, ...props }) => {
|
|
|
5134
5236
|
),
|
|
5135
5237
|
disabled: rows.length === 0,
|
|
5136
5238
|
checked: isChecked,
|
|
5137
|
-
|
|
5239
|
+
onCheckedChange: handleSelectRow
|
|
5138
5240
|
}
|
|
5139
5241
|
) });
|
|
5140
5242
|
};
|
|
@@ -5350,5 +5452,5 @@ const {
|
|
|
5350
5452
|
} = usersService;
|
|
5351
5453
|
const useAdminUsers = useGetUsersQuery;
|
|
5352
5454
|
|
|
5353
|
-
export {
|
|
5354
|
-
//# sourceMappingURL=index-
|
|
5455
|
+
export { useInjectReducer as A, BackButton as B, ConfirmDialog as C, useFocusInputField as D, renderAdmin as E, Form as F, DescriptionComponentRenderer as G, Blocker as H, getYupValidationErrors as I, useTable as J, constants as K, LayoutContent as L, MemoizedInputRenderer as M, NpsSurvey as N, Pagination as P, SearchInput as S, Table as T, UnauthenticatedLayout as U, Logo as a, Layouts as b, useGetRolesQuery as c, Login as d, errorsTrads as e, useGetRolePermissionLayoutQuery as f, useGetRolePermissionsQuery as g, useCreateRoleMutation as h, useUpdateRolePermissionsMutation as i, useUpdateUserMutation as j, useAdminUsers as k, useGuidedTour as l, getBasename as m, Column as n, useQueryParams as o, useFetchClient as p, useUpdateRoleMutation as q, SETTINGS_LINKS_CE as r, useCreateUserMutation as s, useDeleteManyUsersMutation as t, useField as u, Filters as v, useClipboard as w, useForm as x, MemoizedStringInput as y, StrapiLogo as z };
|
|
5456
|
+
//# sourceMappingURL=index-f6STHGSC.mjs.map
|