@strapi/admin 4.10.2 → 4.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/admin/src/content-manager/components/Wysiwyg/WysiwygNav.js +156 -155
- package/admin/src/content-manager/pages/ListSettingsView/{utils/excludedSortOptions.js → constants.js} +1 -1
- package/admin/src/content-manager/pages/ListSettingsView/index.js +33 -36
- package/admin/src/pages/Admin/index.js +3 -0
- package/admin/src/pages/AuthPage/components/Register/index.js +1 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FilterSelect.js +1 -1
- package/admin/src/pages/MarketplacePage/components/NpmPackagesFilters/FiltersPopover.js +52 -41
- package/admin/src/pages/MarketplacePage/components/SortSelect/index.js +16 -0
- package/admin/src/pages/SettingsPage/pages/Users/components/SelectRoles/index.js +2 -2
- package/admin/src/translations/en.json +1 -0
- package/admin/src/translations/ru.json +7 -0
- package/build/{1387.84b454d3.chunk.js → 1387.437eb420.chunk.js} +1 -1
- package/build/{1657.45231968.chunk.js → 1657.85034334.chunk.js} +52 -52
- package/build/3081.c2cdfac8.chunk.js +108 -0
- package/build/3816.2b58bc1a.chunk.js +214 -0
- package/build/462.a073ff1f.chunk.js +71 -0
- package/build/{4628.20631dd1.chunk.js → 4628.9cbb6df5.chunk.js} +1 -1
- package/build/5542.5328b662.chunk.js +71 -0
- package/build/{5563.986609ed.chunk.js → 5563.44e0ef15.chunk.js} +22 -22
- package/build/617.ce23dea8.chunk.js +155 -0
- package/build/{6858.56d4d528.chunk.js → 6858.85d76858.chunk.js} +6 -6
- package/build/6970.e8422af3.chunk.js +1 -0
- package/build/{7259.7a48aa2f.chunk.js → 7259.3ed2b60e.chunk.js} +1 -1
- package/build/{Admin-authenticatedApp.a8373103.chunk.js → Admin-authenticatedApp.dbb99d34.chunk.js} +2 -2
- package/build/Admin_homePage.e15dcf28.chunk.js +73 -0
- package/build/Admin_marketplace.87f51b29.chunk.js +55 -0
- package/build/Admin_pluginsPage.7df6b5a9.chunk.js +6 -0
- package/build/{Admin_profilePage.1b337b73.chunk.js → Admin_profilePage.1687246a.chunk.js} +1 -1
- package/build/Admin_settingsPage.20884a40.chunk.js +79 -0
- package/build/Upload_ConfigureTheView.aa64ed9a.chunk.js +1 -0
- package/build/{admin-app.9bfe4ec7.chunk.js → admin-app.d4fd9379.chunk.js} +4 -4
- package/build/{admin-edit-roles-page.d0c9497b.chunk.js → admin-edit-roles-page.6fe9de49.chunk.js} +43 -41
- package/build/{admin-edit-users.ba27c532.chunk.js → admin-edit-users.49363035.chunk.js} +4 -4
- package/build/admin-roles-list.a323aa9f.chunk.js +31 -0
- package/build/admin-users.16bb6e77.chunk.js +34 -0
- package/build/audit-logs-settings-page.48b921f9.chunk.js +129 -0
- package/build/content-manager.a837bfcd.chunk.js +1123 -0
- package/build/content-type-builder-list-view.1e821eb9.chunk.js +215 -0
- package/build/{content-type-builder-translation-en-json.446b611d.chunk.js → content-type-builder-translation-en-json.5e5f8607.chunk.js} +1 -1
- package/build/{content-type-builder.4737a30c.chunk.js → content-type-builder.51c64fe5.chunk.js} +4 -4
- package/build/email-settings-page.5bc22e5a.chunk.js +11 -0
- package/build/en-json.1f6af924.chunk.js +1 -0
- package/build/i18n-settings-page.1581894e.chunk.js +114 -0
- package/build/i18n-translation-ru-json.401bc498.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/main.31bdf27e.js +2679 -0
- package/build/review-workflows-settings.26409ce4.chunk.js +61 -0
- package/build/ru-json.678cd48b.chunk.js +1 -0
- package/build/{runtime~main.c20330f1.js → runtime~main.a096f3d0.js} +2 -2
- package/build/{sso-settings-page.f44d95d8.chunk.js → sso-settings-page.c9d7c8df.chunk.js} +1 -1
- package/build/upload-settings.4d962053.chunk.js +14 -0
- package/build/upload.4dcd513f.chunk.js +34 -0
- package/build/users-advanced-settings-page.dd2a4954.chunk.js +9 -0
- package/build/users-email-settings-page.510648ab.chunk.js +24 -0
- package/build/users-permissions-translation-ru-json.8e883c67.chunk.js +1 -0
- package/build/users-providers-settings-page.0ee7d54f.chunk.js +29 -0
- package/build/webhook-edit-page.36c9f20d.chunk.js +128 -0
- package/build/webhook-list-page.0983d83f.chunk.js +71 -0
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStageEE.js +12 -1
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +4 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +10 -7
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/components/OptionColor/OptionColor.js +11 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/components/SingleValueColor/SingleValueColor.js +14 -1
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/colors.js +7 -1
- package/ee/server/routes/audit-logs.js +43 -0
- package/ee/server/routes/index.js +5 -226
- package/ee/server/routes/license-limit.js +29 -0
- package/ee/server/routes/review-workflows.js +112 -0
- package/ee/server/routes/sso.js +60 -0
- package/ee/server/routes/utils.js +15 -0
- package/package.json +16 -16
- package/server/routes/index.js +16 -11
- package/webpack.alias.js +0 -1
- package/admin/src/content-manager/pages/ListSettingsView/utils/api.js +0 -10
- package/build/3081.bcf9a12f.chunk.js +0 -108
- package/build/462.8fff7f3b.chunk.js +0 -71
- package/build/5542.b8240e3f.chunk.js +0 -70
- package/build/6404.68405699.chunk.js +0 -100
- package/build/7725.1633e06f.chunk.js +0 -213
- package/build/9703.e590889d.chunk.js +0 -1
- package/build/Admin_homePage.9f7c0bb1.chunk.js +0 -73
- package/build/Admin_marketplace.a60cde15.chunk.js +0 -31
- package/build/Admin_pluginsPage.9e6fa51c.chunk.js +0 -6
- package/build/Admin_settingsPage.5e045f42.chunk.js +0 -79
- package/build/Upload_ConfigureTheView.4fc648b5.chunk.js +0 -1
- package/build/admin-roles-list.c759daa3.chunk.js +0 -31
- package/build/admin-users.ad5dd832.chunk.js +0 -34
- package/build/audit-logs-settings-page.45cb4fb5.chunk.js +0 -76
- package/build/content-manager.d28eb183.chunk.js +0 -1111
- package/build/content-type-builder-list-view.5ff685ec.chunk.js +0 -214
- package/build/email-settings-page.dc07d518.chunk.js +0 -10
- package/build/en-json.c7fc79af.chunk.js +0 -1
- package/build/i18n-settings-page.8219dd99.chunk.js +0 -60
- package/build/main.41970e4c.js +0 -2597
- package/build/review-workflows-settings.7c0b4e73.chunk.js +0 -61
- package/build/ru-json.e0662702.chunk.js +0 -1
- package/build/upload-settings.dd2d987c.chunk.js +0 -13
- package/build/upload.c8479232.chunk.js +0 -33
- package/build/users-advanced-settings-page.c36cfd59.chunk.js +0 -8
- package/build/users-email-settings-page.2716ce8e.chunk.js +0 -23
- package/build/users-permissions-translation-ru-json.20e177db.chunk.js +0 -1
- package/build/users-providers-settings-page.0d6304a5.chunk.js +0 -28
- package/build/webhook-edit-page.f4db86f3.chunk.js +0 -75
- 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
|
|
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}
|
|
@@ -63,7 +63,10 @@ export function InformationBoxEE() {
|
|
|
63
63
|
onSuccess() {
|
|
64
64
|
toggleNotification({
|
|
65
65
|
type: 'success',
|
|
66
|
-
message: {
|
|
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] =
|
|
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
|
|
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
|
|
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(
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
+
};
|