@strapi/admin 4.10.2 → 4.10.5

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 (105) hide show
  1. package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +156 -155
  2. package/admin/src/content-manager/pages/ListSettingsView/{utils/excludedSortOptions.js → constants.js} +1 -1
  3. package/admin/src/content-manager/pages/ListSettingsView/index.js +33 -36
  4. package/admin/src/pages/Admin/index.js +3 -0
  5. package/admin/src/pages/AuthPage/components/Register/index.js +1 -1
  6. package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FilterSelect.js +1 -1
  7. package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +52 -41
  8. package/admin/src/pages/MarketplacePage/components/SortSelect/index.js +16 -0
  9. package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +2 -2
  10. package/admin/src/translations/en.json +1 -0
  11. package/admin/src/translations/ru.json +7 -0
  12. package/build/{1387.84b454d3.chunk.js → 1387.437eb420.chunk.js} +1 -1
  13. package/build/{1657.45231968.chunk.js → 1657.85034334.chunk.js} +52 -52
  14. package/build/3081.c2cdfac8.chunk.js +108 -0
  15. package/build/3816.1a828046.chunk.js +211 -0
  16. package/build/462.a073ff1f.chunk.js +71 -0
  17. package/build/{4628.20631dd1.chunk.js → 4628.9cbb6df5.chunk.js} +1 -1
  18. package/build/5542.002522eb.chunk.js +71 -0
  19. package/build/{5563.986609ed.chunk.js → 5563.44e0ef15.chunk.js} +22 -22
  20. package/build/617.2c8c7183.chunk.js +155 -0
  21. package/build/{6858.56d4d528.chunk.js → 6858.85d76858.chunk.js} +6 -6
  22. package/build/6970.e8422af3.chunk.js +1 -0
  23. package/build/{7259.7a48aa2f.chunk.js → 7259.3ed2b60e.chunk.js} +1 -1
  24. package/build/{Admin-authenticatedApp.a8373103.chunk.js → Admin-authenticatedApp.6b74c5fd.chunk.js} +2 -2
  25. package/build/Admin_homePage.e15dcf28.chunk.js +73 -0
  26. package/build/Admin_marketplace.87f51b29.chunk.js +55 -0
  27. package/build/Admin_pluginsPage.7df6b5a9.chunk.js +6 -0
  28. package/build/{Admin_profilePage.1b337b73.chunk.js → Admin_profilePage.1687246a.chunk.js} +1 -1
  29. package/build/Admin_settingsPage.20884a40.chunk.js +79 -0
  30. package/build/Upload_ConfigureTheView.aa64ed9a.chunk.js +1 -0
  31. package/build/{admin-app.9bfe4ec7.chunk.js → admin-app.d4fd9379.chunk.js} +4 -4
  32. package/build/{admin-edit-roles-page.d0c9497b.chunk.js → admin-edit-roles-page.6fe9de49.chunk.js} +43 -41
  33. package/build/{admin-edit-users.ba27c532.chunk.js → admin-edit-users.49363035.chunk.js} +4 -4
  34. package/build/admin-roles-list.a323aa9f.chunk.js +31 -0
  35. package/build/admin-users.16bb6e77.chunk.js +34 -0
  36. package/build/audit-logs-settings-page.7ec976e1.chunk.js +129 -0
  37. package/build/content-manager.a97db8a1.chunk.js +1123 -0
  38. package/build/content-type-builder-list-view.1e821eb9.chunk.js +215 -0
  39. package/build/{content-type-builder-translation-en-json.446b611d.chunk.js → content-type-builder-translation-en-json.5e5f8607.chunk.js} +1 -1
  40. package/build/{content-type-builder.4737a30c.chunk.js → content-type-builder.51c64fe5.chunk.js} +4 -4
  41. package/build/email-settings-page.dba83275.chunk.js +11 -0
  42. package/build/en-json.1f6af924.chunk.js +1 -0
  43. package/build/i18n-settings-page.e34ec940.chunk.js +114 -0
  44. package/build/i18n-translation-ru-json.401bc498.chunk.js +1 -0
  45. package/build/index.html +1 -1
  46. package/build/main.57970a57.js +2674 -0
  47. package/build/review-workflows-settings.26409ce4.chunk.js +61 -0
  48. package/build/ru-json.678cd48b.chunk.js +1 -0
  49. package/build/{runtime~main.c20330f1.js → runtime~main.df78e1c7.js} +2 -2
  50. package/build/{sso-settings-page.f44d95d8.chunk.js → sso-settings-page.c9d7c8df.chunk.js} +1 -1
  51. package/build/upload-settings.63d99bf5.chunk.js +14 -0
  52. package/build/upload.bf183c0c.chunk.js +34 -0
  53. package/build/users-advanced-settings-page.4f49ca57.chunk.js +9 -0
  54. package/build/users-email-settings-page.756aa7ab.chunk.js +24 -0
  55. package/build/users-permissions-translation-ru-json.8e883c67.chunk.js +1 -0
  56. package/build/users-providers-settings-page.ff9e4c0a.chunk.js +29 -0
  57. package/build/webhook-edit-page.550be445.chunk.js +128 -0
  58. package/build/webhook-list-page.0983d83f.chunk.js +71 -0
  59. package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStageEE.js +12 -1
  60. package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +6 -1
  61. package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +4 -1
  62. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +10 -7
  63. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/components/OptionColor/OptionColor.js +11 -1
  64. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/components/SingleValueColor/SingleValueColor.js +14 -1
  65. package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/colors.js +7 -1
  66. package/ee/server/routes/audit-logs.js +43 -0
  67. package/ee/server/routes/index.js +5 -226
  68. package/ee/server/routes/license-limit.js +29 -0
  69. package/ee/server/routes/review-workflows.js +112 -0
  70. package/ee/server/routes/sso.js +60 -0
  71. package/ee/server/routes/utils.js +15 -0
  72. package/package.json +16 -16
  73. package/server/routes/index.js +16 -11
  74. package/webpack.alias.js +0 -1
  75. package/admin/src/content-manager/pages/ListSettingsView/utils/api.js +0 -10
  76. package/build/3081.bcf9a12f.chunk.js +0 -108
  77. package/build/462.8fff7f3b.chunk.js +0 -71
  78. package/build/5542.b8240e3f.chunk.js +0 -70
  79. package/build/6404.68405699.chunk.js +0 -100
  80. package/build/7725.1633e06f.chunk.js +0 -213
  81. package/build/9703.e590889d.chunk.js +0 -1
  82. package/build/Admin_homePage.9f7c0bb1.chunk.js +0 -73
  83. package/build/Admin_marketplace.a60cde15.chunk.js +0 -31
  84. package/build/Admin_pluginsPage.9e6fa51c.chunk.js +0 -6
  85. package/build/Admin_settingsPage.5e045f42.chunk.js +0 -79
  86. package/build/Upload_ConfigureTheView.4fc648b5.chunk.js +0 -1
  87. package/build/admin-roles-list.c759daa3.chunk.js +0 -31
  88. package/build/admin-users.ad5dd832.chunk.js +0 -34
  89. package/build/audit-logs-settings-page.45cb4fb5.chunk.js +0 -76
  90. package/build/content-manager.d28eb183.chunk.js +0 -1111
  91. package/build/content-type-builder-list-view.5ff685ec.chunk.js +0 -214
  92. package/build/email-settings-page.dc07d518.chunk.js +0 -10
  93. package/build/en-json.c7fc79af.chunk.js +0 -1
  94. package/build/i18n-settings-page.8219dd99.chunk.js +0 -60
  95. package/build/main.41970e4c.js +0 -2597
  96. package/build/review-workflows-settings.7c0b4e73.chunk.js +0 -61
  97. package/build/ru-json.e0662702.chunk.js +0 -1
  98. package/build/upload-settings.dd2d987c.chunk.js +0 -13
  99. package/build/upload.c8479232.chunk.js +0 -33
  100. package/build/users-advanced-settings-page.c36cfd59.chunk.js +0 -8
  101. package/build/users-email-settings-page.2716ce8e.chunk.js +0 -23
  102. package/build/users-permissions-translation-ru-json.20e177db.chunk.js +0 -1
  103. package/build/users-providers-settings-page.0d6304a5.chunk.js +0 -28
  104. package/build/webhook-edit-page.f4db86f3.chunk.js +0 -75
  105. package/build/webhook-list-page.30d73114.chunk.js +0 -71
@@ -3,10 +3,21 @@ import PropTypes from 'prop-types';
3
3
  import { Box, Flex, Typography } from '@strapi/design-system';
4
4
  import { pxToRem } from '@strapi/helper-plugin';
5
5
 
6
+ import { getStageColorByHex } from '../../../../../pages/SettingsPage/pages/ReviewWorkflows/utils/colors';
7
+
6
8
  export function ReviewWorkflowsStageEE({ color, name }) {
9
+ const { themeColorName } = getStageColorByHex(color);
10
+
7
11
  return (
8
12
  <Flex alignItems="center" gap={2} maxWidth={pxToRem(300)}>
9
- <Box height={2} background={color} hasRadius shrink={0} width={2} />
13
+ <Box
14
+ height={2}
15
+ background={color}
16
+ borderColor={themeColorName === 'neutral0' ? 'neutral150' : 'transparent'}
17
+ hasRadius
18
+ shrink={0}
19
+ width={2}
20
+ />
10
21
 
11
22
  <Typography fontWeight="regular" textColor="neutral700" ellipsis>
12
23
  {name}
@@ -34,7 +34,12 @@ export default (layout) => {
34
34
  }),
35
35
  searchable: false,
36
36
  sortable: true,
37
- mainField: 'name',
37
+ mainField: {
38
+ name: 'name',
39
+ schema: {
40
+ type: 'string',
41
+ },
42
+ },
38
43
  },
39
44
  cellFormatter({ strapi_reviewWorkflows_stage }) {
40
45
  // if entities are created e.g. through lifecycle methods
@@ -63,7 +63,10 @@ export function InformationBoxEE() {
63
63
  onSuccess() {
64
64
  toggleNotification({
65
65
  type: 'success',
66
- message: { id: 'notification.success.saved', defaultMessage: 'Saved' },
66
+ message: {
67
+ id: 'content-manager.reviewWorkflows.stage.notification.saved',
68
+ defaultMessage: 'Success: Review stage updated',
69
+ },
67
70
  });
68
71
  },
69
72
  }
@@ -20,6 +20,7 @@ import {
20
20
  } from '@strapi/design-system';
21
21
  import { ReactSelect, useTracking } from '@strapi/helper-plugin';
22
22
  import { Drag, Trash } from '@strapi/icons';
23
+ import { getEmptyImage } from 'react-dnd-html5-backend';
23
24
 
24
25
  import { deleteStage, updateStagePosition, updateStage } from '../../../actions';
25
26
  import { getAvailableStageColors } from '../../../utils/colors';
@@ -144,9 +145,8 @@ export function Stage({
144
145
  const [isOpen, setIsOpen] = React.useState(isOpenDefault);
145
146
  const [nameField, nameMeta] = useField(`stages.${index}.name`);
146
147
  const [colorField, colorMeta] = useField(`stages.${index}.color`);
147
- const [{ handlerId, isDragging, handleKeyDown }, stageRef, dropRef, dragRef] = useDragAndDrop(
148
- canReorder,
149
- {
148
+ const [{ handlerId, isDragging, handleKeyDown }, stageRef, dropRef, dragRef, dragPreviewRef] =
149
+ useDragAndDrop(canReorder, {
150
150
  index,
151
151
  item: {
152
152
  name: nameField.value,
@@ -156,8 +156,7 @@ export function Stage({
156
156
  onMoveItem: handleMoveStage,
157
157
  onCancel: handleCancelDragStage,
158
158
  type: DRAG_DROP_TYPES.STAGE,
159
- }
160
- );
159
+ });
161
160
 
162
161
  const composedRef = composeRefs(stageRef, dropRef);
163
162
 
@@ -176,6 +175,10 @@ export function Stage({
176
175
  // the admin API
177
176
  const colorValue = colorOptions.find(({ value }) => value === colorField.value.toUpperCase());
178
177
 
178
+ React.useEffect(() => {
179
+ dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
180
+ }, [dragPreviewRef, index]);
181
+
179
182
  return (
180
183
  <Box ref={composedRef}>
181
184
  {liveText && <VisuallyHidden aria-live="assertive">{liveText}</VisuallyHidden>}
@@ -200,7 +203,7 @@ export function Stage({
200
203
  title={nameField.value}
201
204
  togglePosition="left"
202
205
  action={
203
- <>
206
+ <Flex>
204
207
  {canDelete && (
205
208
  <IconButton
206
209
  background="transparent"
@@ -231,7 +234,7 @@ export function Stage({
231
234
  >
232
235
  <Drag />
233
236
  </IconButton>
234
- </>
237
+ </Flex>
235
238
  }
236
239
  />
237
240
  <AccordionContent padding={6} background="neutral0" hasRadius>
@@ -3,13 +3,23 @@ import PropTypes from 'prop-types';
3
3
  import { components } from 'react-select';
4
4
  import { Flex, Typography } from '@strapi/design-system';
5
5
 
6
+ import { getStageColorByHex } from '../../../../../utils/colors';
7
+
6
8
  export function OptionColor({ children, ...props }) {
7
9
  const { color } = props.data;
10
+ const { themeColorName } = getStageColorByHex(color);
8
11
 
9
12
  return (
10
13
  <components.Option {...props}>
11
14
  <Flex alignItems="center" gap={2}>
12
- <Flex height={2} background={color} hasRadius shrink={0} width={2} />
15
+ <Flex
16
+ height={2}
17
+ background={color}
18
+ borderColor={themeColorName === 'neutral0' ? 'neutral150' : 'transparent'}
19
+ hasRadius
20
+ shrink={0}
21
+ width={2}
22
+ />
13
23
 
14
24
  <Typography textColor="neutral800" ellipsis>
15
25
  {children}
@@ -3,13 +3,26 @@ import PropTypes from 'prop-types';
3
3
  import { components } from 'react-select';
4
4
  import { Flex, Typography } from '@strapi/design-system';
5
5
 
6
+ import { getStageColorByHex } from '../../../../../utils/colors';
7
+
6
8
  export function SingleValueColor({ children, ...props }) {
7
9
  const { color } = props.data;
10
+ // in case an entity was not assigned to a stage (which displays an error)
11
+ // there is no color to display and we have to make sure the component does
12
+ // not crash
13
+ const { themeColorName } = color ? getStageColorByHex(color) : {};
8
14
 
9
15
  return (
10
16
  <components.SingleValue {...props}>
11
17
  <Flex alignItems="center" gap={2}>
12
- <Flex height={2} background={color} hasRadius shrink={0} width={2} />
18
+ <Flex
19
+ height={2}
20
+ background={color}
21
+ borderColor={themeColorName === 'neutral0' ? 'neutral150' : 'transparent'}
22
+ hasRadius
23
+ shrink={0}
24
+ width={2}
25
+ />
13
26
 
14
27
  <Typography textColor="neutral800" ellipsis>
15
28
  {children}
@@ -3,10 +3,16 @@ import { lightTheme } from '@strapi/design-system';
3
3
  import { STAGE_COLORS } from '../constants';
4
4
 
5
5
  export function getStageColorByHex(hex) {
6
+ if (!hex) {
7
+ return null;
8
+ }
9
+
6
10
  // there are multiple colors with the same hex code in the design tokens. In order to find
7
11
  // the correct one we have to find all matching colors and then check, which ones are usable
8
12
  // for stages.
9
- const themeColors = Object.entries(lightTheme.colors).filter(([, value]) => value === hex);
13
+ const themeColors = Object.entries(lightTheme.colors).filter(
14
+ ([, value]) => value.toUpperCase() === hex.toUpperCase()
15
+ );
10
16
  const themeColorName = themeColors.reduce((acc, [name]) => {
11
17
  if (STAGE_COLORS?.[name]) {
12
18
  acc = name;
@@ -0,0 +1,43 @@
1
+ 'use strict';
2
+
3
+ const { enableFeatureMiddleware } = require('./utils');
4
+
5
+ module.exports = {
6
+ type: 'admin',
7
+ routes: [
8
+ {
9
+ method: 'GET',
10
+ path: '/audit-logs',
11
+ handler: 'auditLogs.findMany',
12
+ config: {
13
+ middlewares: [enableFeatureMiddleware('audit-logs')],
14
+ policies: [
15
+ 'admin::isAuthenticatedAdmin',
16
+ {
17
+ name: 'admin::hasPermissions',
18
+ config: {
19
+ actions: ['admin::audit-logs.read'],
20
+ },
21
+ },
22
+ ],
23
+ },
24
+ },
25
+ {
26
+ method: 'GET',
27
+ path: '/audit-logs/:id',
28
+ handler: 'auditLogs.findOne',
29
+ config: {
30
+ middlewares: [enableFeatureMiddleware('audit-logs')],
31
+ policies: [
32
+ 'admin::isAuthenticatedAdmin',
33
+ {
34
+ name: 'admin::hasPermissions',
35
+ config: {
36
+ actions: ['admin::audit-logs.read'],
37
+ },
38
+ },
39
+ ],
40
+ },
41
+ },
42
+ ],
43
+ };
@@ -1,229 +1,8 @@
1
1
  'use strict';
2
2
 
3
- const { features } = require('@strapi/strapi/lib/utils/ee');
4
-
5
- const enableFeatureMiddleware = (featureName) => (ctx, next) => {
6
- if (features.isEnabled(featureName)) {
7
- return next();
8
- }
9
-
10
- ctx.status = 404;
3
+ module.exports = {
4
+ sso: require('./sso'),
5
+ 'license-limit': require('./license-limit'),
6
+ 'audit-logs': require('./audit-logs'),
7
+ 'review-workflows': require('./review-workflows'),
11
8
  };
12
-
13
- module.exports = [
14
- // SSO
15
- {
16
- method: 'GET',
17
- path: '/providers',
18
- handler: 'authentication.getProviders',
19
- config: {
20
- middlewares: [enableFeatureMiddleware('sso')],
21
- auth: false,
22
- },
23
- },
24
- {
25
- method: 'GET',
26
- path: '/connect/:provider',
27
- handler: 'authentication.providerLogin',
28
- config: {
29
- middlewares: [enableFeatureMiddleware('sso')],
30
- auth: false,
31
- },
32
- },
33
- {
34
- method: 'POST',
35
- path: '/connect/:provider',
36
- handler: 'authentication.providerLogin',
37
- config: {
38
- middlewares: [enableFeatureMiddleware('sso')],
39
- auth: false,
40
- },
41
- },
42
- {
43
- method: 'GET',
44
- path: '/providers/options',
45
- handler: 'authentication.getProviderLoginOptions',
46
- config: {
47
- middlewares: [enableFeatureMiddleware('sso')],
48
- policies: [
49
- 'admin::isAuthenticatedAdmin',
50
- { name: 'admin::hasPermissions', config: { actions: ['admin::provider-login.read'] } },
51
- ],
52
- },
53
- },
54
- {
55
- method: 'PUT',
56
- path: '/providers/options',
57
- handler: 'authentication.updateProviderLoginOptions',
58
- config: {
59
- middlewares: [enableFeatureMiddleware('sso')],
60
- policies: [
61
- 'admin::isAuthenticatedAdmin',
62
- { name: 'admin::hasPermissions', config: { actions: ['admin::provider-login.update'] } },
63
- ],
64
- },
65
- },
66
-
67
- // Audit logs
68
- {
69
- method: 'GET',
70
- path: '/audit-logs',
71
- handler: 'auditLogs.findMany',
72
- config: {
73
- middlewares: [enableFeatureMiddleware('audit-logs')],
74
- policies: [
75
- 'admin::isAuthenticatedAdmin',
76
- {
77
- name: 'admin::hasPermissions',
78
- config: {
79
- actions: ['admin::audit-logs.read'],
80
- },
81
- },
82
- ],
83
- },
84
- },
85
- {
86
- method: 'GET',
87
- path: '/audit-logs/:id',
88
- handler: 'auditLogs.findOne',
89
- config: {
90
- middlewares: [enableFeatureMiddleware('audit-logs')],
91
- policies: [
92
- 'admin::isAuthenticatedAdmin',
93
- {
94
- name: 'admin::hasPermissions',
95
- config: {
96
- actions: ['admin::audit-logs.read'],
97
- },
98
- },
99
- ],
100
- },
101
- },
102
-
103
- // License limit infos
104
- {
105
- method: 'GET',
106
- path: '/license-limit-information',
107
- handler: 'admin.licenseLimitInformation',
108
- config: {
109
- policies: [
110
- 'admin::isAuthenticatedAdmin',
111
- {
112
- name: 'admin::hasPermissions',
113
- config: {
114
- actions: [
115
- 'admin::users.create',
116
- 'admin::users.read',
117
- 'admin::users.update',
118
- 'admin::users.delete',
119
- ],
120
- },
121
- },
122
- ],
123
- },
124
- },
125
-
126
- // Review workflow
127
- {
128
- method: 'GET',
129
- path: '/review-workflows/workflows',
130
- handler: 'workflows.find',
131
- config: {
132
- middlewares: [enableFeatureMiddleware('review-workflows')],
133
- policies: [
134
- 'admin::isAuthenticatedAdmin',
135
- {
136
- name: 'admin::hasPermissions',
137
- config: {
138
- actions: ['admin::review-workflows.read'],
139
- },
140
- },
141
- ],
142
- },
143
- },
144
- {
145
- method: 'GET',
146
- path: '/review-workflows/workflows/:id',
147
- handler: 'workflows.findById',
148
- config: {
149
- middlewares: [enableFeatureMiddleware('review-workflows')],
150
- policies: [
151
- 'admin::isAuthenticatedAdmin',
152
- {
153
- name: 'admin::hasPermissions',
154
- config: {
155
- actions: ['admin::review-workflows.read'],
156
- },
157
- },
158
- ],
159
- },
160
- },
161
- {
162
- method: 'GET',
163
- path: '/review-workflows/workflows/:workflow_id/stages',
164
- handler: 'stages.find',
165
- config: {
166
- middlewares: [enableFeatureMiddleware('review-workflows')],
167
- policies: [
168
- 'admin::isAuthenticatedAdmin',
169
- {
170
- name: 'admin::hasPermissions',
171
- config: {
172
- actions: ['admin::review-workflows.read'],
173
- },
174
- },
175
- ],
176
- },
177
- },
178
- {
179
- method: 'PUT',
180
- path: '/review-workflows/workflows/:workflow_id/stages',
181
- handler: 'stages.replace',
182
- config: {
183
- middlewares: [enableFeatureMiddleware('review-workflows')],
184
- policies: [
185
- 'admin::isAuthenticatedAdmin',
186
- {
187
- name: 'admin::hasPermissions',
188
- config: {
189
- actions: ['admin::review-workflows.read'],
190
- },
191
- },
192
- ],
193
- },
194
- },
195
- {
196
- method: 'GET',
197
- path: '/review-workflows/workflows/:workflow_id/stages/:id',
198
- handler: 'stages.findById',
199
- config: {
200
- middlewares: [enableFeatureMiddleware('review-workflows')],
201
- policies: [
202
- 'admin::isAuthenticatedAdmin',
203
- {
204
- name: 'admin::hasPermissions',
205
- config: {
206
- actions: ['admin::review-workflows.read'],
207
- },
208
- },
209
- ],
210
- },
211
- },
212
- {
213
- method: 'PUT',
214
- path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',
215
- handler: 'stages.updateEntity',
216
- config: {
217
- middlewares: [enableFeatureMiddleware('review-workflows')],
218
- policies: [
219
- 'admin::isAuthenticatedAdmin',
220
- {
221
- name: 'admin::hasPermissions',
222
- config: {
223
- actions: ['admin::review-workflows.read'],
224
- },
225
- },
226
- ],
227
- },
228
- },
229
- ];
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ type: 'admin',
5
+ routes: [
6
+ // License limit infos
7
+ {
8
+ method: 'GET',
9
+ path: '/license-limit-information',
10
+ handler: 'admin.licenseLimitInformation',
11
+ config: {
12
+ policies: [
13
+ 'admin::isAuthenticatedAdmin',
14
+ {
15
+ name: 'admin::hasPermissions',
16
+ config: {
17
+ actions: [
18
+ 'admin::users.create',
19
+ 'admin::users.read',
20
+ 'admin::users.update',
21
+ 'admin::users.delete',
22
+ ],
23
+ },
24
+ },
25
+ ],
26
+ },
27
+ },
28
+ ],
29
+ };
@@ -0,0 +1,112 @@
1
+ 'use strict';
2
+
3
+ const { enableFeatureMiddleware } = require('./utils');
4
+
5
+ module.exports = {
6
+ type: 'admin',
7
+ routes: [
8
+ // Review workflow
9
+ {
10
+ method: 'GET',
11
+ path: '/review-workflows/workflows',
12
+ handler: 'workflows.find',
13
+ config: {
14
+ middlewares: [enableFeatureMiddleware('review-workflows')],
15
+ policies: [
16
+ 'admin::isAuthenticatedAdmin',
17
+ {
18
+ name: 'admin::hasPermissions',
19
+ config: {
20
+ actions: ['admin::review-workflows.read'],
21
+ },
22
+ },
23
+ ],
24
+ },
25
+ },
26
+ {
27
+ method: 'GET',
28
+ path: '/review-workflows/workflows/:id',
29
+ handler: 'workflows.findById',
30
+ config: {
31
+ middlewares: [enableFeatureMiddleware('review-workflows')],
32
+ policies: [
33
+ 'admin::isAuthenticatedAdmin',
34
+ {
35
+ name: 'admin::hasPermissions',
36
+ config: {
37
+ actions: ['admin::review-workflows.read'],
38
+ },
39
+ },
40
+ ],
41
+ },
42
+ },
43
+ {
44
+ method: 'GET',
45
+ path: '/review-workflows/workflows/:workflow_id/stages',
46
+ handler: 'stages.find',
47
+ config: {
48
+ middlewares: [enableFeatureMiddleware('review-workflows')],
49
+ policies: [
50
+ 'admin::isAuthenticatedAdmin',
51
+ {
52
+ name: 'admin::hasPermissions',
53
+ config: {
54
+ actions: ['admin::review-workflows.read'],
55
+ },
56
+ },
57
+ ],
58
+ },
59
+ },
60
+ {
61
+ method: 'PUT',
62
+ path: '/review-workflows/workflows/:workflow_id/stages',
63
+ handler: 'stages.replace',
64
+ config: {
65
+ middlewares: [enableFeatureMiddleware('review-workflows')],
66
+ policies: [
67
+ 'admin::isAuthenticatedAdmin',
68
+ {
69
+ name: 'admin::hasPermissions',
70
+ config: {
71
+ actions: ['admin::review-workflows.read'],
72
+ },
73
+ },
74
+ ],
75
+ },
76
+ },
77
+ {
78
+ method: 'GET',
79
+ path: '/review-workflows/workflows/:workflow_id/stages/:id',
80
+ handler: 'stages.findById',
81
+ config: {
82
+ middlewares: [enableFeatureMiddleware('review-workflows')],
83
+ policies: [
84
+ 'admin::isAuthenticatedAdmin',
85
+ {
86
+ name: 'admin::hasPermissions',
87
+ config: {
88
+ actions: ['admin::review-workflows.read'],
89
+ },
90
+ },
91
+ ],
92
+ },
93
+ },
94
+ {
95
+ method: 'PUT',
96
+ path: '/content-manager/(collection|single)-types/:model_uid/:id/stage',
97
+ handler: 'stages.updateEntity',
98
+ config: {
99
+ middlewares: [enableFeatureMiddleware('review-workflows')],
100
+ policies: [
101
+ 'admin::isAuthenticatedAdmin',
102
+ {
103
+ name: 'admin::hasPermissions',
104
+ config: {
105
+ actions: ['admin::review-workflows.read'],
106
+ },
107
+ },
108
+ ],
109
+ },
110
+ },
111
+ ],
112
+ };
@@ -0,0 +1,60 @@
1
+ 'use strict';
2
+
3
+ const { enableFeatureMiddleware } = require('./utils');
4
+
5
+ module.exports = {
6
+ type: 'admin',
7
+ routes: [
8
+ {
9
+ method: 'GET',
10
+ path: '/providers',
11
+ handler: 'authentication.getProviders',
12
+ config: {
13
+ middlewares: [enableFeatureMiddleware('sso')],
14
+ auth: false,
15
+ },
16
+ },
17
+ {
18
+ method: 'GET',
19
+ path: '/connect/:provider',
20
+ handler: 'authentication.providerLogin',
21
+ config: {
22
+ middlewares: [enableFeatureMiddleware('sso')],
23
+ auth: false,
24
+ },
25
+ },
26
+ {
27
+ method: 'POST',
28
+ path: '/connect/:provider',
29
+ handler: 'authentication.providerLogin',
30
+ config: {
31
+ middlewares: [enableFeatureMiddleware('sso')],
32
+ auth: false,
33
+ },
34
+ },
35
+ {
36
+ method: 'GET',
37
+ path: '/providers/options',
38
+ handler: 'authentication.getProviderLoginOptions',
39
+ config: {
40
+ middlewares: [enableFeatureMiddleware('sso')],
41
+ policies: [
42
+ 'admin::isAuthenticatedAdmin',
43
+ { name: 'admin::hasPermissions', config: { actions: ['admin::provider-login.read'] } },
44
+ ],
45
+ },
46
+ },
47
+ {
48
+ method: 'PUT',
49
+ path: '/providers/options',
50
+ handler: 'authentication.updateProviderLoginOptions',
51
+ config: {
52
+ middlewares: [enableFeatureMiddleware('sso')],
53
+ policies: [
54
+ 'admin::isAuthenticatedAdmin',
55
+ { name: 'admin::hasPermissions', config: { actions: ['admin::provider-login.update'] } },
56
+ ],
57
+ },
58
+ },
59
+ ],
60
+ };
@@ -0,0 +1,15 @@
1
+ 'use strict';
2
+
3
+ const { features } = require('@strapi/strapi/lib/utils/ee');
4
+
5
+ const enableFeatureMiddleware = (featureName) => (ctx, next) => {
6
+ if (features.isEnabled(featureName)) {
7
+ return next();
8
+ }
9
+
10
+ ctx.status = 404;
11
+ };
12
+
13
+ module.exports = {
14
+ enableFeatureMiddleware,
15
+ };