@strapi/plugin-users-permissions 5.0.0-beta.1 → 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 (238) 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-UxzhJuP2.js → index-Bmp8oEaL.js} +66 -78
  51. package/dist/_chunks/index-Bmp8oEaL.js.map +1 -0
  52. package/dist/_chunks/{index-PTS42_em.mjs → index-BoMRcQMw.mjs} +21 -21
  53. package/dist/_chunks/{index-PTS42_em.mjs.map → index-BoMRcQMw.mjs.map} +1 -1
  54. package/dist/_chunks/{index-oUZpvYqS.mjs → index-C3uAp27O.mjs} +113 -120
  55. package/dist/_chunks/index-C3uAp27O.mjs.map +1 -0
  56. package/dist/_chunks/{index-DtWla9tx.mjs → index-CgwV7-UQ.mjs} +16 -22
  57. package/dist/_chunks/index-CgwV7-UQ.mjs.map +1 -0
  58. package/dist/_chunks/{index-_UNneVIg.js → index-Ck-grCz9.js} +129 -162
  59. package/dist/_chunks/index-Ck-grCz9.js.map +1 -0
  60. package/dist/_chunks/{index-gw-9XoIT.js → index-CkV_Gx1w.js} +112 -119
  61. package/dist/_chunks/index-CkV_Gx1w.js.map +1 -0
  62. package/dist/_chunks/{index-46oU0LRy.js → index-CqRSlrYn.js} +16 -22
  63. package/dist/_chunks/index-CqRSlrYn.js.map +1 -0
  64. package/dist/_chunks/{index-JO4fO3Yj.js → index-D9CJMgdl.js} +21 -21
  65. package/dist/_chunks/{index-JO4fO3Yj.js.map → index-D9CJMgdl.js.map} +1 -1
  66. package/dist/_chunks/{index-G9pZniMC.mjs → index-DNNjHtHG.mjs} +66 -78
  67. package/dist/_chunks/index-DNNjHtHG.mjs.map +1 -0
  68. package/dist/_chunks/{index-Vg50EMBp.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 +16 -16
  145. package/server/bootstrap/index.js +3 -3
  146. package/server/config.js +29 -0
  147. package/server/controllers/auth.js +22 -4
  148. package/server/controllers/content-manager-user.js +4 -2
  149. package/server/services/user.js +21 -4
  150. package/server/services/users-permissions.js +3 -3
  151. package/server/utils/sanitize/visitors/remove-user-relation-from-role-entities.js +2 -2
  152. package/dist/_chunks/EditViewPage-BJdNfzBZ-XIkFGBc4.mjs +0 -84380
  153. package/dist/_chunks/EditViewPage-BJdNfzBZ-XIkFGBc4.mjs.map +0 -1
  154. package/dist/_chunks/EditViewPage-BJdNfzBZ-eKwHxgPQ.js +0 -84408
  155. package/dist/_chunks/EditViewPage-BJdNfzBZ-eKwHxgPQ.js.map +0 -1
  156. package/dist/_chunks/Helmet-En-SEnNC.mjs +0 -1008
  157. package/dist/_chunks/Helmet-En-SEnNC.mjs.map +0 -1
  158. package/dist/_chunks/Helmet-d9JljxUo.js +0 -1010
  159. package/dist/_chunks/Helmet-d9JljxUo.js.map +0 -1
  160. package/dist/_chunks/ListViewPage-FE12IpwT-Wq63ge4-.js +0 -1595
  161. package/dist/_chunks/ListViewPage-FE12IpwT-Wq63ge4-.js.map +0 -1
  162. package/dist/_chunks/ListViewPage-FE12IpwT-qmEuoG2g.mjs +0 -1571
  163. package/dist/_chunks/ListViewPage-FE12IpwT-qmEuoG2g.mjs.map +0 -1
  164. package/dist/_chunks/ReviewWorkflowsColumn-NUu47oVz-8gQO_Y5x.mjs +0 -33
  165. package/dist/_chunks/ReviewWorkflowsColumn-NUu47oVz-8gQO_Y5x.mjs.map +0 -1
  166. package/dist/_chunks/ReviewWorkflowsColumn-NUu47oVz-ARD7iQQF.js +0 -33
  167. package/dist/_chunks/ReviewWorkflowsColumn-NUu47oVz-ARD7iQQF.js.map +0 -1
  168. package/dist/_chunks/ar-MvD8Ghac.mjs.map +0 -1
  169. package/dist/_chunks/ar-t5qTFaAD.js.map +0 -1
  170. package/dist/_chunks/constants-D6NLEhwu-4IL8biHd.js +0 -209
  171. package/dist/_chunks/constants-D6NLEhwu-4IL8biHd.js.map +0 -1
  172. package/dist/_chunks/constants-D6NLEhwu-gRKBHArd.mjs +0 -190
  173. package/dist/_chunks/constants-D6NLEhwu-gRKBHArd.mjs.map +0 -1
  174. package/dist/_chunks/cs-BMuXwxA1.mjs.map +0 -1
  175. package/dist/_chunks/cs-I8N4u-Sd.js.map +0 -1
  176. package/dist/_chunks/de-YTjtq89K.js.map +0 -1
  177. package/dist/_chunks/de-zs2qqc0W.mjs.map +0 -1
  178. package/dist/_chunks/dk-HctVBMsG.mjs.map +0 -1
  179. package/dist/_chunks/dk-TF-dWjzl.js.map +0 -1
  180. package/dist/_chunks/en-TaNIVnDO.js.map +0 -1
  181. package/dist/_chunks/en-jvJ-d-Qq.mjs.map +0 -1
  182. package/dist/_chunks/es-9381tih_.mjs.map +0 -1
  183. package/dist/_chunks/es-XBQsB8_9.js.map +0 -1
  184. package/dist/_chunks/fr-6cz3U-IF.js.map +0 -1
  185. package/dist/_chunks/fr-CMSc77If.mjs.map +0 -1
  186. package/dist/_chunks/id-RJ934rq-.js.map +0 -1
  187. package/dist/_chunks/id-SDuyIkZa.mjs.map +0 -1
  188. package/dist/_chunks/index-1NFAbkxM-Km1zKLTh.mjs +0 -16568
  189. package/dist/_chunks/index-1NFAbkxM-Km1zKLTh.mjs.map +0 -1
  190. package/dist/_chunks/index-1NFAbkxM-c8HdvwSA.js +0 -16593
  191. package/dist/_chunks/index-1NFAbkxM-c8HdvwSA.js.map +0 -1
  192. package/dist/_chunks/index-46oU0LRy.js.map +0 -1
  193. package/dist/_chunks/index-DtWla9tx.mjs.map +0 -1
  194. package/dist/_chunks/index-G9pZniMC.mjs.map +0 -1
  195. package/dist/_chunks/index-UxzhJuP2.js.map +0 -1
  196. package/dist/_chunks/index-Vg50EMBp.mjs.map +0 -1
  197. package/dist/_chunks/index-_UNneVIg.js.map +0 -1
  198. package/dist/_chunks/index-gw-9XoIT.js.map +0 -1
  199. package/dist/_chunks/index-oUZpvYqS.mjs.map +0 -1
  200. package/dist/_chunks/it-YhZOlM2X.js.map +0 -1
  201. package/dist/_chunks/it-bvH7DgQo.mjs.map +0 -1
  202. package/dist/_chunks/ja-o_-JPvQv.mjs.map +0 -1
  203. package/dist/_chunks/ja-xssHUXFv.js.map +0 -1
  204. package/dist/_chunks/ko-C3mHUSJa.js.map +0 -1
  205. package/dist/_chunks/ko-XJbPSez_.mjs.map +0 -1
  206. package/dist/_chunks/ms-II5Ea73J.mjs.map +0 -1
  207. package/dist/_chunks/ms-d0hfg65Z.js.map +0 -1
  208. package/dist/_chunks/nl-TA7TfK_5.js.map +0 -1
  209. package/dist/_chunks/nl-vEy6TN0K.mjs.map +0 -1
  210. package/dist/_chunks/pl-0pUL9hdA.js.map +0 -1
  211. package/dist/_chunks/pl-2VowaFGt.mjs.map +0 -1
  212. package/dist/_chunks/pt-BR-WNOhafR4.js.map +0 -1
  213. package/dist/_chunks/pt-BR-sS1Xp3Jt.mjs.map +0 -1
  214. package/dist/_chunks/pt-Rf9W51IO.mjs.map +0 -1
  215. package/dist/_chunks/pt-guNR9Gax.js.map +0 -1
  216. package/dist/_chunks/ru-X3BMXDds.js.map +0 -1
  217. package/dist/_chunks/ru-qKHnd5or.mjs.map +0 -1
  218. package/dist/_chunks/sk-NWPw1oTN.js.map +0 -1
  219. package/dist/_chunks/sk-_Ryr-eTT.mjs.map +0 -1
  220. package/dist/_chunks/sv-76NnbB__.js.map +0 -1
  221. package/dist/_chunks/sv-BqzScFXS.mjs.map +0 -1
  222. package/dist/_chunks/th-WsknMEpq.mjs.map +0 -1
  223. package/dist/_chunks/th-cbppX21D.js.map +0 -1
  224. package/dist/_chunks/tr-6mm_Fmz7.js.map +0 -1
  225. package/dist/_chunks/tr-_DB1F1GW.mjs.map +0 -1
  226. package/dist/_chunks/uk-sI2I1ogF.js.map +0 -1
  227. package/dist/_chunks/uk-yxMSQAwI.mjs.map +0 -1
  228. package/dist/_chunks/useSyncRbac-LNOzRXJ5-5S0qhFuZ.js +0 -63
  229. package/dist/_chunks/useSyncRbac-LNOzRXJ5-5S0qhFuZ.js.map +0 -1
  230. package/dist/_chunks/useSyncRbac-LNOzRXJ5-PZzFwA1X.mjs +0 -45
  231. package/dist/_chunks/useSyncRbac-LNOzRXJ5-PZzFwA1X.mjs.map +0 -1
  232. package/dist/_chunks/vi-A3zJxaiI.js.map +0 -1
  233. package/dist/_chunks/vi-xY0zCW3d.mjs.map +0 -1
  234. package/dist/_chunks/zh-72SpmFXa.js.map +0 -1
  235. package/dist/_chunks/zh-Hans-ArWWtyP4.js.map +0 -1
  236. package/dist/_chunks/zh-Hans-E84cu4kP.mjs.map +0 -1
  237. package/dist/_chunks/zh-OFeldzbX.mjs.map +0 -1
  238. package/dist/style.css +0 -84
@@ -5,7 +5,7 @@ import map from 'lodash/map';
5
5
  import tail from 'lodash/tail';
6
6
  import PropTypes from 'prop-types';
7
7
  import { useIntl } from 'react-intl';
8
- import styled from 'styled-components';
8
+ import { styled } from 'styled-components';
9
9
 
10
10
  import getMethodColor from './getMethodColor';
11
11
 
@@ -24,7 +24,7 @@ function BoundRoute({ route }) {
24
24
 
25
25
  return (
26
26
  <Flex direction="column" alignItems="stretch" gap={2}>
27
- <Typography variant="delta" as="h3">
27
+ <Typography variant="delta" tag="h3">
28
28
  {formatMessage({
29
29
  id: 'users-permissions.BoundRoute.title',
30
30
  defaultMessage: 'Bound route to',
@@ -6,7 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
 
9
- import { TextInput, ToggleInput } from '@strapi/design-system';
9
+ import { TextInput, Toggle, Field } from '@strapi/design-system';
10
10
  import PropTypes from 'prop-types';
11
11
  import { useIntl } from 'react-intl';
12
12
 
@@ -41,25 +41,26 @@ const Input = ({
41
41
 
42
42
  if (type === 'bool') {
43
43
  return (
44
- <ToggleInput
45
- aria-label={name}
46
- checked={value}
47
- disabled={disabled}
48
- hint={hint}
49
- label={label}
50
- name={name}
51
- offLabel={formatMessage({
52
- id: 'app.components.ToggleCheckbox.off-label',
53
- defaultMessage: 'Off',
54
- })}
55
- onLabel={formatMessage({
56
- id: 'app.components.ToggleCheckbox.on-label',
57
- defaultMessage: 'On',
58
- })}
59
- onChange={(e) => {
60
- onChange({ target: { name, value: e.target.checked } });
61
- }}
62
- />
44
+ <Field.Root hint={hint} name={name}>
45
+ <Field.Label>{label}</Field.Label>
46
+ <Toggle
47
+ aria-label={name}
48
+ checked={value}
49
+ disabled={disabled}
50
+ offLabel={formatMessage({
51
+ id: 'app.components.ToggleCheckbox.off-label',
52
+ defaultMessage: 'Off',
53
+ })}
54
+ onLabel={formatMessage({
55
+ id: 'app.components.ToggleCheckbox.on-label',
56
+ defaultMessage: 'On',
57
+ })}
58
+ onChange={(e) => {
59
+ onChange({ target: { name, value: e.target.checked } });
60
+ }}
61
+ />
62
+ <Field.Hint />
63
+ </Field.Root>
63
64
  );
64
65
  }
65
66
 
@@ -73,17 +74,17 @@ const Input = ({
73
74
  const errorMessage = error ? formatMessage({ id: error, defaultMessage: error }) : '';
74
75
 
75
76
  return (
76
- <TextInput
77
- aria-label={name}
78
- disabled={disabled}
79
- error={errorMessage}
80
- label={label}
81
- name={name}
82
- onChange={onChange}
83
- placeholder={formattedPlaceholder}
84
- type={type}
85
- value={inputValue}
86
- />
77
+ <Field.Root error={errorMessage} name={name}>
78
+ <Field.Label>{label}</Field.Label>
79
+ <TextInput
80
+ disabled={disabled}
81
+ onChange={onChange}
82
+ placeholder={formattedPlaceholder}
83
+ type={type}
84
+ value={inputValue}
85
+ />
86
+ <Field.Error />
87
+ </Field.Root>
87
88
  );
88
89
  };
89
90
 
@@ -6,17 +6,7 @@
6
6
 
7
7
  import React from 'react';
8
8
 
9
- import {
10
- Button,
11
- Flex,
12
- Grid,
13
- GridItem,
14
- ModalBody,
15
- ModalFooter,
16
- ModalHeader,
17
- ModalLayout,
18
- } from '@strapi/design-system';
19
- import { Breadcrumbs, Crumb } from '@strapi/design-system/v2';
9
+ import { Button, Flex, Grid, Modal, Breadcrumbs, Crumb } from '@strapi/design-system';
20
10
  import { Form, Formik } from 'formik';
21
11
  import PropTypes from 'prop-types';
22
12
  import { useIntl } from 'react-intl';
@@ -35,71 +25,65 @@ const FormModal = ({
35
25
  }) => {
36
26
  const { formatMessage } = useIntl();
37
27
 
38
- if (!isOpen) {
39
- return null;
40
- }
41
-
42
28
  return (
43
- <ModalLayout onClose={onToggle} labelledBy="title">
44
- <ModalHeader>
45
- <Breadcrumbs label={headerBreadcrumbs.join(', ')}>
46
- {headerBreadcrumbs.map((crumb, index, arr) => (
47
- <Crumb isCurrent={index === arr.length - 1} key={crumb}>
48
- {crumb}
49
- </Crumb>
50
- ))}
51
- </Breadcrumbs>
52
- </ModalHeader>
53
- <Formik
54
- onSubmit={(values) => onSubmit(values)}
55
- initialValues={initialData}
56
- validationSchema={layout.schema}
57
- validateOnChange={false}
58
- >
59
- {({ errors, handleChange, values }) => {
60
- return (
61
- <Form>
62
- <ModalBody>
63
- <Flex direction="column" alignItems="stretch" gap={1}>
64
- <Grid gap={5}>
65
- {layout.form.map((row) => {
66
- return row.map((input) => {
67
- return (
68
- <GridItem key={input.name} col={input.size} xs={12}>
69
- <Input
70
- {...input}
71
- error={errors[input.name]}
72
- onChange={handleChange}
73
- value={values[input.name]}
74
- providerToEditName={providerToEditName}
75
- />
76
- </GridItem>
77
- );
78
- });
79
- })}
80
- </Grid>
81
- </Flex>
82
- </ModalBody>
83
- <ModalFooter
84
- startActions={
29
+ <Modal.Root open={isOpen} onOpenChange={onToggle}>
30
+ <Modal.Content>
31
+ <Modal.Header>
32
+ <Breadcrumbs label={headerBreadcrumbs.join(', ')}>
33
+ {headerBreadcrumbs.map((crumb, index, arr) => (
34
+ <Crumb isCurrent={index === arr.length - 1} key={crumb}>
35
+ {crumb}
36
+ </Crumb>
37
+ ))}
38
+ </Breadcrumbs>
39
+ </Modal.Header>
40
+ <Formik
41
+ onSubmit={(values) => onSubmit(values)}
42
+ initialValues={initialData}
43
+ validationSchema={layout.schema}
44
+ validateOnChange={false}
45
+ >
46
+ {({ errors, handleChange, values }) => {
47
+ return (
48
+ <Form>
49
+ <Modal.Body>
50
+ <Flex direction="column" alignItems="stretch" gap={1}>
51
+ <Grid.Root gap={5}>
52
+ {layout.form.map((row) => {
53
+ return row.map((input) => {
54
+ return (
55
+ <Grid.Item key={input.name} col={input.size} xs={12}>
56
+ <Input
57
+ {...input}
58
+ error={errors[input.name]}
59
+ onChange={handleChange}
60
+ value={values[input.name]}
61
+ providerToEditName={providerToEditName}
62
+ />
63
+ </Grid.Item>
64
+ );
65
+ });
66
+ })}
67
+ </Grid.Root>
68
+ </Flex>
69
+ </Modal.Body>
70
+ <Modal.Footer>
85
71
  <Button variant="tertiary" onClick={onToggle} type="button">
86
72
  {formatMessage({
87
73
  id: 'app.components.Button.cancel',
88
74
  defaultMessage: 'Cancel',
89
75
  })}
90
76
  </Button>
91
- }
92
- endActions={
93
77
  <Button type="submit" loading={isSubmiting}>
94
78
  {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}
95
79
  </Button>
96
- }
97
- />
98
- </Form>
99
- );
100
- }}
101
- </Formik>
102
- </ModalLayout>
80
+ </Modal.Footer>
81
+ </Form>
82
+ );
83
+ }}
84
+ </Formik>
85
+ </Modal.Content>
86
+ </Modal.Root>
103
87
  );
104
88
  };
105
89
 
@@ -1,5 +1,5 @@
1
1
  import { Box } from '@strapi/design-system';
2
- import styled, { css } from 'styled-components';
2
+ import { styled, css } from 'styled-components';
3
3
 
4
4
  const activeCheckboxWrapperStyles = css`
5
5
  background: ${(props) => props.theme.colors.primary100};
@@ -1,19 +1,11 @@
1
1
  import React, { useCallback, useMemo } from 'react';
2
2
 
3
- import {
4
- Box,
5
- Checkbox,
6
- Flex,
7
- Typography,
8
- Grid,
9
- GridItem,
10
- VisuallyHidden,
11
- } from '@strapi/design-system';
3
+ import { Box, Checkbox, Flex, Typography, Grid, VisuallyHidden } from '@strapi/design-system';
12
4
  import { Cog as CogIcon } from '@strapi/icons';
13
5
  import get from 'lodash/get';
14
6
  import PropTypes from 'prop-types';
15
7
  import { useIntl } from 'react-intl';
16
- import styled from 'styled-components';
8
+ import { styled } from 'styled-components';
17
9
 
18
10
  import { useUsersPermissions } from '../../../contexts/UsersPermissionsContext';
19
11
 
@@ -71,28 +63,27 @@ const SubCategory = ({ subCategory }) => {
71
63
  <Box paddingLeft={4}>
72
64
  <Checkbox
73
65
  name={subCategory.name}
74
- value={hasAllActionsSelected}
75
- onValueChange={(value) =>
66
+ checked={hasSomeActionsSelected ? 'indeterminate' : hasAllActionsSelected}
67
+ onCheckedChange={(value) =>
76
68
  handleChangeSelectAll({ target: { name: subCategory.name, value } })
77
69
  }
78
- indeterminate={hasSomeActionsSelected}
79
70
  >
80
71
  {formatMessage({ id: 'app.utils.select-all', defaultMessage: 'Select all' })}
81
72
  </Checkbox>
82
73
  </Box>
83
74
  </Flex>
84
75
  <Flex paddingTop={6} paddingBottom={6}>
85
- <Grid gap={2} style={{ flex: 1 }}>
76
+ <Grid.Root gap={2} style={{ flex: 1 }}>
86
77
  {subCategory.actions.map((action) => {
87
78
  const name = `${action.name}.enabled`;
88
79
 
89
80
  return (
90
- <GridItem col={6} key={action.name}>
81
+ <Grid.Item col={6} key={action.name}>
91
82
  <CheckboxWrapper isActive={isActionSelected(action.name)} padding={2} hasRadius>
92
83
  <Checkbox
93
- value={get(modifiedData, name, false)}
84
+ checked={get(modifiedData, name, false)}
94
85
  name={name}
95
- onValueChange={(value) => onChange({ target: { name, value } })}
86
+ onCheckedChange={(value) => onChange({ target: { name, value } })}
96
87
  >
97
88
  {action.label}
98
89
  </Checkbox>
@@ -101,7 +92,7 @@ const SubCategory = ({ subCategory }) => {
101
92
  onClick={() => onSelectedAction(action.name)}
102
93
  style={{ display: 'inline-flex', alignItems: 'center' }}
103
94
  >
104
- <VisuallyHidden as="span">
95
+ <VisuallyHidden tag="span">
105
96
  {formatMessage(
106
97
  {
107
98
  id: 'app.utils.show-bound-route',
@@ -115,10 +106,10 @@ const SubCategory = ({ subCategory }) => {
115
106
  <CogIcon />
116
107
  </button>
117
108
  </CheckboxWrapper>
118
- </GridItem>
109
+ </Grid.Item>
119
110
  );
120
111
  })}
121
- </Grid>
112
+ </Grid.Root>
122
113
  </Flex>
123
114
  </Box>
124
115
  );
@@ -1,6 +1,6 @@
1
1
  import React, { useReducer } from 'react';
2
2
 
3
- import { Accordion, AccordionContent, AccordionToggle, Flex } from '@strapi/design-system';
3
+ import { Accordion, Flex } from '@strapi/design-system';
4
4
  import { useIntl } from 'react-intl';
5
5
 
6
6
  import { useUsersPermissions } from '../../contexts/UsersPermissionsContext';
@@ -13,42 +13,34 @@ import { initialState, reducer } from './reducer';
13
13
  const Permissions = () => {
14
14
  const { modifiedData } = useUsersPermissions();
15
15
  const { formatMessage } = useIntl();
16
- const [{ collapses }, dispatch] = useReducer(reducer, initialState, (state) =>
17
- init(state, modifiedData)
18
- );
19
-
20
- const handleToggle = (index) =>
21
- dispatch({
22
- type: 'TOGGLE_COLLAPSE',
23
- index,
24
- });
16
+ const [{ collapses }] = useReducer(reducer, initialState, (state) => init(state, modifiedData));
25
17
 
26
18
  return (
27
- <Flex direction="column" alignItems="stretch" gap={1}>
28
- {collapses.map((collapse, index) => (
29
- <Accordion
30
- expanded={collapse.isOpen}
31
- onToggle={() => handleToggle(index)}
32
- key={collapse.name}
33
- variant={index % 2 === 0 ? 'secondary' : undefined}
34
- >
35
- <AccordionToggle
36
- title={formatPluginName(collapse.name)}
37
- description={formatMessage(
38
- {
39
- id: 'users-permissions.Plugin.permissions.plugins.description',
40
- defaultMessage: 'Define all allowed actions for the {name} plugin.',
41
- },
42
- { name: collapse.name }
43
- )}
44
- variant={index % 2 ? 'primary' : 'secondary'}
45
- />
46
- <AccordionContent>
47
- <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
48
- </AccordionContent>
49
- </Accordion>
50
- ))}
51
- </Flex>
19
+ <Accordion.Root size="M">
20
+ <Flex direction="column" alignItems="stretch" gap={1}>
21
+ {collapses.map((collapse, index) => (
22
+ <Accordion.Item key={collapse.name} value={collapse.name}>
23
+ <Accordion.Header variant={index % 2 === 0 ? 'secondary' : undefined}>
24
+ <Accordion.Trigger
25
+ caretPosition="right"
26
+ description={formatMessage(
27
+ {
28
+ id: 'users-permissions.Plugin.permissions.plugins.description',
29
+ defaultMessage: 'Define all allowed actions for the {name} plugin.',
30
+ },
31
+ { name: collapse.name }
32
+ )}
33
+ >
34
+ {formatPluginName(collapse.name)}
35
+ </Accordion.Trigger>
36
+ </Accordion.Header>
37
+ <Accordion.Content>
38
+ <PermissionRow permissions={modifiedData[collapse.name]} name={collapse.name} />
39
+ </Accordion.Content>
40
+ </Accordion.Item>
41
+ ))}
42
+ </Flex>
43
+ </Accordion.Root>
52
44
  );
53
45
  };
54
46
 
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import { Flex, GridItem, Typography } from '@strapi/design-system';
3
+ import { Flex, Grid, Typography } from '@strapi/design-system';
4
4
  import get from 'lodash/get';
5
5
  import isEmpty from 'lodash/isEmpty';
6
6
  import without from 'lodash/without';
@@ -22,7 +22,7 @@ const Policies = () => {
22
22
  : controllerRoutes.filter((o) => o.handler.endsWith(pathResolved));
23
23
 
24
24
  return (
25
- <GridItem
25
+ <Grid.Item
26
26
  col={5}
27
27
  background="neutral150"
28
28
  paddingTop={6}
@@ -40,13 +40,13 @@ const Policies = () => {
40
40
  </Flex>
41
41
  ) : (
42
42
  <Flex direction="column" alignItems="stretch" gap={2}>
43
- <Typography variant="delta" as="h3">
43
+ <Typography variant="delta" tag="h3">
44
44
  {formatMessage({
45
45
  id: 'users-permissions.Policies.header.title',
46
46
  defaultMessage: 'Advanced settings',
47
47
  })}
48
48
  </Typography>
49
- <Typography as="p" textColor="neutral600">
49
+ <Typography tag="p" textColor="neutral600">
50
50
  {formatMessage({
51
51
  id: 'users-permissions.Policies.header.hint',
52
52
  defaultMessage:
@@ -55,7 +55,7 @@ const Policies = () => {
55
55
  </Typography>
56
56
  </Flex>
57
57
  )}
58
- </GridItem>
58
+ </Grid.Item>
59
59
  );
60
60
  };
61
61
 
@@ -1,6 +1,6 @@
1
1
  import React, { forwardRef, memo, useImperativeHandle, useReducer } from 'react';
2
2
 
3
- import { Flex, Grid, GridItem, Typography } from '@strapi/design-system';
3
+ import { Flex, Grid, Typography } from '@strapi/design-system';
4
4
  import PropTypes from 'prop-types';
5
5
  import { useIntl } from 'react-intl';
6
6
 
@@ -61,17 +61,17 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
61
61
 
62
62
  return (
63
63
  <UsersPermissionsProvider value={providerValue}>
64
- <Grid gap={0} shadow="filterShadow" hasRadius background="neutral0">
65
- <GridItem col={7} paddingTop={6} paddingBottom={6} paddingLeft={7} paddingRight={7}>
64
+ <Grid.Root gap={0} shadow="filterShadow" hasRadius background="neutral0">
65
+ <Grid.Item col={7} paddingTop={6} paddingBottom={6} paddingLeft={7} paddingRight={7}>
66
66
  <Flex direction="column" alignItems="stretch" gap={6}>
67
67
  <Flex direction="column" alignItems="stretch" gap={2}>
68
- <Typography variant="delta" as="h2">
68
+ <Typography variant="delta" tag="h2">
69
69
  {formatMessage({
70
70
  id: getTrad('Plugins.header.title'),
71
71
  defaultMessage: 'Permissions',
72
72
  })}
73
73
  </Typography>
74
- <Typography as="p" textColor="neutral600">
74
+ <Typography tag="p" textColor="neutral600">
75
75
  {formatMessage({
76
76
  id: getTrad('Plugins.header.description'),
77
77
  defaultMessage: 'Only actions bound by a route are listed below.',
@@ -80,9 +80,9 @@ const UsersPermissions = forwardRef(({ permissions, routes }, ref) => {
80
80
  </Flex>
81
81
  <Permissions />
82
82
  </Flex>
83
- </GridItem>
83
+ </Grid.Item>
84
84
  <Policies />
85
- </Grid>
85
+ </Grid.Root>
86
86
  </UsersPermissionsProvider>
87
87
  );
88
88
  });
@@ -1,16 +1,6 @@
1
1
  import React from 'react';
2
2
 
3
- import {
4
- Box,
5
- Button,
6
- ContentLayout,
7
- Flex,
8
- Grid,
9
- GridItem,
10
- HeaderLayout,
11
- Typography,
12
- useNotifyAT,
13
- } from '@strapi/design-system';
3
+ import { Box, Button, Flex, Grid, Typography, useNotifyAT } from '@strapi/design-system';
14
4
  import { Check } from '@strapi/icons';
15
5
  import {
16
6
  useAPIErrorHandler,
@@ -20,8 +10,8 @@ import {
20
10
  useNotification,
21
11
  useFetchClient,
22
12
  useRBAC,
13
+ Layouts,
23
14
  } from '@strapi/strapi/admin';
24
- import { Helmet } from 'react-helmet';
25
15
  import { useIntl } from 'react-intl';
26
16
  import { useMutation, useQuery, useQueryClient } from 'react-query';
27
17
 
@@ -118,8 +108,8 @@ const AdvancedSettingsPage = () => {
118
108
 
119
109
  return (
120
110
  <Page.Main aria-busy={isSubmittingForm}>
121
- <Helmet
122
- title={formatMessage(
111
+ <Page.Title>
112
+ {formatMessage(
123
113
  { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },
124
114
  {
125
115
  name: formatMessage({
@@ -128,12 +118,12 @@ const AdvancedSettingsPage = () => {
128
118
  }),
129
119
  }
130
120
  )}
131
- />
121
+ </Page.Title>
132
122
  <Form onSubmit={handleSubmit} initialValues={data.settings} validationSchema={schema}>
133
123
  {({ values, isSubmitting, modified }) => {
134
124
  return (
135
125
  <>
136
- <HeaderLayout
126
+ <Layouts.Header
137
127
  title={formatMessage({
138
128
  id: getTrad('HeaderNav.link.advancedSettings'),
139
129
  defaultMessage: 'Advanced Settings',
@@ -150,7 +140,7 @@ const AdvancedSettingsPage = () => {
150
140
  </Button>
151
141
  }
152
142
  />
153
- <ContentLayout>
143
+ <Layouts.Content>
154
144
  <Box
155
145
  background="neutral0"
156
146
  hasRadius
@@ -161,13 +151,13 @@ const AdvancedSettingsPage = () => {
161
151
  paddingRight={7}
162
152
  >
163
153
  <Flex direction="column" alignItems="stretch" gap={4}>
164
- <Typography variant="delta" as="h2">
154
+ <Typography variant="delta" tag="h2">
165
155
  {formatMessage({
166
156
  id: 'global.settings',
167
157
  defaultMessage: 'Settings',
168
158
  })}
169
159
  </Typography>
170
- <Grid gap={6}>
160
+ <Grid.Root gap={6}>
171
161
  {[
172
162
  {
173
163
  label: {
@@ -189,7 +179,7 @@ const AdvancedSettingsPage = () => {
189
179
  },
190
180
  ...layout,
191
181
  ].map(({ size, ...field }) => (
192
- <GridItem key={field.name} col={size}>
182
+ <Grid.Item key={field.name} col={size}>
193
183
  <InputRenderer
194
184
  {...field}
195
185
  disabled={
@@ -202,12 +192,12 @@ const AdvancedSettingsPage = () => {
202
192
  field.placeholder ? formatMessage(field.placeholder) : undefined
203
193
  }
204
194
  />
205
- </GridItem>
195
+ </Grid.Item>
206
196
  ))}
207
- </Grid>
197
+ </Grid.Root>
208
198
  </Flex>
209
199
  </Box>
210
- </ContentLayout>
200
+ </Layouts.Content>
211
201
  </>
212
202
  );
213
203
  }}