@strapi/admin 4.12.6 → 4.13.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (211) hide show
  1. package/admin/src/StrapiApp.js +1 -1
  2. package/admin/src/components/AuthenticatedApp/index.js +118 -0
  3. package/admin/src/components/AuthenticatedApp/utils/api.js +85 -0
  4. package/admin/src/components/AuthenticatedApp/utils/checkLatestStrapiVersion.js +11 -0
  5. package/admin/src/components/GuidedTour/Modal/index.js +3 -1
  6. package/admin/src/components/NpsSurvey/hooks/useNpsSurveySettings.js +17 -0
  7. package/admin/src/components/NpsSurvey/index.js +365 -0
  8. package/admin/src/components/PluginsInitializer/index.js +68 -0
  9. package/admin/src/components/PluginsInitializer/init.js +11 -0
  10. package/admin/src/components/PluginsInitializer/reducer.js +22 -0
  11. package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumns.js +2 -0
  12. package/admin/src/content-manager/components/DynamicZone/components/DynamicZoneLabel.js +1 -1
  13. package/admin/src/content-manager/components/EditViewDataManagerProvider/reducer.js +8 -1
  14. package/admin/src/content-manager/components/Filter/CustomInputs/AdminUsersFilter.js +42 -0
  15. package/admin/src/content-manager/components/Filter/Filter.js +54 -0
  16. package/admin/src/content-manager/components/Filter/index.js +1 -0
  17. package/admin/src/content-manager/components/InputUID/index.js +222 -216
  18. package/admin/src/content-manager/components/RelationInput/RelationInput.js +4 -0
  19. package/admin/src/content-manager/components/RepeatableComponent/index.js +32 -2
  20. package/admin/src/content-manager/components/Wysiwyg/Editor.js +432 -68
  21. package/admin/src/content-manager/components/Wysiwyg/WysiwygStyles.js +0 -7
  22. package/admin/src/content-manager/components/Wysiwyg/index.js +147 -152
  23. package/admin/src/content-manager/hooks/useAllowedAttributes.js +47 -0
  24. package/admin/src/content-manager/pages/App/index.js +16 -5
  25. package/admin/src/content-manager/pages/EditView/Information/index.js +9 -8
  26. package/admin/src/content-manager/pages/ListSettingsView/components/Settings.js +40 -7
  27. package/admin/src/content-manager/pages/ListSettingsView/index.js +6 -2
  28. package/admin/src/content-manager/pages/ListView/components/BulkActionButtons/SelectedEntriesModal/index.js +2 -2
  29. package/admin/src/content-manager/pages/ListView/components/FieldPicker/index.js +67 -69
  30. package/admin/src/content-manager/pages/ListView/components/TableRows/index.js +1 -1
  31. package/admin/src/content-manager/pages/ListView/components/ViewSettingsMenu/index.js +80 -0
  32. package/admin/src/content-manager/pages/ListView/index.js +236 -67
  33. package/admin/src/content-manager/utils/getDisplayName.js +33 -0
  34. package/admin/src/content-manager/utils/index.js +1 -0
  35. package/admin/src/hooks/useSettingsForm/index.js +3 -14
  36. package/admin/src/hooks/useSettingsMenu/index.js +2 -2
  37. package/admin/src/hooks/useSettingsMenu/utils/formatLinks.js +3 -1
  38. package/admin/src/hooks/useSettingsMenu/utils/sortLinks.js +3 -1
  39. package/admin/src/index.js +1 -1
  40. package/admin/src/layouts/AppLayout/index.js +33 -0
  41. package/admin/src/pages/Admin/Onboarding/index.js +3 -1
  42. package/admin/src/pages/Admin/index.js +73 -77
  43. package/admin/src/pages/App/constants.js +1 -1
  44. package/admin/src/pages/App/index.js +122 -160
  45. package/admin/src/pages/AuthPage/components/Register/index.js +5 -0
  46. package/admin/src/pages/AuthPage/index.js +4 -2
  47. package/admin/src/pages/HomePage/index.js +3 -1
  48. package/admin/src/pages/InstalledPluginsPage/index.js +3 -1
  49. package/admin/src/pages/{InternalErrorPage.js → InternalErrorPage/index.js} +4 -3
  50. package/admin/src/pages/{NotFoundPage.js → NotFoundPage/index.js} +3 -1
  51. package/admin/src/pages/ProfilePage/index.js +4 -2
  52. package/admin/src/pages/SettingsPage/constants.js +132 -67
  53. package/admin/src/pages/SettingsPage/index.js +18 -23
  54. package/admin/src/pages/SettingsPage/pages/ApiTokens/EditView/index.js +1 -1
  55. package/admin/src/pages/SettingsPage/pages/TransferTokens/EditView/index.js +1 -1
  56. package/admin/src/pages/SettingsPage/pages/Users/EditPage/index.js +1 -2
  57. package/admin/src/pages/SettingsPage/pages/Users/ListPage/DynamicTable/TableRows/index.js +1 -1
  58. package/admin/src/pages/UseCasePage/index.js +175 -0
  59. package/admin/src/plugins.js +7 -8
  60. package/admin/src/translations/en.json +10 -1
  61. package/admin/src/utils/checkFormValidity.js +15 -0
  62. package/admin/src/utils/createRoute.js +7 -5
  63. package/admin/src/utils/formatAPIErrors.js +3 -1
  64. package/admin/src/utils/getAttributesToDisplay.js +19 -0
  65. package/admin/src/utils/getExistingActions.js +32 -0
  66. package/admin/src/utils/getFullName.js +1 -1
  67. package/admin/src/utils/index.js +9 -0
  68. package/admin/src/utils/makeUniqueRoutes.js +6 -0
  69. package/admin/src/utils/sortLinks.js +3 -1
  70. package/admin/src/utils/uniqueAdminHash.js +9 -2
  71. package/build/{1049.9d69d231.chunk.js → 1049.ec69f5e0.chunk.js} +1 -1
  72. package/build/1227.9f37e1dc.chunk.js +1 -0
  73. package/build/1386.ea73b677.chunk.js +7 -0
  74. package/build/{2225.33287e1b.chunk.js → 2225.649fb7bc.chunk.js} +2 -2
  75. package/build/{2237.03792b63.chunk.js → 2237.b832ae6e.chunk.js} +4 -4
  76. package/build/{2379.401f56f3.chunk.js → 2379.1f98a31a.chunk.js} +1 -1
  77. package/build/{2395.e6a79fbb.chunk.js → 2395.0e5e8ded.chunk.js} +1 -1
  78. package/build/{2801.31393ffe.chunk.js → 2801.8e1aa82a.chunk.js} +1 -1
  79. package/build/3483.19381b40.chunk.js +1 -0
  80. package/build/3739.63e352f1.chunk.js +103 -0
  81. package/build/4174.f1f39e40.chunk.js +1 -0
  82. package/build/448.829e1344.chunk.js +1 -0
  83. package/build/4546.a5946d22.chunk.js +1 -0
  84. package/build/4724.aea5c8c1.chunk.js +6 -0
  85. package/build/{502.8dd074ff.chunk.js → 502.7bba43b1.chunk.js} +1 -1
  86. package/build/6158.c3c13c20.chunk.js +1 -0
  87. package/build/6691.4985ef22.chunk.js +105 -0
  88. package/build/{7464.592a9295.chunk.js → 7464.eb057bec.chunk.js} +1 -1
  89. package/build/78.dcc6df5c.chunk.js +1 -0
  90. package/build/{8276.e519a707.chunk.js → 8276.be3ed581.chunk.js} +2 -2
  91. package/build/{2747.d1442a90.chunk.js → 9806.5d5a0e8d.chunk.js} +64 -72
  92. package/build/9944.7af075a5.chunk.js +26 -0
  93. package/build/Admin-authenticatedApp.43b6ec9a.chunk.js +79 -0
  94. package/build/Admin_InternalErrorPage.38155af3.chunk.js +1 -0
  95. package/build/Admin_homePage.6f128523.chunk.js +81 -0
  96. package/build/Admin_marketplace.061a6e5a.chunk.js +55 -0
  97. package/build/Admin_pluginsPage.16f837b8.chunk.js +6 -0
  98. package/build/Admin_profilePage.678bce24.chunk.js +13 -0
  99. package/build/Admin_settingsPage.af7309e4.chunk.js +111 -0
  100. package/build/{Upload_ConfigureTheView.345ac1e0.chunk.js → Upload_ConfigureTheView.3fc1c100.chunk.js} +1 -1
  101. package/build/admin-app.d63bd229.chunk.js +36 -0
  102. package/build/{admin-edit-roles-page.24bdf746.chunk.js → admin-edit-roles-page.38a6c863.chunk.js} +3 -3
  103. package/build/admin-edit-users.545fc882.chunk.js +10 -0
  104. package/build/{admin-roles-list.23ddff26.chunk.js → admin-roles-list.1e2e814d.chunk.js} +1 -1
  105. package/build/admin-users.b8ea5677.chunk.js +11 -0
  106. package/build/{api-tokens-create-page.46c2ea84.chunk.js → api-tokens-create-page.e0c15627.chunk.js} +1 -1
  107. package/build/{api-tokens-edit-page.58139df9.chunk.js → api-tokens-edit-page.9f2dce47.chunk.js} +1 -1
  108. package/build/{api-tokens-list-page.0af7d431.chunk.js → api-tokens-list-page.d747051c.chunk.js} +2 -2
  109. package/build/{audit-logs-settings-page.0f73ccf8.chunk.js → audit-logs-settings-page.96f9d608.chunk.js} +1 -1
  110. package/build/content-manager.ccff1078.chunk.js +1097 -0
  111. package/build/{content-type-builder-list-view.bf9be456.chunk.js → content-type-builder-list-view.b71cf240.chunk.js} +1 -1
  112. package/build/{content-type-builder.66066281.chunk.js → content-type-builder.e5669749.chunk.js} +18 -18
  113. package/build/{email-settings-page.2f7e35c0.chunk.js → email-settings-page.2809f0bf.chunk.js} +1 -1
  114. package/build/en-json.e12fd5fc.chunk.js +1 -0
  115. package/build/{i18n-settings-page.47f78016.chunk.js → i18n-settings-page.5f716172.chunk.js} +1 -1
  116. package/build/index.html +1 -1
  117. package/build/main.c6c9e04c.js +2859 -0
  118. package/build/{review-workflows-settings-create-view.d24a32b9.chunk.js → review-workflows-settings-create-view.4a156a19.chunk.js} +1 -1
  119. package/build/{review-workflows-settings-edit-view.6044b022.chunk.js → review-workflows-settings-edit-view.ce984d1f.chunk.js} +1 -1
  120. package/build/{review-workflows-settings-list-view.3f0ef4bc.chunk.js → review-workflows-settings-list-view.419b8deb.chunk.js} +2 -2
  121. package/build/runtime~main.dcf1cb45.js +2 -0
  122. package/build/{sso-settings-page.4dba0670.chunk.js → sso-settings-page.45153df5.chunk.js} +1 -1
  123. package/build/{transfer-tokens-create-page.1597e6ab.chunk.js → transfer-tokens-create-page.ebba16d8.chunk.js} +1 -1
  124. package/build/{transfer-tokens-edit-page.8741529f.chunk.js → transfer-tokens-edit-page.d7bb2b3e.chunk.js} +1 -1
  125. package/build/{transfer-tokens-list-page.d6986b03.chunk.js → transfer-tokens-list-page.cfe1736c.chunk.js} +2 -2
  126. package/build/{upload-settings.7f93d4c0.chunk.js → upload-settings.cc5ad813.chunk.js} +1 -1
  127. package/build/{upload.37488080.chunk.js → upload.756efc28.chunk.js} +1 -1
  128. package/build/{users-advanced-settings-page.17052d72.chunk.js → users-advanced-settings-page.818d84eb.chunk.js} +1 -1
  129. package/build/{users-email-settings-page.3de8ea50.chunk.js → users-email-settings-page.c1967c09.chunk.js} +1 -1
  130. package/build/{users-providers-settings-page.0eaa916d.chunk.js → users-providers-settings-page.11893e08.chunk.js} +1 -1
  131. package/build/{users-roles-settings-page.957ad48b.chunk.js → users-roles-settings-page.2b051e6a.chunk.js} +1 -1
  132. package/build/webhook-edit-page.de45c635.chunk.js +33 -0
  133. package/build/{webhook-list-page.65e1b5bb.chunk.js → webhook-list-page.ca91df8b.chunk.js} +1 -1
  134. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/AssigneeFilter.js +42 -0
  135. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/StageFilter.js +70 -0
  136. package/ee/admin/content-manager/components/Filter/CustomInputs/ReviewWorkflows/constants.js +71 -0
  137. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +9 -217
  138. package/ee/admin/content-manager/pages/EditView/InformationBox/components/AssigneeSelect/AssigneeSelect.js +147 -0
  139. package/ee/admin/content-manager/pages/EditView/InformationBox/components/AssigneeSelect/index.js +1 -0
  140. package/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/StageSelect.js +243 -0
  141. package/ee/admin/content-manager/pages/EditView/InformationBox/components/StageSelect/index.js +1 -0
  142. package/ee/admin/content-manager/pages/EditView/InformationBox/constants.js +2 -0
  143. package/ee/admin/content-manager/pages/ListSettingsView/constants.js +7 -0
  144. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/ReviewWorkflowsAssigneeEE.js +21 -0
  145. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/constants.js +44 -17
  146. package/ee/admin/content-manager/pages/ListView/ReviewWorkflowsColumn/index.js +1 -0
  147. package/ee/admin/pages/App/constants.js +5 -6
  148. package/ee/admin/pages/SettingsPage/constants.js +42 -27
  149. package/ee/server/constants/workflows.js +1 -0
  150. package/ee/server/controllers/index.js +1 -0
  151. package/ee/server/controllers/workflows/assignees/index.js +44 -0
  152. package/ee/server/routes/review-workflows.js +17 -0
  153. package/ee/server/services/index.js +1 -0
  154. package/ee/server/services/review-workflows/assignees.js +54 -0
  155. package/ee/server/services/review-workflows/metrics/index.js +5 -0
  156. package/ee/server/services/review-workflows/review-workflows.js +20 -11
  157. package/ee/server/validation/review-workflows.js +8 -0
  158. package/index.js +2 -6
  159. package/package.json +9 -9
  160. package/scripts/build.js +15 -15
  161. package/scripts/create-dev-plugins-file.js +5 -38
  162. package/server/controllers/role.js +2 -0
  163. package/server/controllers/user.js +2 -0
  164. package/server/services/permission/permissions-manager/index.js +3 -1
  165. package/server/services/permission/permissions-manager/sanitize.js +19 -7
  166. package/server/services/permission/permissions-manager/validate.js +218 -0
  167. package/utils/create-cache-dir.js +62 -16
  168. package/utils/create-plugins-exclude-path.js +3 -23
  169. package/utils/get-plugins.js +110 -0
  170. package/utils/index.js +1 -1
  171. package/webpack.config.js +10 -13
  172. package/admin/src/components/AuthenticatedApp.js +0 -229
  173. package/admin/src/content-manager/components/AttributeFilter/Filters.js +0 -58
  174. package/admin/src/content-manager/components/AttributeFilter/hooks/useAllowedAttributes.js +0 -42
  175. package/admin/src/content-manager/components/AttributeFilter/index.js +0 -40
  176. package/admin/src/content-manager/components/Wysiwyg/EditorStylesContainer.js +0 -344
  177. package/admin/src/pages/UseCasePage.js +0 -174
  178. package/build/2166.c837469a.chunk.js +0 -1
  179. package/build/3483.8517171f.chunk.js +0 -1
  180. package/build/3984.dda474f7.chunk.js +0 -1
  181. package/build/4546.7a3c0d03.chunk.js +0 -1
  182. package/build/5483.5bfbb00d.chunk.js +0 -6
  183. package/build/6158.c974fd83.chunk.js +0 -1
  184. package/build/748.fd2e5afd.chunk.js +0 -105
  185. package/build/773.6381d62d.chunk.js +0 -18
  186. package/build/7826.399afe81.chunk.js +0 -103
  187. package/build/8261.2525d35c.chunk.js +0 -7
  188. package/build/8299.62b67c72.chunk.js +0 -1
  189. package/build/Admin-AuthPage.90d64342.chunk.js +0 -35
  190. package/build/Admin-AuthenticatedApp.379ac945.chunk.js +0 -24
  191. package/build/Admin-UseCasePage.1f757db5.chunk.js +0 -13
  192. package/build/Admin_GuidedTourModal.8ccf1fbc.chunk.js +0 -12
  193. package/build/Admin_InternalErrorPage.9de92c6d.chunk.js +0 -9
  194. package/build/Admin_NotFoundPage.21620424.chunk.js +0 -9
  195. package/build/Admin_Onboarding.dbfa32f6.chunk.js +0 -43
  196. package/build/Admin_homePage.2000cbe9.chunk.js +0 -86
  197. package/build/Admin_marketplace.ec80e29b.chunk.js +0 -63
  198. package/build/Admin_pluginsPage.0c6851f8.chunk.js +0 -14
  199. package/build/Admin_profilePage.78cd8495.chunk.js +0 -21
  200. package/build/Admin_settingsPage.1760c3ce.chunk.js +0 -119
  201. package/build/StrapiApp.221fac30.chunk.js +0 -5
  202. package/build/admin-edit-users.5d10d444.chunk.js +0 -10
  203. package/build/admin-users.2b3e4305.chunk.js +0 -11
  204. package/build/content-manager.fb0833bd.chunk.js +0 -1099
  205. package/build/en-json.08c05fcf.chunk.js +0 -1
  206. package/build/main.ee3c1938.js +0 -2859
  207. package/build/runtime~main.397ee447.js +0 -2
  208. package/build/webhook-edit-page.665210af.chunk.js +0 -33
  209. package/scripts/create-plugins-file.js +0 -92
  210. package/utils/get-plugins-path.js +0 -41
  211. /package/server/services/permission/permissions-manager/{query-builers.js → query-builders.js} +0 -0
@@ -1,102 +1,167 @@
1
- import * as React from 'react';
2
-
3
- export const SETTINGS_ROUTES_CE = [
1
+ export const ROUTES_CE = [
4
2
  {
5
- component: React.lazy(() =>
6
- import(/* webpackChunkName: "admin-roles-list" */ './pages/Roles/ProtectedListPage')
7
- ),
8
- path: '/settings/roles',
3
+ async Component() {
4
+ const component = await import(
5
+ /* webpackChunkName: "admin-roles-list" */ './pages/Roles/ProtectedListPage'
6
+ );
7
+
8
+ return component;
9
+ },
10
+ to: '/settings/roles',
11
+ exact: true,
9
12
  },
10
13
  {
11
- component: React.lazy(() =>
12
- import(/* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/CreatePage')
13
- ),
14
- path: '/settings/roles/duplicate/:id',
14
+ async Component() {
15
+ const component = await import(
16
+ /* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/CreatePage'
17
+ );
18
+
19
+ return component;
20
+ },
21
+ to: '/settings/roles/duplicate/:id',
22
+ exact: true,
15
23
  },
16
24
  {
17
- component: React.lazy(() =>
18
- import(/* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/CreatePage')
19
- ),
20
- path: '/settings/roles/new',
25
+ async Component() {
26
+ const component = await import(
27
+ /* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/CreatePage'
28
+ );
29
+
30
+ return component;
31
+ },
32
+ to: '/settings/roles/new',
33
+ exact: true,
21
34
  },
22
35
  {
23
- component: React.lazy(() =>
24
- import(/* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/ProtectedEditPage')
25
- ),
26
- path: '/settings/roles/:id',
36
+ async Component() {
37
+ const component = await import(
38
+ /* webpackChunkName: "admin-edit-roles-page" */ './pages/Roles/ProtectedEditPage'
39
+ );
40
+
41
+ return component;
42
+ },
43
+ to: '/settings/roles/:id',
44
+ exact: true,
27
45
  },
28
46
  {
29
- component: React.lazy(() =>
30
- import(/* webpackChunkName: "admin-users" */ './pages/Users/ProtectedListPage')
31
- ),
32
- path: '/settings/users',
47
+ async Component() {
48
+ const component = await import(
49
+ /* webpackChunkName: "admin-users" */ './pages/Users/ProtectedListPage'
50
+ );
51
+
52
+ return component;
53
+ },
54
+ to: '/settings/users',
55
+ exact: true,
33
56
  },
34
57
  {
35
- component: React.lazy(() =>
36
- import(/* webpackChunkName: "admin-edit-users" */ './pages/Users/ProtectedEditPage')
37
- ),
38
- path: '/settings/users/:id',
58
+ async Component() {
59
+ const component = await import(
60
+ /* webpackChunkName: "admin-edit-users" */ './pages/Users/ProtectedEditPage'
61
+ );
62
+
63
+ return component;
64
+ },
65
+ to: '/settings/users/:id',
66
+ exact: true,
39
67
  },
40
68
  {
41
- component: React.lazy(() =>
42
- import(/* webpackChunkName: "webhook-edit-page" */ './pages/Webhooks/ProtectedCreateView')
43
- ),
44
- path: '/settings/webhooks/create',
69
+ async Component() {
70
+ const component = await import(
71
+ /* webpackChunkName: "webhook-edit-page" */ './pages/Webhooks/ProtectedCreateView'
72
+ );
73
+
74
+ return component;
75
+ },
76
+ to: '/settings/webhooks/create',
77
+ exact: true,
45
78
  },
46
79
  {
47
- component: React.lazy(() =>
48
- import(/* webpackChunkName: "webhook-edit-page" */ './pages/Webhooks/ProtectedEditView')
49
- ),
50
- path: '/settings/webhooks/:id',
80
+ async Component() {
81
+ const component = await import(
82
+ /* webpackChunkName: "webhook-edit-page" */ './pages/Webhooks/ProtectedEditView'
83
+ );
84
+
85
+ return component;
86
+ },
87
+ to: '/settings/webhooks/:id',
88
+ exact: true,
51
89
  },
52
90
  {
53
- component: React.lazy(() =>
54
- import(/* webpackChunkName: "webhook-list-page" */ './pages/Webhooks/ProtectedListView')
55
- ),
56
- path: '/settings/webhooks',
91
+ async Component() {
92
+ const component = await import(
93
+ /* webpackChunkName: "webhook-list-page" */ './pages/Webhooks/ProtectedListView'
94
+ );
95
+
96
+ return component;
97
+ },
98
+ to: '/settings/webhooks',
99
+ exact: true,
57
100
  },
58
101
  {
59
- component: React.lazy(() =>
60
- import(/* webpackChunkName: "api-tokens-list-page" */ './pages/ApiTokens/ProtectedListView')
61
- ),
62
- path: '/settings/api-tokens',
102
+ async Component() {
103
+ const component = await import(
104
+ /* webpackChunkName: "api-tokens-list-page" */ './pages/ApiTokens/ProtectedListView'
105
+ );
106
+
107
+ return component;
108
+ },
109
+ to: '/settings/api-tokens',
110
+ exact: true,
63
111
  },
64
112
  {
65
- component: React.lazy(() =>
66
- import(
113
+ async Component() {
114
+ const component = await import(
67
115
  /* webpackChunkName: "api-tokens-create-page" */ './pages/ApiTokens/ProtectedCreateView'
68
- )
69
- ),
70
- path: '/settings/api-tokens/create',
116
+ );
117
+
118
+ return component;
119
+ },
120
+ to: '/settings/api-tokens/create',
121
+ exact: true,
71
122
  },
72
123
  {
73
- component: React.lazy(() =>
74
- import(/* webpackChunkName: "api-tokens-edit-page" */ './pages/ApiTokens/ProtectedEditView')
75
- ),
76
- path: '/settings/api-tokens/:id',
124
+ async Component() {
125
+ const component = await import(
126
+ /* webpackChunkName: "api-tokens-edit-page" */ './pages/ApiTokens/ProtectedEditView'
127
+ );
128
+
129
+ return component;
130
+ },
131
+ to: '/settings/api-tokens/:id',
132
+ exact: true,
77
133
  },
78
134
  {
79
- component: React.lazy(() =>
80
- import(
135
+ async Component() {
136
+ const component = await import(
81
137
  /* webpackChunkName: "transfer-tokens-create-page" */ './pages/TransferTokens/ProtectedCreateView'
82
- )
83
- ),
84
- path: '/settings/transfer-tokens/create',
138
+ );
139
+
140
+ return component;
141
+ },
142
+ to: '/settings/transfer-tokens/create',
143
+ exact: true,
85
144
  },
86
145
  {
87
- component: React.lazy(() =>
88
- import(
146
+ async Component() {
147
+ const component = await import(
89
148
  /* webpackChunkName: "transfer-tokens-list-page" */ './pages/TransferTokens/ProtectedListView'
90
- )
91
- ),
92
- path: '/settings/transfer-tokens',
149
+ );
150
+
151
+ return component;
152
+ },
153
+ to: '/settings/transfer-tokens',
154
+ exact: true,
93
155
  },
94
156
  {
95
- component: React.lazy(() =>
96
- import(
157
+ async Component() {
158
+ const component = await import(
97
159
  /* webpackChunkName: "transfer-tokens-edit-page" */ './pages/TransferTokens/ProtectedEditView'
98
- )
99
- ),
100
- path: '/settings/transfer-tokens/:id',
160
+ );
161
+
162
+ return component;
163
+ },
164
+ to: '/settings/transfer-tokens/:id',
165
+ exact: true,
101
166
  },
102
167
  ];
@@ -8,10 +8,11 @@ import { Redirect, Route, Switch, useParams } from 'react-router-dom';
8
8
 
9
9
  import { useSettingsMenu } from '../../hooks';
10
10
  import { useEnterprise } from '../../hooks/useEnterprise';
11
- import { createRoute } from '../../utils/createRoute';
11
+ import createRoute from '../../utils/createRoute';
12
+ import makeUniqueRoutes from '../../utils/makeUniqueRoutes';
12
13
 
13
14
  import SettingsNav from './components/SettingsNav';
14
- import { SETTINGS_ROUTES_CE } from './constants';
15
+ import { ROUTES_CE } from './constants';
15
16
  import ApplicationInfosPage from './pages/ApplicationInfosPage';
16
17
 
17
18
  export function SettingsPage() {
@@ -20,9 +21,8 @@ export function SettingsPage() {
20
21
  const { formatMessage } = useIntl();
21
22
  const { isLoading, menu } = useSettingsMenu();
22
23
  const routes = useEnterprise(
23
- SETTINGS_ROUTES_CE,
24
- async () =>
25
- (await import('../../../../ee/admin/pages/SettingsPage/constants')).SETTINGS_ROUTES_EE,
24
+ ROUTES_CE,
25
+ async () => (await import('../../../../ee/admin/pages/SettingsPage/constants')).ROUTES_EE,
26
26
  {
27
27
  combine(ceRoutes, eeRoutes) {
28
28
  return [...ceRoutes, ...eeRoutes];
@@ -31,19 +31,18 @@ export function SettingsPage() {
31
31
  }
32
32
  );
33
33
 
34
- /**
35
- * `Component` is an async function, which is passed as property of the
36
- * addSettingsLink() API during the plugin bootstrap step.
37
- *
38
- * Because of that we can't just render <Route component={Component} />,
39
- * but have to await the function.
40
- *
41
- * This isn't a good React pattern and should be reconsidered.
42
- */
34
+ // Creates the admin routes
35
+ const adminRoutes = React.useMemo(() => {
36
+ return makeUniqueRoutes(
37
+ routes.map(({ to, Component, exact }) => createRoute(Component, to, exact))
38
+ );
39
+ }, [routes]);
43
40
 
44
- const pluginSettingsRoutes = Object.values(settings).flatMap((section) =>
45
- section.links.map((link) => createRoute(link.Component, link.to, link.exact || false))
46
- );
41
+ const pluginsRoutes = Object.values(settings).flatMap((section) => {
42
+ const { links } = section;
43
+
44
+ return links.map((link) => createRoute(link.Component, link.to, link.exact || false));
45
+ });
47
46
 
48
47
  // Since the useSettingsMenu hook can make API calls in order to check the links permissions
49
48
  // We need to add a loading state to prevent redirecting the user while permissions are being checked
@@ -66,12 +65,8 @@ export function SettingsPage() {
66
65
 
67
66
  <Switch>
68
67
  <Route path="/settings/application-infos" component={ApplicationInfosPage} exact />
69
-
70
- {routes.map(({ path, component }) => (
71
- <Route key={path} path={path} component={component} exact />
72
- ))}
73
-
74
- {pluginSettingsRoutes}
68
+ {adminRoutes}
69
+ {pluginsRoutes}
75
70
  </Switch>
76
71
  </Layout>
77
72
  );
@@ -19,7 +19,7 @@ import { useSelector } from 'react-redux';
19
19
  import { useHistory, useRouteMatch } from 'react-router-dom';
20
20
 
21
21
  import { ApiTokenPermissionsContextProvider } from '../../../../../contexts/ApiTokenPermissions';
22
- import { formatAPIErrors } from '../../../../../utils/formatAPIErrors';
22
+ import { formatAPIErrors } from '../../../../../utils';
23
23
  import { selectAdminPermissions } from '../../../../App/selectors';
24
24
  import { API_TOKEN_TYPE } from '../../../components/Tokens/constants';
25
25
  import FormHead from '../../../components/Tokens/FormHead';
@@ -19,7 +19,7 @@ import { useQuery } from 'react-query';
19
19
  import { useSelector } from 'react-redux';
20
20
  import { useHistory, useRouteMatch } from 'react-router-dom';
21
21
 
22
- import { formatAPIErrors } from '../../../../../utils/formatAPIErrors';
22
+ import { formatAPIErrors } from '../../../../../utils';
23
23
  import { selectAdminPermissions } from '../../../../App/selectors';
24
24
  import { TRANSFER_TOKEN_TYPE } from '../../../components/Tokens/constants';
25
25
  import FormHead from '../../../components/Tokens/FormHead';
@@ -34,8 +34,7 @@ import { useHistory, useRouteMatch } from 'react-router-dom';
34
34
 
35
35
  import { useAdminUsers } from '../../../../../hooks/useAdminUsers';
36
36
  import { useEnterprise } from '../../../../../hooks/useEnterprise';
37
- import { formatAPIErrors } from '../../../../../utils/formatAPIErrors';
38
- import { getFullName } from '../../../../../utils/getFullName';
37
+ import { formatAPIErrors, getFullName } from '../../../../../utils';
39
38
  import { MagicLinkCE } from '../components/MagicLink';
40
39
  import SelectRoles from '../components/SelectRoles';
41
40
  import { editValidation } from '../utils/validations/users';
@@ -16,7 +16,7 @@ import PropTypes from 'prop-types';
16
16
  import { useIntl } from 'react-intl';
17
17
  import { useHistory } from 'react-router-dom';
18
18
 
19
- import { getFullName } from '../../../../../../../utils/getFullName';
19
+ import { getFullName } from '../../../../../../../utils';
20
20
 
21
21
  const TableRows = ({
22
22
  canDelete,
@@ -0,0 +1,175 @@
1
+ import React, { useState } from 'react';
2
+
3
+ import {
4
+ Box,
5
+ Button,
6
+ Flex,
7
+ Main,
8
+ Option,
9
+ Select,
10
+ TextButton,
11
+ TextInput,
12
+ Typography,
13
+ } from '@strapi/design-system';
14
+ import { auth, pxToRem, useFetchClient, useNotification } from '@strapi/helper-plugin';
15
+ import { parse } from 'qs';
16
+ import { useIntl } from 'react-intl';
17
+ import { useHistory } from 'react-router-dom';
18
+ import styled from 'styled-components';
19
+
20
+ import Logo from '../../components/UnauthenticatedLogo';
21
+ import UnauthenticatedLayout, { LayoutContent } from '../../layouts/UnauthenticatedLayout';
22
+
23
+ export const options = [
24
+ {
25
+ intlLabel: {
26
+ id: 'Usecase.front-end',
27
+ defaultMessage: 'Front-end developer',
28
+ },
29
+ value: 'front_end_developer',
30
+ },
31
+ {
32
+ intlLabel: {
33
+ id: 'Usecase.back-end',
34
+ defaultMessage: 'Back-end developer',
35
+ },
36
+ value: 'back_end_developer',
37
+ },
38
+ {
39
+ intlLabel: {
40
+ id: 'Usecase.full-stack',
41
+ defaultMessage: 'Full-stack developer',
42
+ },
43
+ value: 'full_stack_developer',
44
+ },
45
+ {
46
+ intlLabel: {
47
+ id: 'global.content-manager',
48
+ defaultMessage: 'Content Manager',
49
+ },
50
+ value: 'content_manager',
51
+ },
52
+ {
53
+ intlLabel: {
54
+ id: 'Usecase.content-creator',
55
+ defaultMessage: 'Content Creator',
56
+ },
57
+ value: 'content_creator',
58
+ },
59
+ {
60
+ intlLabel: {
61
+ id: 'Usecase.other',
62
+ defaultMessage: 'Other',
63
+ },
64
+ value: 'other',
65
+ },
66
+ ];
67
+
68
+ const TypographyCenter = styled(Typography)`
69
+ text-align: center;
70
+ `;
71
+
72
+ const UseCasePage = () => {
73
+ const toggleNotification = useNotification();
74
+ const { push, location } = useHistory();
75
+ const { formatMessage } = useIntl();
76
+ const [role, setRole] = useState();
77
+ const [otherRole, setOtherRole] = useState('');
78
+ const { post } = useFetchClient();
79
+
80
+ const { firstname, email } = auth.getUserInfo();
81
+ const { hasAdmin } = parse(location?.search, { ignoreQueryPrefix: true });
82
+ const isOther = role === 'other';
83
+
84
+ const handleSubmit = async (event, skipPersona) => {
85
+ event.preventDefault();
86
+ try {
87
+ await post('https://analytics.strapi.io/register', {
88
+ email,
89
+ username: firstname,
90
+ firstAdmin: Boolean(!hasAdmin),
91
+ persona: {
92
+ role: skipPersona ? undefined : role,
93
+ otherRole: skipPersona ? undefined : otherRole,
94
+ },
95
+ });
96
+
97
+ toggleNotification({
98
+ type: 'success',
99
+ message: {
100
+ id: 'Usecase.notification.success.project-created',
101
+ defaultMessage: 'Project has been successfully created',
102
+ },
103
+ });
104
+ push('/');
105
+ } catch (err) {
106
+ // Silent
107
+ }
108
+ };
109
+
110
+ return (
111
+ <UnauthenticatedLayout>
112
+ <Main labelledBy="usecase-title">
113
+ <LayoutContent>
114
+ <form onSubmit={(e) => handleSubmit(e, false)}>
115
+ <Flex direction="column" paddingBottom={7}>
116
+ <Logo />
117
+ <Box paddingTop={6} paddingBottom={1} width={pxToRem(250)}>
118
+ <TypographyCenter variant="alpha" as="h1" id="usecase-title">
119
+ {formatMessage({
120
+ id: 'Usecase.title',
121
+ defaultMessage: 'Tell us a bit more about yourself',
122
+ })}
123
+ </TypographyCenter>
124
+ </Box>
125
+ </Flex>
126
+ <Flex direction="column" alignItems="stretch" gap={6}>
127
+ <Select
128
+ id="usecase"
129
+ data-testid="usecase"
130
+ label={formatMessage({
131
+ id: 'Usecase.input.work-type',
132
+ defaultMessage: 'What type of work do you do?',
133
+ })}
134
+ // onClear={() => setRole(null)}
135
+ // clearLabel={formatMessage({ id: 'clearLabel', defaultMessage: 'Clear' })}
136
+ onChange={setRole}
137
+ value={role}
138
+ >
139
+ {options.map(({ intlLabel, value }) => (
140
+ <Option key={value} value={value}>
141
+ {formatMessage(intlLabel)}
142
+ </Option>
143
+ ))}
144
+ </Select>
145
+ {isOther && (
146
+ <TextInput
147
+ name="other"
148
+ label={formatMessage({ id: 'Usecase.other', defaultMessage: 'Other' })}
149
+ value={otherRole}
150
+ onChange={(e) => setOtherRole(e.target.value)}
151
+ data-testid="other"
152
+ />
153
+ )}
154
+ <Button type="submit" size="L" fullWidth disabled={!role}>
155
+ {formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}
156
+ </Button>
157
+ </Flex>
158
+ </form>
159
+ </LayoutContent>
160
+ <Flex justifyContent="center">
161
+ <Box paddingTop={4}>
162
+ <TextButton onClick={() => handleSubmit(true)}>
163
+ {formatMessage({
164
+ id: 'Usecase.button.skip',
165
+ defaultMessage: 'Skip this question',
166
+ })}
167
+ </TextButton>
168
+ </Box>
169
+ </Flex>
170
+ </Main>
171
+ </UnauthenticatedLayout>
172
+ );
173
+ };
174
+
175
+ export default UseCasePage;
@@ -1,11 +1,10 @@
1
1
 
2
- // To override this file create a plugins-dev.js one and copy the content of the plugin.js one.
3
- // When starting the app the script will copy the plugins-dev.js into this one instead.
4
- import contentTypeBuilder from '../../../content-type-builder/admin/src';
5
- import email from '../../../email/admin/src';
6
- import upload from '../../../upload/admin/src';
7
- import i18N from '../../../../plugins/i18n/admin/src';
8
- import usersPermissions from '../../../../plugins/users-permissions/admin/src';
2
+ import contentTypeBuilder from '@strapi/plugin-content-type-builder/strapi-admin';
3
+ import email from '@strapi/plugin-email/strapi-admin';
4
+ import upload from '@strapi/plugin-upload/strapi-admin';
5
+ import i18N from '@strapi/plugin-i18n/strapi-admin';
6
+ import usersPermissions from '@strapi/plugin-users-permissions/strapi-admin';
7
+
9
8
 
10
9
  const plugins = {
11
10
  'content-type-builder': contentTypeBuilder,
@@ -14,5 +13,5 @@ const plugins = {
14
13
  'i18n': i18N,
15
14
  'users-permissions': usersPermissions,
16
15
  };
17
-
16
+
18
17
  export default plugins;
@@ -479,6 +479,13 @@
479
479
  "app.components.MarketplaceBanner.link": "Check it out now",
480
480
  "app.components.NotFoundPage.back": "Back to homepage",
481
481
  "app.components.NotFoundPage.description": "Not Found",
482
+ "app.components.NpsSurvey.banner-title": "How likely are you to recommend Strapi to a friend or colleague?",
483
+ "app.components.NpsSurvey.feedback-response": "Thank you very much for your feedback!",
484
+ "app.components.NpsSurvey.feedback-question": "Do you have any suggestion for improvements?",
485
+ "app.components.NpsSurvey.submit-feedback": "Submit Feedback",
486
+ "app.components.NpsSurvey.dismiss-survey-label": "Dismiss survey",
487
+ "app.components.NpsSurvey.no-recommendation": "Not at all likely",
488
+ "app.components.NpsSurvey.happy-to-recommend": "Extremely likely",
482
489
  "app.components.Official": "Official",
483
490
  "app.components.Onboarding.help.button": "Help button",
484
491
  "app.components.Onboarding.label.completed": "% completed",
@@ -612,7 +619,7 @@
612
619
  "components.PageFooter.select": "Entries per page",
613
620
  "components.ProductionBlocker.description": "For safety purposes we have to disable this plugin in other environments.",
614
621
  "components.ProductionBlocker.header": "This plugin is only available in development.",
615
- "components.Search.placeholder": "Search...",
622
+ "components.ViewSettings.tooltip": "View settings",
616
623
  "components.TableHeader.sort": "Sort on {label}",
617
624
  "components.Wysiwyg.ToggleMode.markdown-mode": "Markdown mode",
618
625
  "components.Wysiwyg.ToggleMode.preview-mode": "Preview mode",
@@ -671,6 +678,7 @@
671
678
  "content-manager.components.FiltersPickWrapper.PluginHeader.description": "Set the conditions to apply to filter the entries",
672
679
  "content-manager.components.FiltersPickWrapper.PluginHeader.title.filter": "Filters",
673
680
  "content-manager.components.FiltersPickWrapper.hide": "Hide",
681
+ "content-manager.components.Filters.usersSelect.label": "Search and select a user to filter by",
674
682
  "content-manager.components.LeftMenu.Search.label": "Search for a content type",
675
683
  "content-manager.components.LeftMenu.collection-types": "Collection Types",
676
684
  "content-manager.components.LeftMenu.single-types": "Single Types",
@@ -914,6 +922,7 @@
914
922
  "global.settings": "Settings",
915
923
  "global.type": "Type",
916
924
  "global.users": "Users",
925
+ "global.fullname": "{firstname} {lastname}",
917
926
  "light": "Light",
918
927
  "notification.contentType.relations.conflict": "Content type has conflicting relations",
919
928
  "notification.default.title": "Information:",
@@ -0,0 +1,15 @@
1
+ import { getYupInnerErrors } from '@strapi/helper-plugin';
2
+
3
+ const checkFormValidity = async (data, schema) => {
4
+ let errors = null;
5
+
6
+ try {
7
+ await schema.validate(data, { abortEarly: false });
8
+ } catch (err) {
9
+ errors = getYupInnerErrors(err);
10
+ }
11
+
12
+ return errors;
13
+ };
14
+
15
+ export default checkFormValidity;
@@ -29,11 +29,7 @@ const LazyCompo = ({ loadComponent }) => {
29
29
  return <LoadingIndicatorPage />;
30
30
  };
31
31
 
32
- LazyCompo.propTypes = {
33
- loadComponent: PropTypes.func.isRequired,
34
- };
35
-
36
- export const createRoute = (Component, to, exact) => {
32
+ const createRoute = (Component, to, exact) => {
37
33
  return (
38
34
  <Route
39
35
  render={() => <LazyCompo loadComponent={Component} />}
@@ -43,3 +39,9 @@ export const createRoute = (Component, to, exact) => {
43
39
  />
44
40
  );
45
41
  };
42
+
43
+ LazyCompo.propTypes = {
44
+ loadComponent: PropTypes.func.isRequired,
45
+ };
46
+
47
+ export default createRoute;
@@ -1,4 +1,4 @@
1
- export const formatAPIErrors = ({ data }) => {
1
+ const formatAPIError = ({ data }) => {
2
2
  try {
3
3
  return Object.keys(data).reduce((acc, current) => {
4
4
  const errorMessage = data[current][0];
@@ -13,3 +13,5 @@ export const formatAPIErrors = ({ data }) => {
13
13
  return {};
14
14
  }
15
15
  };
16
+
17
+ export default formatAPIError;
@@ -0,0 +1,19 @@
1
+ const getAttributesToDisplay = (contentType) => {
2
+ const timestamps = contentType?.options?.timestamps;
3
+
4
+ // Sometimes timestamps is false
5
+ let timestampsArray = Array.isArray(timestamps) ? timestamps : [];
6
+ const idsAttributes = ['id', '_id']; // For both SQL and mongo
7
+ const unwritableAttributes = [...idsAttributes, ...timestampsArray, 'publishedAt'];
8
+ const schemaAttributes = contentType?.attributes ?? {};
9
+
10
+ return Object.keys(schemaAttributes).reduce((acc, current) => {
11
+ if (!unwritableAttributes.includes(current)) {
12
+ acc.push({ ...schemaAttributes[current], attributeName: current });
13
+ }
14
+
15
+ return acc;
16
+ }, []);
17
+ };
18
+
19
+ export default getAttributesToDisplay;