@strapi/plugin-users-permissions 5.0.0-beta.0 → 5.0.0-beta.10

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.
Files changed (240) hide show
  1. package/admin/src/components/BoundRoute/index.jsx +2 -2
  2. package/admin/src/components/FormModal/Input/index.jsx +32 -31
  3. package/admin/src/components/FormModal/index.jsx +50 -66
  4. package/admin/src/components/Permissions/PermissionRow/CheckboxWrapper.jsx +1 -1
  5. package/admin/src/components/Permissions/PermissionRow/SubCategory.jsx +11 -20
  6. package/admin/src/components/Permissions/index.jsx +27 -35
  7. package/admin/src/components/Policies/index.jsx +5 -5
  8. package/admin/src/components/UsersPermissions/index.jsx +7 -7
  9. package/admin/src/pages/AdvancedSettings/index.jsx +13 -23
  10. package/admin/src/pages/EmailTemplates/components/EmailForm.jsx +113 -111
  11. package/admin/src/pages/EmailTemplates/components/EmailTable.jsx +23 -24
  12. package/admin/src/pages/EmailTemplates/index.jsx +14 -15
  13. package/admin/src/pages/Providers/index.jsx +13 -16
  14. package/admin/src/pages/Roles/pages/CreatePage.jsx +38 -35
  15. package/admin/src/pages/Roles/pages/EditPage.jsx +42 -35
  16. package/admin/src/pages/Roles/pages/ListPage/components/TableBody.jsx +9 -9
  17. package/admin/src/pages/Roles/pages/ListPage/index.jsx +16 -21
  18. package/dist/_chunks/{ar-t5qTFaAD.js → ar-BguGUqwK.js} +1 -1
  19. package/dist/_chunks/ar-BguGUqwK.js.map +1 -0
  20. package/dist/_chunks/{ar-MvD8Ghac.mjs → ar-CK8BRRXB.mjs} +1 -1
  21. package/dist/_chunks/ar-CK8BRRXB.mjs.map +1 -0
  22. package/dist/_chunks/{cs-BMuXwxA1.mjs → cs-BVigMk0l.mjs} +1 -1
  23. package/dist/_chunks/cs-BVigMk0l.mjs.map +1 -0
  24. package/dist/_chunks/{cs-I8N4u-Sd.js → cs-BW8-K_GY.js} +1 -1
  25. package/dist/_chunks/cs-BW8-K_GY.js.map +1 -0
  26. package/dist/_chunks/{de-zs2qqc0W.mjs → de-BKUdRFI4.mjs} +1 -1
  27. package/dist/_chunks/de-BKUdRFI4.mjs.map +1 -0
  28. package/dist/_chunks/{de-YTjtq89K.js → de-owXpVluI.js} +1 -1
  29. package/dist/_chunks/de-owXpVluI.js.map +1 -0
  30. package/dist/_chunks/{dk-HctVBMsG.mjs → dk-BQiTK50l.mjs} +1 -1
  31. package/dist/_chunks/dk-BQiTK50l.mjs.map +1 -0
  32. package/dist/_chunks/{dk-TF-dWjzl.js → dk-LXAnbuBk.js} +1 -1
  33. package/dist/_chunks/dk-LXAnbuBk.js.map +1 -0
  34. package/dist/_chunks/{en-jvJ-d-Qq.mjs → en-DOHtPf-2.mjs} +1 -1
  35. package/dist/_chunks/en-DOHtPf-2.mjs.map +1 -0
  36. package/dist/_chunks/{en-TaNIVnDO.js → en-MHo5mcsU.js} +1 -1
  37. package/dist/_chunks/en-MHo5mcsU.js.map +1 -0
  38. package/dist/_chunks/{es-XBQsB8_9.js → es-BwLCLXAQ.js} +1 -1
  39. package/dist/_chunks/es-BwLCLXAQ.js.map +1 -0
  40. package/dist/_chunks/{es-9381tih_.mjs → es-DNgOVMjD.mjs} +1 -1
  41. package/dist/_chunks/es-DNgOVMjD.mjs.map +1 -0
  42. package/dist/_chunks/{fr-CMSc77If.mjs → fr-DkgRugiU.mjs} +1 -1
  43. package/dist/_chunks/fr-DkgRugiU.mjs.map +1 -0
  44. package/dist/_chunks/{fr-6cz3U-IF.js → fr-DkhpSjjm.js} +1 -1
  45. package/dist/_chunks/fr-DkhpSjjm.js.map +1 -0
  46. package/dist/_chunks/{id-RJ934rq-.js → id-BTemOeTZ.js} +1 -1
  47. package/dist/_chunks/id-BTemOeTZ.js.map +1 -0
  48. package/dist/_chunks/{id-SDuyIkZa.mjs → id-BdEsvnaF.mjs} +1 -1
  49. package/dist/_chunks/id-BdEsvnaF.mjs.map +1 -0
  50. package/dist/_chunks/{index-deaP9rgn.js → index-Bmp8oEaL.js} +66 -78
  51. package/dist/_chunks/index-Bmp8oEaL.js.map +1 -0
  52. package/dist/_chunks/{index-VQ3uu7FR.mjs → index-BoMRcQMw.mjs} +22 -22
  53. package/dist/_chunks/{index-VQ3uu7FR.mjs.map → index-BoMRcQMw.mjs.map} +1 -1
  54. package/dist/_chunks/{index-i1lZHF3N.mjs → index-C3uAp27O.mjs} +113 -120
  55. package/dist/_chunks/index-C3uAp27O.mjs.map +1 -0
  56. package/dist/_chunks/{index-cC7LGLsK.mjs → index-CgwV7-UQ.mjs} +16 -22
  57. package/dist/_chunks/index-CgwV7-UQ.mjs.map +1 -0
  58. package/dist/_chunks/{index-Omcy-t4F.js → index-Ck-grCz9.js} +129 -162
  59. package/dist/_chunks/index-Ck-grCz9.js.map +1 -0
  60. package/dist/_chunks/{index-AT8MwqgE.js → index-CkV_Gx1w.js} +112 -119
  61. package/dist/_chunks/index-CkV_Gx1w.js.map +1 -0
  62. package/dist/_chunks/{index-nKbtq7R-.js → index-CqRSlrYn.js} +16 -22
  63. package/dist/_chunks/index-CqRSlrYn.js.map +1 -0
  64. package/dist/_chunks/{index-YtsLdO8d.js → index-D9CJMgdl.js} +22 -22
  65. package/dist/_chunks/{index-YtsLdO8d.js.map → index-D9CJMgdl.js.map} +1 -1
  66. package/dist/_chunks/{index-OPfJFEYD.mjs → index-DNNjHtHG.mjs} +66 -78
  67. package/dist/_chunks/index-DNNjHtHG.mjs.map +1 -0
  68. package/dist/_chunks/{index-eH8XAk_H.mjs → index-b5IzYPqT.mjs} +119 -151
  69. package/dist/_chunks/index-b5IzYPqT.mjs.map +1 -0
  70. package/dist/_chunks/index-jwAq-BX--Cqx0wYbj.js +10594 -0
  71. package/dist/_chunks/index-jwAq-BX--Cqx0wYbj.js.map +1 -0
  72. package/dist/_chunks/index-jwAq-BX--dMZbL-qM.mjs +10570 -0
  73. package/dist/_chunks/index-jwAq-BX--dMZbL-qM.mjs.map +1 -0
  74. package/dist/_chunks/{it-bvH7DgQo.mjs → it-B-rv0E24.mjs} +1 -1
  75. package/dist/_chunks/it-B-rv0E24.mjs.map +1 -0
  76. package/dist/_chunks/{it-YhZOlM2X.js → it-D1rH6V6_.js} +1 -1
  77. package/dist/_chunks/it-D1rH6V6_.js.map +1 -0
  78. package/dist/_chunks/{ja-o_-JPvQv.mjs → ja-C8K-VBPD.mjs} +1 -1
  79. package/dist/_chunks/ja-C8K-VBPD.mjs.map +1 -0
  80. package/dist/_chunks/{ja-xssHUXFv.js → ja-DqShgTMf.js} +1 -1
  81. package/dist/_chunks/ja-DqShgTMf.js.map +1 -0
  82. package/dist/_chunks/{ko-C3mHUSJa.js → ko-B9DGEPWH.js} +1 -1
  83. package/dist/_chunks/ko-B9DGEPWH.js.map +1 -0
  84. package/dist/_chunks/{ko-XJbPSez_.mjs → ko-Busb0wIY.mjs} +1 -1
  85. package/dist/_chunks/ko-Busb0wIY.mjs.map +1 -0
  86. package/dist/_chunks/{ms-II5Ea73J.mjs → ms-ByvsQjRt.mjs} +1 -1
  87. package/dist/_chunks/ms-ByvsQjRt.mjs.map +1 -0
  88. package/dist/_chunks/{ms-d0hfg65Z.js → ms-CPBU3LWf.js} +1 -1
  89. package/dist/_chunks/ms-CPBU3LWf.js.map +1 -0
  90. package/dist/_chunks/{nl-vEy6TN0K.mjs → nl-5qO8Rpcy.mjs} +1 -1
  91. package/dist/_chunks/nl-5qO8Rpcy.mjs.map +1 -0
  92. package/dist/_chunks/{nl-TA7TfK_5.js → nl-CwNB6YoO.js} +1 -1
  93. package/dist/_chunks/nl-CwNB6YoO.js.map +1 -0
  94. package/dist/_chunks/{pl-2VowaFGt.mjs → pl-BdIzifBE.mjs} +1 -1
  95. package/dist/_chunks/pl-BdIzifBE.mjs.map +1 -0
  96. package/dist/_chunks/{pl-0pUL9hdA.js → pl-Do9UD69f.js} +1 -1
  97. package/dist/_chunks/pl-Do9UD69f.js.map +1 -0
  98. package/dist/_chunks/{pt-Rf9W51IO.mjs → pt-BIO24ioG.mjs} +1 -1
  99. package/dist/_chunks/pt-BIO24ioG.mjs.map +1 -0
  100. package/dist/_chunks/{pt-BR-WNOhafR4.js → pt-BR-D7dZhxuP.js} +1 -1
  101. package/dist/_chunks/pt-BR-D7dZhxuP.js.map +1 -0
  102. package/dist/_chunks/{pt-BR-sS1Xp3Jt.mjs → pt-BR-f0p23AQZ.mjs} +1 -1
  103. package/dist/_chunks/pt-BR-f0p23AQZ.mjs.map +1 -0
  104. package/dist/_chunks/{pt-guNR9Gax.js → pt-fdvyOnUp.js} +1 -1
  105. package/dist/_chunks/pt-fdvyOnUp.js.map +1 -0
  106. package/dist/_chunks/{ru-X3BMXDds.js → ru-C94rjPGA.js} +1 -1
  107. package/dist/_chunks/ru-C94rjPGA.js.map +1 -0
  108. package/dist/_chunks/{ru-qKHnd5or.mjs → ru-VWy-IB7K.mjs} +1 -1
  109. package/dist/_chunks/ru-VWy-IB7K.mjs.map +1 -0
  110. package/dist/_chunks/{sk-NWPw1oTN.js → sk-BABEhykl.js} +1 -1
  111. package/dist/_chunks/sk-BABEhykl.js.map +1 -0
  112. package/dist/_chunks/{sk-_Ryr-eTT.mjs → sk-B_LIcepm.mjs} +1 -1
  113. package/dist/_chunks/sk-B_LIcepm.mjs.map +1 -0
  114. package/dist/_chunks/{sv-BqzScFXS.mjs → sv-ABLKOokl.mjs} +1 -1
  115. package/dist/_chunks/sv-ABLKOokl.mjs.map +1 -0
  116. package/dist/_chunks/{sv-76NnbB__.js → sv-Be43LhA9.js} +1 -1
  117. package/dist/_chunks/sv-Be43LhA9.js.map +1 -0
  118. package/dist/_chunks/{th-WsknMEpq.mjs → th-DKyP7ueR.mjs} +1 -1
  119. package/dist/_chunks/th-DKyP7ueR.mjs.map +1 -0
  120. package/dist/_chunks/{th-cbppX21D.js → th-DgVhVLhL.js} +1 -1
  121. package/dist/_chunks/th-DgVhVLhL.js.map +1 -0
  122. package/dist/_chunks/{tr-6mm_Fmz7.js → tr-B_idhkEs.js} +1 -1
  123. package/dist/_chunks/tr-B_idhkEs.js.map +1 -0
  124. package/dist/_chunks/{tr-_DB1F1GW.mjs → tr-qa1Q5UjC.mjs} +1 -1
  125. package/dist/_chunks/tr-qa1Q5UjC.mjs.map +1 -0
  126. package/dist/_chunks/{uk-yxMSQAwI.mjs → uk-BmRqbeQc.mjs} +1 -1
  127. package/dist/_chunks/uk-BmRqbeQc.mjs.map +1 -0
  128. package/dist/_chunks/{uk-sI2I1ogF.js → uk-LHOivnhP.js} +1 -1
  129. package/dist/_chunks/uk-LHOivnhP.js.map +1 -0
  130. package/dist/_chunks/{vi-A3zJxaiI.js → vi-CdVRdKDw.js} +1 -1
  131. package/dist/_chunks/vi-CdVRdKDw.js.map +1 -0
  132. package/dist/_chunks/{vi-xY0zCW3d.mjs → vi-HW-EdMea.mjs} +1 -1
  133. package/dist/_chunks/vi-HW-EdMea.mjs.map +1 -0
  134. package/dist/_chunks/{zh-OFeldzbX.mjs → zh-5hKkVPA4.mjs} +1 -1
  135. package/dist/_chunks/zh-5hKkVPA4.mjs.map +1 -0
  136. package/dist/_chunks/{zh-72SpmFXa.js → zh-Cuq8gMnF.js} +1 -1
  137. package/dist/_chunks/zh-Cuq8gMnF.js.map +1 -0
  138. package/dist/_chunks/{zh-Hans-E84cu4kP.mjs → zh-Hans-BHilK-yc.mjs} +1 -1
  139. package/dist/_chunks/zh-Hans-BHilK-yc.mjs.map +1 -0
  140. package/dist/_chunks/{zh-Hans-ArWWtyP4.js → zh-Hans-GQDMKtY4.js} +1 -1
  141. package/dist/_chunks/zh-Hans-GQDMKtY4.js.map +1 -0
  142. package/dist/admin/index.js +1 -1
  143. package/dist/admin/index.mjs +1 -1
  144. package/package.json +17 -17
  145. package/server/bootstrap/index.js +3 -3
  146. package/server/config.js +29 -0
  147. package/server/controllers/auth.js +23 -6
  148. package/server/controllers/content-manager-user.js +4 -2
  149. package/server/controllers/user.js +3 -4
  150. package/server/services/user.js +24 -7
  151. package/server/services/users-permissions.js +3 -3
  152. package/server/utils/sanitize/sanitizers.js +5 -1
  153. package/server/utils/sanitize/visitors/remove-user-relation-from-role-entities.js +2 -2
  154. package/dist/_chunks/EditViewPage-1NY3YGcc-PZo-tzC4.mjs +0 -84382
  155. package/dist/_chunks/EditViewPage-1NY3YGcc-PZo-tzC4.mjs.map +0 -1
  156. package/dist/_chunks/EditViewPage-1NY3YGcc-l5uN1p3e.js +0 -84410
  157. package/dist/_chunks/EditViewPage-1NY3YGcc-l5uN1p3e.js.map +0 -1
  158. package/dist/_chunks/Helmet-En-SEnNC.mjs +0 -1008
  159. package/dist/_chunks/Helmet-En-SEnNC.mjs.map +0 -1
  160. package/dist/_chunks/Helmet-d9JljxUo.js +0 -1010
  161. package/dist/_chunks/Helmet-d9JljxUo.js.map +0 -1
  162. package/dist/_chunks/ListViewPage-rkQXnquk-LJPTb3bJ.mjs +0 -1571
  163. package/dist/_chunks/ListViewPage-rkQXnquk-LJPTb3bJ.mjs.map +0 -1
  164. package/dist/_chunks/ListViewPage-rkQXnquk-rBwGjRm0.js +0 -1595
  165. package/dist/_chunks/ListViewPage-rkQXnquk-rBwGjRm0.js.map +0 -1
  166. package/dist/_chunks/ReviewWorkflowsColumn-m0_IsejA-8zmlk45y.js +0 -33
  167. package/dist/_chunks/ReviewWorkflowsColumn-m0_IsejA-8zmlk45y.js.map +0 -1
  168. package/dist/_chunks/ReviewWorkflowsColumn-m0_IsejA-vbOQ9Ruh.mjs +0 -33
  169. package/dist/_chunks/ReviewWorkflowsColumn-m0_IsejA-vbOQ9Ruh.mjs.map +0 -1
  170. package/dist/_chunks/ar-MvD8Ghac.mjs.map +0 -1
  171. package/dist/_chunks/ar-t5qTFaAD.js.map +0 -1
  172. package/dist/_chunks/constants--j5MCV5y-TtrVffUD.js +0 -209
  173. package/dist/_chunks/constants--j5MCV5y-TtrVffUD.js.map +0 -1
  174. package/dist/_chunks/constants--j5MCV5y-h4BGe6Tp.mjs +0 -190
  175. package/dist/_chunks/constants--j5MCV5y-h4BGe6Tp.mjs.map +0 -1
  176. package/dist/_chunks/cs-BMuXwxA1.mjs.map +0 -1
  177. package/dist/_chunks/cs-I8N4u-Sd.js.map +0 -1
  178. package/dist/_chunks/de-YTjtq89K.js.map +0 -1
  179. package/dist/_chunks/de-zs2qqc0W.mjs.map +0 -1
  180. package/dist/_chunks/dk-HctVBMsG.mjs.map +0 -1
  181. package/dist/_chunks/dk-TF-dWjzl.js.map +0 -1
  182. package/dist/_chunks/en-TaNIVnDO.js.map +0 -1
  183. package/dist/_chunks/en-jvJ-d-Qq.mjs.map +0 -1
  184. package/dist/_chunks/es-9381tih_.mjs.map +0 -1
  185. package/dist/_chunks/es-XBQsB8_9.js.map +0 -1
  186. package/dist/_chunks/fr-6cz3U-IF.js.map +0 -1
  187. package/dist/_chunks/fr-CMSc77If.mjs.map +0 -1
  188. package/dist/_chunks/id-RJ934rq-.js.map +0 -1
  189. package/dist/_chunks/id-SDuyIkZa.mjs.map +0 -1
  190. package/dist/_chunks/index-AT8MwqgE.js.map +0 -1
  191. package/dist/_chunks/index-NzLAHRwx-MeSnW6w9.mjs +0 -16566
  192. package/dist/_chunks/index-NzLAHRwx-MeSnW6w9.mjs.map +0 -1
  193. package/dist/_chunks/index-NzLAHRwx-bcHTdv6V.js +0 -16591
  194. package/dist/_chunks/index-NzLAHRwx-bcHTdv6V.js.map +0 -1
  195. package/dist/_chunks/index-OPfJFEYD.mjs.map +0 -1
  196. package/dist/_chunks/index-Omcy-t4F.js.map +0 -1
  197. package/dist/_chunks/index-cC7LGLsK.mjs.map +0 -1
  198. package/dist/_chunks/index-deaP9rgn.js.map +0 -1
  199. package/dist/_chunks/index-eH8XAk_H.mjs.map +0 -1
  200. package/dist/_chunks/index-i1lZHF3N.mjs.map +0 -1
  201. package/dist/_chunks/index-nKbtq7R-.js.map +0 -1
  202. package/dist/_chunks/it-YhZOlM2X.js.map +0 -1
  203. package/dist/_chunks/it-bvH7DgQo.mjs.map +0 -1
  204. package/dist/_chunks/ja-o_-JPvQv.mjs.map +0 -1
  205. package/dist/_chunks/ja-xssHUXFv.js.map +0 -1
  206. package/dist/_chunks/ko-C3mHUSJa.js.map +0 -1
  207. package/dist/_chunks/ko-XJbPSez_.mjs.map +0 -1
  208. package/dist/_chunks/ms-II5Ea73J.mjs.map +0 -1
  209. package/dist/_chunks/ms-d0hfg65Z.js.map +0 -1
  210. package/dist/_chunks/nl-TA7TfK_5.js.map +0 -1
  211. package/dist/_chunks/nl-vEy6TN0K.mjs.map +0 -1
  212. package/dist/_chunks/pl-0pUL9hdA.js.map +0 -1
  213. package/dist/_chunks/pl-2VowaFGt.mjs.map +0 -1
  214. package/dist/_chunks/pt-BR-WNOhafR4.js.map +0 -1
  215. package/dist/_chunks/pt-BR-sS1Xp3Jt.mjs.map +0 -1
  216. package/dist/_chunks/pt-Rf9W51IO.mjs.map +0 -1
  217. package/dist/_chunks/pt-guNR9Gax.js.map +0 -1
  218. package/dist/_chunks/ru-X3BMXDds.js.map +0 -1
  219. package/dist/_chunks/ru-qKHnd5or.mjs.map +0 -1
  220. package/dist/_chunks/sk-NWPw1oTN.js.map +0 -1
  221. package/dist/_chunks/sk-_Ryr-eTT.mjs.map +0 -1
  222. package/dist/_chunks/sv-76NnbB__.js.map +0 -1
  223. package/dist/_chunks/sv-BqzScFXS.mjs.map +0 -1
  224. package/dist/_chunks/th-WsknMEpq.mjs.map +0 -1
  225. package/dist/_chunks/th-cbppX21D.js.map +0 -1
  226. package/dist/_chunks/tr-6mm_Fmz7.js.map +0 -1
  227. package/dist/_chunks/tr-_DB1F1GW.mjs.map +0 -1
  228. package/dist/_chunks/uk-sI2I1ogF.js.map +0 -1
  229. package/dist/_chunks/uk-yxMSQAwI.mjs.map +0 -1
  230. package/dist/_chunks/useSyncRbac-Od0wrAnD-fP3UP9Sk.mjs +0 -45
  231. package/dist/_chunks/useSyncRbac-Od0wrAnD-fP3UP9Sk.mjs.map +0 -1
  232. package/dist/_chunks/useSyncRbac-Od0wrAnD-mYMbQBry.js +0 -63
  233. package/dist/_chunks/useSyncRbac-Od0wrAnD-mYMbQBry.js.map +0 -1
  234. package/dist/_chunks/vi-A3zJxaiI.js.map +0 -1
  235. package/dist/_chunks/vi-xY0zCW3d.mjs.map +0 -1
  236. package/dist/_chunks/zh-72SpmFXa.js.map +0 -1
  237. package/dist/_chunks/zh-Hans-ArWWtyP4.js.map +0 -1
  238. package/dist/_chunks/zh-Hans-E84cu4kP.mjs.map +0 -1
  239. package/dist/_chunks/zh-OFeldzbX.mjs.map +0 -1
  240. package/dist/style.css +0 -84
@@ -1,15 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import {
4
- Button,
5
- Grid,
6
- GridItem,
7
- ModalBody,
8
- ModalFooter,
9
- ModalHeader,
10
- ModalLayout,
11
- } from '@strapi/design-system';
12
- import { Breadcrumbs, Crumb } from '@strapi/design-system/v2';
3
+ import { Button, Grid, Modal, Breadcrumbs, Crumb, VisuallyHidden } from '@strapi/design-system';
13
4
  import { Form, InputRenderer } from '@strapi/strapi/admin';
14
5
  import PropTypes from 'prop-types';
15
6
  import { useIntl } from 'react-intl';
@@ -17,117 +8,127 @@ import { useIntl } from 'react-intl';
17
8
  import { getTrad } from '../../../utils';
18
9
  import schema from '../utils/schema';
19
10
 
20
- const EmailForm = ({ template, onToggle, onSubmit }) => {
11
+ const EmailForm = ({ template = {}, onToggle, open, onSubmit }) => {
21
12
  const { formatMessage } = useIntl();
22
13
 
23
14
  return (
24
- <ModalLayout
25
- onClose={onToggle}
26
- labelledBy={`${formatMessage({
27
- id: getTrad('PopUpForm.header.edit.email-templates'),
28
- defaultMessage: 'Edit email template',
29
- })}, ${formatMessage({ id: getTrad(template.display), defaultMessage: template.display })}`}
30
- >
31
- <ModalHeader>
32
- <Breadcrumbs
33
- label={`${formatMessage({
34
- id: getTrad('PopUpForm.header.edit.email-templates'),
35
- defaultMessage: 'Edit email template',
36
- })}, ${formatMessage({
37
- id: getTrad(template.display),
38
- defaultMessage: template.display,
39
- })}`}
40
- >
41
- <Crumb>
42
- {formatMessage({
15
+ <Modal.Root open={open} onOpenChange={onToggle}>
16
+ <Modal.Content>
17
+ <Modal.Header>
18
+ <Breadcrumbs
19
+ label={`${formatMessage({
43
20
  id: getTrad('PopUpForm.header.edit.email-templates'),
44
21
  defaultMessage: 'Edit email template',
45
- })}
46
- </Crumb>
47
- <Crumb isCurrent>
48
- {formatMessage({ id: getTrad(template.display), defaultMessage: template.display })}
49
- </Crumb>
50
- </Breadcrumbs>
51
- </ModalHeader>
52
- <Form onSubmit={onSubmit} initialValues={template} validationSchema={schema}>
53
- {({ isSubmitting }) => {
54
- return (
55
- <>
56
- <ModalBody>
57
- <Grid gap={5}>
58
- {[
59
- {
60
- label: formatMessage({
61
- id: getTrad('PopUpForm.Email.options.from.name.label'),
62
- defaultMessage: 'Shipper name',
63
- }),
64
- name: 'options.from.name',
65
- size: 6,
66
- type: 'string',
67
- },
68
- {
69
- label: formatMessage({
70
- id: getTrad('PopUpForm.Email.options.from.email.label'),
71
- defaultMessage: 'Shipper email',
72
- }),
73
- name: 'options.from.email',
74
- size: 6,
75
- type: 'string',
76
- },
77
- {
78
- label: formatMessage({
79
- id: getTrad('PopUpForm.Email.options.response_email.label'),
80
- defaultMessage: 'Response email',
81
- }),
82
- name: 'options.response_email',
83
- size: 6,
84
- type: 'string',
85
- },
86
- {
87
- label: formatMessage({
88
- id: getTrad('PopUpForm.Email.options.object.label'),
89
- defaultMessage: 'Subject',
90
- }),
91
- name: 'options.object',
92
- size: 6,
93
- type: 'string',
94
- },
95
- {
96
- label: formatMessage({
97
- id: getTrad('PopUpForm.Email.options.message.label'),
98
- defaultMessage: 'Message',
99
- }),
100
- name: 'options.message',
101
- size: 12,
102
- type: 'text',
103
- },
104
- ].map(({ size, ...field }) => (
105
- <GridItem key={field.name} col={size}>
106
- <InputRenderer {...field} />
107
- </GridItem>
108
- ))}
109
- </Grid>
110
- </ModalBody>
111
- <ModalFooter
112
- startActions={
113
- <Button onClick={onToggle} variant="tertiary">
114
- Cancel
115
- </Button>
116
- }
117
- endActions={
22
+ })}, ${
23
+ template.display
24
+ ? formatMessage({
25
+ id: getTrad(template.display),
26
+ defaultMessage: template.display,
27
+ })
28
+ : ''
29
+ }`}
30
+ >
31
+ <Crumb>
32
+ {formatMessage({
33
+ id: getTrad('PopUpForm.header.edit.email-templates'),
34
+ defaultMessage: 'Edit email template',
35
+ })}
36
+ </Crumb>
37
+ <Crumb isCurrent>
38
+ {template.display
39
+ ? formatMessage({ id: getTrad(template.display), defaultMessage: template.display })
40
+ : ''}
41
+ </Crumb>
42
+ </Breadcrumbs>
43
+ <VisuallyHidden>
44
+ <Modal.Title>
45
+ {`${formatMessage({
46
+ id: getTrad('PopUpForm.header.edit.email-templates'),
47
+ defaultMessage: 'Edit email template',
48
+ })}, ${template.display ? formatMessage({ id: getTrad(template.display), defaultMessage: template.display }) : ''}`}
49
+ </Modal.Title>
50
+ </VisuallyHidden>
51
+ </Modal.Header>
52
+ <Form onSubmit={onSubmit} initialValues={template} validationSchema={schema}>
53
+ {({ isSubmitting }) => {
54
+ return (
55
+ <>
56
+ <Modal.Body>
57
+ <Grid.Root gap={5}>
58
+ {[
59
+ {
60
+ label: formatMessage({
61
+ id: getTrad('PopUpForm.Email.options.from.name.label'),
62
+ defaultMessage: 'Shipper name',
63
+ }),
64
+ name: 'options.from.name',
65
+ size: 6,
66
+ type: 'string',
67
+ },
68
+ {
69
+ label: formatMessage({
70
+ id: getTrad('PopUpForm.Email.options.from.email.label'),
71
+ defaultMessage: 'Shipper email',
72
+ }),
73
+ name: 'options.from.email',
74
+ size: 6,
75
+ type: 'string',
76
+ },
77
+ {
78
+ label: formatMessage({
79
+ id: getTrad('PopUpForm.Email.options.response_email.label'),
80
+ defaultMessage: 'Response email',
81
+ }),
82
+ name: 'options.response_email',
83
+ size: 6,
84
+ type: 'string',
85
+ },
86
+ {
87
+ label: formatMessage({
88
+ id: getTrad('PopUpForm.Email.options.object.label'),
89
+ defaultMessage: 'Subject',
90
+ }),
91
+ name: 'options.object',
92
+ size: 6,
93
+ type: 'string',
94
+ },
95
+ {
96
+ label: formatMessage({
97
+ id: getTrad('PopUpForm.Email.options.message.label'),
98
+ defaultMessage: 'Message',
99
+ }),
100
+ name: 'options.message',
101
+ size: 12,
102
+ type: 'text',
103
+ },
104
+ ].map(({ size, ...field }) => (
105
+ <Grid.Item key={field.name} col={size}>
106
+ <InputRenderer {...field} />
107
+ </Grid.Item>
108
+ ))}
109
+ </Grid.Root>
110
+ </Modal.Body>
111
+ <Modal.Footer>
112
+ <Modal.Close>
113
+ <Button variant="tertiary">Cancel</Button>
114
+ </Modal.Close>
118
115
  <Button loading={isSubmitting} type="submit">
119
116
  Finish
120
117
  </Button>
121
- }
122
- />
123
- </>
124
- );
125
- }}
126
- </Form>
127
- </ModalLayout>
118
+ </Modal.Footer>
119
+ </>
120
+ );
121
+ }}
122
+ </Form>
123
+ </Modal.Content>
124
+ </Modal.Root>
128
125
  );
129
126
  };
130
127
 
128
+ EmailForm.defaultProps = {
129
+ template: {},
130
+ };
131
+
131
132
  EmailForm.propTypes = {
132
133
  template: PropTypes.shape({
133
134
  display: PropTypes.string,
@@ -141,7 +142,8 @@ EmailForm.propTypes = {
141
142
  object: PropTypes.string,
142
143
  response_email: PropTypes.string,
143
144
  }),
144
- }).isRequired,
145
+ }),
146
+ open: PropTypes.bool.isRequired,
145
147
  onSubmit: PropTypes.func.isRequired,
146
148
  onToggle: PropTypes.func.isRequired,
147
149
  };
@@ -1,7 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {
4
- Icon,
5
4
  IconButton,
6
5
  Table,
7
6
  Tbody,
@@ -12,7 +11,7 @@ import {
12
11
  Typography,
13
12
  VisuallyHidden,
14
13
  } from '@strapi/design-system';
15
- import { Check, Pencil, Refresh } from '@strapi/icons';
14
+ import { Check, Pencil, ArrowClockwise as Refresh } from '@strapi/icons';
16
15
  import PropTypes from 'prop-types';
17
16
  import { useIntl } from 'react-intl';
18
17
 
@@ -54,14 +53,12 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
54
53
  <Tbody>
55
54
  <Tr onClick={() => onEditClick('reset_password')}>
56
55
  <Td>
57
- <Icon>
58
- <Refresh
59
- aria-label={formatMessage({
60
- id: 'global.reset-password',
61
- defaultMessage: 'Reset password',
62
- })}
63
- />
64
- </Icon>
56
+ <Refresh
57
+ aria-label={formatMessage({
58
+ id: 'global.reset-password',
59
+ defaultMessage: 'Reset password',
60
+ })}
61
+ />
65
62
  </Td>
66
63
  <Td>
67
64
  <Typography>
@@ -78,21 +75,21 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
78
75
  id: getTrad('Email.template.form.edit.label'),
79
76
  defaultMessage: 'Edit a template',
80
77
  })}
81
- noBorder
82
- icon={canUpdate && <Pencil />}
83
- />
78
+ borderWidth={0}
79
+ disabled={!canUpdate}
80
+ >
81
+ <Pencil />
82
+ </IconButton>
84
83
  </Td>
85
84
  </Tr>
86
85
  <Tr onClick={() => onEditClick('email_confirmation')}>
87
86
  <Td>
88
- <Icon>
89
- <Check
90
- aria-label={formatMessage({
91
- id: getTrad('Email.template.email_confirmation'),
92
- defaultMessage: 'Email address confirmation',
93
- })}
94
- />
95
- </Icon>
87
+ <Check
88
+ aria-label={formatMessage({
89
+ id: getTrad('Email.template.email_confirmation'),
90
+ defaultMessage: 'Email address confirmation',
91
+ })}
92
+ />
96
93
  </Td>
97
94
  <Td>
98
95
  <Typography>
@@ -109,9 +106,11 @@ const EmailTable = ({ canUpdate, onEditClick }) => {
109
106
  id: getTrad('Email.template.form.edit.label'),
110
107
  defaultMessage: 'Edit a template',
111
108
  })}
112
- noBorder
113
- icon={canUpdate && <Pencil />}
114
- />
109
+ borderWidth={0}
110
+ disabled={!canUpdate}
111
+ >
112
+ <Pencil />
113
+ </IconButton>
115
114
  </Td>
116
115
  </Tr>
117
116
  </Tbody>
@@ -1,15 +1,15 @@
1
1
  import * as React from 'react';
2
2
 
3
3
  import { useTracking } from '@strapi/admin/strapi-admin';
4
- import { ContentLayout, HeaderLayout, useNotifyAT } from '@strapi/design-system';
4
+ import { useNotifyAT } from '@strapi/design-system';
5
5
  import {
6
6
  Page,
7
7
  useAPIErrorHandler,
8
8
  useNotification,
9
9
  useFetchClient,
10
10
  useRBAC,
11
+ Layouts,
11
12
  } from '@strapi/strapi/admin';
12
- import { Helmet } from 'react-helmet';
13
13
  import { useIntl } from 'react-intl';
14
14
  import { useMutation, useQuery, useQueryClient } from 'react-query';
15
15
 
@@ -115,8 +115,8 @@ const EmailTemplatesPage = () => {
115
115
 
116
116
  return (
117
117
  <Page.Main aria-busy={submitMutation.isLoading}>
118
- <Helmet
119
- title={formatMessage(
118
+ <Page.Title>
119
+ {formatMessage(
120
120
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
121
121
  {
122
122
  name: formatMessage({
@@ -125,23 +125,22 @@ const EmailTemplatesPage = () => {
125
125
  }),
126
126
  }
127
127
  )}
128
- />
129
- <HeaderLayout
128
+ </Page.Title>
129
+ <Layouts.Header
130
130
  title={formatMessage({
131
131
  id: getTrad('HeaderNav.link.emailTemplates'),
132
132
  defaultMessage: 'Email templates',
133
133
  })}
134
134
  />
135
- <ContentLayout>
135
+ <Layouts.Content>
136
136
  <EmailTable onEditClick={handleEditClick} canUpdate={canUpdate} />
137
- {isModalOpen && (
138
- <EmailForm
139
- template={data[templateToEdit]}
140
- onToggle={handleToggle}
141
- onSubmit={handleSubmit}
142
- />
143
- )}
144
- </ContentLayout>
137
+ <EmailForm
138
+ template={data[templateToEdit]}
139
+ onToggle={handleToggle}
140
+ open={isModalOpen}
141
+ onSubmit={handleSubmit}
142
+ />
143
+ </Layouts.Content>
145
144
  </Page.Main>
146
145
  );
147
146
  };
@@ -1,11 +1,8 @@
1
1
  import * as React from 'react';
2
2
 
3
- import { useTracking } from '@strapi/admin/strapi-admin';
3
+ import { useTracking, Layouts } from '@strapi/admin/strapi-admin';
4
4
  import {
5
- ContentLayout,
6
- HeaderLayout,
7
5
  IconButton,
8
- Layout,
9
6
  Table,
10
7
  Tbody,
11
8
  Td,
@@ -25,7 +22,6 @@ import {
25
22
  useRBAC,
26
23
  } from '@strapi/strapi/admin';
27
24
  import upperFirst from 'lodash/upperFirst';
28
- import { Helmet } from 'react-helmet';
29
25
  import { useIntl } from 'react-intl';
30
26
  import { useMutation, useQuery, useQueryClient } from 'react-query';
31
27
 
@@ -148,9 +144,9 @@ export const ProvidersPage = () => {
148
144
  }
149
145
 
150
146
  return (
151
- <Layout>
152
- <Helmet
153
- title={formatMessage(
147
+ <Layouts.Root>
148
+ <Page.Title>
149
+ {formatMessage(
154
150
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
155
151
  {
156
152
  name: formatMessage({
@@ -159,15 +155,15 @@ export const ProvidersPage = () => {
159
155
  }),
160
156
  }
161
157
  )}
162
- />
158
+ </Page.Title>
163
159
  <Page.Main>
164
- <HeaderLayout
160
+ <Layouts.Header
165
161
  title={formatMessage({
166
162
  id: getTrad('HeaderNav.link.providers'),
167
163
  defaultMessage: 'Providers',
168
164
  })}
169
165
  />
170
- <ContentLayout>
166
+ <Layouts.Content>
171
167
  <Table colCount={3} rowCount={providers.length + 1}>
172
168
  <Thead>
173
169
  <Tr>
@@ -224,17 +220,18 @@ export const ProvidersPage = () => {
224
220
  {canUpdate && (
225
221
  <IconButton
226
222
  onClick={() => handleClickEdit(provider)}
227
- noBorder
228
- icon={<Pencil />}
223
+ borderWidth={0}
229
224
  label="Edit"
230
- />
225
+ >
226
+ <Pencil />
227
+ </IconButton>
231
228
  )}
232
229
  </Td>
233
230
  </Tr>
234
231
  ))}
235
232
  </Tbody>
236
233
  </Table>
237
- </ContentLayout>
234
+ </Layouts.Content>
238
235
  </Page.Main>
239
236
  <FormModal
240
237
  initialData={data[providerToEditName]}
@@ -252,7 +249,7 @@ export const ProvidersPage = () => {
252
249
  onSubmit={handleSubmit}
253
250
  providerToEditName={providerToEditName}
254
251
  />
255
- </Layout>
252
+ </Layouts.Root>
256
253
  );
257
254
  };
258
255
 
@@ -2,20 +2,17 @@ import * as React from 'react';
2
2
 
3
3
  import {
4
4
  Button,
5
- ContentLayout,
6
5
  Flex,
7
6
  Grid,
8
- GridItem,
9
- HeaderLayout,
10
7
  Main,
11
8
  Textarea,
12
9
  TextInput,
13
10
  Typography,
11
+ Field,
14
12
  } from '@strapi/design-system';
15
13
  import { Check } from '@strapi/icons';
16
- import { Page, useTracking, useNotification, useFetchClient } from '@strapi/strapi/admin';
14
+ import { Page, useTracking, useNotification, useFetchClient, Layouts } from '@strapi/strapi/admin';
17
15
  import { Formik, Form } from 'formik';
18
- import { Helmet } from 'react-helmet';
19
16
  import { useIntl } from 'react-intl';
20
17
  import { useMutation } from 'react-query';
21
18
  import { useNavigate } from 'react-router-dom';
@@ -72,12 +69,12 @@ export const CreatePage = () => {
72
69
 
73
70
  return (
74
71
  <Main>
75
- <Helmet
76
- title={formatMessage(
72
+ <Page.Title>
73
+ {formatMessage(
77
74
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
78
75
  { name: 'Roles' }
79
76
  )}
80
- />
77
+ </Page.Title>
81
78
  <Formik
82
79
  enableReinitialize
83
80
  initialValues={{ name: '', description: '' }}
@@ -86,7 +83,7 @@ export const CreatePage = () => {
86
83
  >
87
84
  {({ handleSubmit, values, handleChange, errors }) => (
88
85
  <Form noValidate onSubmit={handleSubmit}>
89
- <HeaderLayout
86
+ <Layouts.Header
90
87
  primaryAction={
91
88
  !isLoadingPlugins && (
92
89
  <Button type="submit" loading={mutation.isLoading} startIcon={<Check />}>
@@ -106,7 +103,7 @@ export const CreatePage = () => {
106
103
  defaultMessage: 'Define the rights given to the role',
107
104
  })}
108
105
  />
109
- <ContentLayout>
106
+ <Layouts.Content>
110
107
  <Flex
111
108
  background="neutral0"
112
109
  direction="column"
@@ -120,40 +117,37 @@ export const CreatePage = () => {
120
117
  shadow="filterShadow"
121
118
  >
122
119
  <Flex direction="column" alignItems="stretch">
123
- <Typography variant="delta" as="h2">
120
+ <Typography variant="delta" tag="h2">
124
121
  {formatMessage({
125
122
  id: getTrad('EditPage.form.roles'),
126
123
  defaultMessage: 'Role details',
127
124
  })}
128
125
  </Typography>
129
126
 
130
- <Grid gap={4}>
131
- <GridItem col={6}>
132
- <TextInput
127
+ <Grid.Root gap={4}>
128
+ <Grid.Item col={6}>
129
+ <Field.Root
133
130
  name="name"
134
- value={values.name || ''}
135
- onChange={handleChange}
136
- label={formatMessage({
137
- id: 'global.name',
138
- defaultMessage: 'Name',
139
- })}
140
131
  error={
141
132
  errors?.name
142
133
  ? formatMessage({ id: errors.name, defaultMessage: 'Name is required' })
143
134
  : false
144
135
  }
145
136
  required
146
- />
147
- </GridItem>
148
- <GridItem col={6}>
149
- <Textarea
150
- id="description"
151
- value={values.description || ''}
152
- onChange={handleChange}
153
- label={formatMessage({
154
- id: 'global.description',
155
- defaultMessage: 'Description',
156
- })}
137
+ >
138
+ <Field.Label>
139
+ {formatMessage({
140
+ id: 'global.name',
141
+ defaultMessage: 'Name',
142
+ })}
143
+ </Field.Label>
144
+ <TextInput value={values.name || ''} onChange={handleChange} />
145
+ <Field.Error />
146
+ </Field.Root>
147
+ </Grid.Item>
148
+ <Grid.Item col={6}>
149
+ <Field.Root
150
+ name="description"
157
151
  error={
158
152
  errors?.description
159
153
  ? formatMessage({
@@ -163,9 +157,18 @@ export const CreatePage = () => {
163
157
  : false
164
158
  }
165
159
  required
166
- />
167
- </GridItem>
168
- </Grid>
160
+ >
161
+ <Field.Label>
162
+ {formatMessage({
163
+ id: 'global.description',
164
+ defaultMessage: 'Description',
165
+ })}
166
+ </Field.Label>
167
+ <Textarea value={values.description || ''} onChange={handleChange} />
168
+ <Field.Error />
169
+ </Field.Root>
170
+ </Grid.Item>
171
+ </Grid.Root>
169
172
  </Flex>
170
173
 
171
174
  {!isLoadingPlugins && (
@@ -176,7 +179,7 @@ export const CreatePage = () => {
176
179
  />
177
180
  )}
178
181
  </Flex>
179
- </ContentLayout>
182
+ </Layouts.Content>
180
183
  </Form>
181
184
  )}
182
185
  </Formik>