@strapi/admin 4.9.2 → 4.10.0-beta.1
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/DynamicTable/CellContent/PublicationState/PublicationState.js +26 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/index.js +1 -0
- package/admin/src/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +2 -0
- package/admin/src/content-manager/components/DynamicTable/index.js +25 -49
- package/admin/src/content-manager/components/DynamicZone/components/DynamicComponent.js +2 -0
- package/admin/src/content-manager/pages/EditView/Information/index.js +77 -53
- package/admin/src/content-manager/pages/EditView/InformationBox/InformationBoxCE.js +13 -0
- package/admin/src/content-manager/pages/EditView/InformationBox/index.js +3 -0
- package/admin/src/content-manager/pages/EditView/index.js +3 -4
- package/admin/src/content-manager/pages/ListView/index.js +6 -9
- package/admin/src/content-manager/sharedReducers/crudReducer/actions.js +6 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/constants.js +1 -0
- package/admin/src/content-manager/sharedReducers/crudReducer/reducer.js +5 -0
- package/admin/src/index.js +1 -0
- package/admin/src/translations/en.json +6 -0
- package/build/{Admin-authenticatedApp.217db666.chunk.js → Admin-authenticatedApp.52c88751.chunk.js} +2 -2
- package/build/{Admin_settingsPage.1dbfc9ce.chunk.js → Admin_settingsPage.257b3477.chunk.js} +7 -7
- package/build/{admin-app.558af642.chunk.js → admin-app.dfaeea5d.chunk.js} +18 -18
- package/build/content-manager.def692c2.chunk.js +1130 -0
- package/build/content-type-builder-translation-en-json.510e88ca.chunk.js +1 -0
- package/build/content-type-builder.5e1f4afc.chunk.js +126 -0
- package/build/en-json.08303b37.chunk.js +1 -0
- package/build/index.html +1 -1
- package/build/{main.ef8db4a2.js → main.120be100.js} +145 -145
- package/build/review-workflows-settings.9092ed72.chunk.js +106 -0
- package/build/{runtime~main.3a92d953.js → runtime~main.112b3101.js} +1 -1
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/ReviewWorkflowsStageEE.js +15 -0
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn.js +45 -0
- package/ee/admin/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/index.js +3 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/InformationBoxEE.js +135 -0
- package/ee/admin/content-manager/pages/EditView/InformationBox/index.js +3 -0
- package/ee/admin/hooks/useSettingsMenu/utils/customAdminLinks.js +12 -12
- package/ee/admin/hooks/useSettingsMenu/utils/customGlobalLinks.js +21 -13
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/ReviewWorkflows.js +199 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/actions/index.js +42 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/AddStage.js +87 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/AddStage/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/Stage.js +90 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stage/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/Stages.js +92 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/components/Stages/index.js +1 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/constants.js +6 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/hooks/useReviewWorkflows.js +35 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/index.js +3 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/reducer/index.js +122 -0
- package/ee/admin/pages/SettingsPage/pages/ReviewWorkflows/utils/getWorkflowValidationSchema.js +25 -0
- package/ee/admin/pages/SettingsPage/utils/customRoutes.js +16 -2
- package/ee/admin/permissions/customPermissions.js +3 -0
- package/ee/server/bootstrap.js +13 -0
- package/ee/server/config/admin-actions.js +10 -0
- package/ee/server/constants/default-stages.json +14 -0
- package/ee/server/constants/default-workflow.json +1 -0
- package/ee/server/constants/workflows.js +8 -0
- package/ee/server/content-types/index.js +9 -0
- package/ee/server/content-types/workflow/index.js +31 -0
- package/ee/server/content-types/workflow-stage/index.js +36 -0
- package/ee/server/controllers/index.js +2 -0
- package/ee/server/controllers/workflows/index.js +36 -0
- package/ee/server/controllers/workflows/stages/index.js +102 -0
- package/ee/server/index.js +1 -0
- package/ee/server/middlewares/review-workflows.js +40 -0
- package/ee/server/register.js +8 -0
- package/ee/server/routes/index.js +104 -0
- package/ee/server/services/index.js +4 -0
- package/ee/server/services/review-workflows/entity-service-decorator.js +54 -0
- package/ee/server/services/review-workflows/review-workflows.js +111 -0
- package/ee/server/services/review-workflows/stages.js +249 -0
- package/ee/server/services/review-workflows/workflows.js +25 -0
- package/ee/server/utils/index.js +8 -0
- package/ee/server/utils/persisted-tables.js +114 -22
- package/ee/server/utils/review-workflows.js +34 -0
- package/ee/server/validation/review-workflows.js +24 -0
- package/package.json +9 -9
- package/build/content-manager.d1565bfc.chunk.js +0 -1132
- package/build/content-type-builder-translation-en-json.6c8e69ab.chunk.js +0 -1
- package/build/content-type-builder.9d780e7f.chunk.js +0 -126
- package/build/en-json.cf600231.chunk.js +0 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
|
+
import { useIntl } from 'react-intl';
|
|
4
|
+
import { Status, Typography } from '@strapi/design-system';
|
|
5
|
+
|
|
6
|
+
import { getTrad } from '../../../../utils';
|
|
7
|
+
|
|
8
|
+
export function PublicationState({ isPublished }) {
|
|
9
|
+
const { formatMessage } = useIntl();
|
|
10
|
+
const variant = isPublished ? 'success' : 'secondary';
|
|
11
|
+
|
|
12
|
+
return (
|
|
13
|
+
<Status showBullet={false} variant={variant} size="S" width="min-content">
|
|
14
|
+
<Typography fontWeight="bold" textColor={`${variant}700`}>
|
|
15
|
+
{formatMessage({
|
|
16
|
+
id: getTrad(`containers.List.${isPublished ? 'published' : 'draft'}`),
|
|
17
|
+
defaultMessage: isPublished ? 'Published' : 'Draft',
|
|
18
|
+
})}
|
|
19
|
+
</Typography>
|
|
20
|
+
</Status>
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
PublicationState.propTypes = {
|
|
25
|
+
isPublished: PropTypes.bool.isRequired,
|
|
26
|
+
};
|
package/admin/src/content-manager/components/DynamicTable/CellContent/PublicationState/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PublicationState';
|
|
@@ -3,20 +3,15 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { DynamicTable as Table, useStrapiApp } from '@strapi/helper-plugin';
|
|
5
5
|
import { useSelector } from 'react-redux';
|
|
6
|
-
import styled from 'styled-components';
|
|
7
|
-
|
|
8
|
-
import { Status, Typography } from '@strapi/design-system';
|
|
9
6
|
|
|
7
|
+
import getReviewWorkflowsColumn from 'ee_else_ce/content-manager/components/DynamicTable/CellContent/ReviewWorkflowsStage/getTableColumn';
|
|
10
8
|
import { INJECT_COLUMN_IN_TABLE } from '../../../exposedHooks';
|
|
11
9
|
import { selectDisplayedHeaders } from '../../pages/ListView/selectors';
|
|
12
10
|
import { getTrad } from '../../utils';
|
|
13
11
|
import TableRows from './TableRows';
|
|
14
12
|
import ConfirmDialogDeleteAll from './ConfirmDialogDeleteAll';
|
|
15
13
|
import ConfirmDialogDelete from './ConfirmDialogDelete';
|
|
16
|
-
|
|
17
|
-
const StyledStatus = styled(Status)`
|
|
18
|
-
width: min-content;
|
|
19
|
-
`;
|
|
14
|
+
import { PublicationState } from './CellContent/PublicationState/PublicationState';
|
|
20
15
|
|
|
21
16
|
const DynamicTable = ({
|
|
22
17
|
canCreate,
|
|
@@ -31,7 +26,7 @@ const DynamicTable = ({
|
|
|
31
26
|
rows,
|
|
32
27
|
}) => {
|
|
33
28
|
const { runHookWaterfall } = useStrapiApp();
|
|
34
|
-
const hasDraftAndPublish = layout.contentType.options
|
|
29
|
+
const hasDraftAndPublish = layout.contentType.options?.draftAndPublish ?? false;
|
|
35
30
|
const { formatMessage } = useIntl();
|
|
36
31
|
const displayedHeaders = useSelector(selectDisplayedHeaders);
|
|
37
32
|
|
|
@@ -42,43 +37,23 @@ const DynamicTable = ({
|
|
|
42
37
|
});
|
|
43
38
|
|
|
44
39
|
const formattedHeaders = headers.displayedHeaders.map((header) => {
|
|
45
|
-
const { metadatas } = header;
|
|
46
|
-
|
|
47
|
-
if (header.fieldSchema.type === 'relation') {
|
|
48
|
-
const sortFieldValue = `${header.name}.${header.metadatas.mainField.name}`;
|
|
49
|
-
|
|
50
|
-
return {
|
|
51
|
-
...header,
|
|
52
|
-
metadatas: {
|
|
53
|
-
...metadatas,
|
|
54
|
-
label: formatMessage({
|
|
55
|
-
id: getTrad(`containers.ListPage.table-headers.${header.name}`),
|
|
56
|
-
defaultMessage: metadatas.label,
|
|
57
|
-
}),
|
|
58
|
-
},
|
|
59
|
-
name: sortFieldValue,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
40
|
+
const { fieldSchema, metadatas, name } = header;
|
|
62
41
|
|
|
63
42
|
return {
|
|
64
43
|
...header,
|
|
65
44
|
metadatas: {
|
|
66
45
|
...metadatas,
|
|
67
46
|
label: formatMessage({
|
|
68
|
-
id: getTrad(`containers.ListPage.table-headers.${
|
|
47
|
+
id: getTrad(`containers.ListPage.table-headers.${name}`),
|
|
69
48
|
defaultMessage: metadatas.label,
|
|
70
49
|
}),
|
|
71
50
|
},
|
|
51
|
+
name: fieldSchema.type === 'relation' ? `${name}.${metadatas.mainField.name}` : name,
|
|
72
52
|
};
|
|
73
53
|
});
|
|
74
54
|
|
|
75
|
-
if (
|
|
76
|
-
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
return [
|
|
80
|
-
...formattedHeaders,
|
|
81
|
-
{
|
|
55
|
+
if (hasDraftAndPublish) {
|
|
56
|
+
formattedHeaders.push({
|
|
82
57
|
key: '__published_at_temp_key__',
|
|
83
58
|
name: 'publishedAt',
|
|
84
59
|
fieldSchema: {
|
|
@@ -92,23 +67,24 @@ const DynamicTable = ({
|
|
|
92
67
|
searchable: false,
|
|
93
68
|
sortable: true,
|
|
94
69
|
},
|
|
95
|
-
cellFormatter(
|
|
96
|
-
|
|
97
|
-
const variant = isPublished ? 'success' : 'secondary';
|
|
98
|
-
|
|
99
|
-
return (
|
|
100
|
-
<StyledStatus showBullet={false} variant={variant} size="S">
|
|
101
|
-
<Typography fontWeight="bold" textColor={`${variant}700`}>
|
|
102
|
-
{formatMessage({
|
|
103
|
-
id: getTrad(`containers.List.${isPublished ? 'published' : 'draft'}`),
|
|
104
|
-
defaultMessage: isPublished ? 'Published' : 'Draft',
|
|
105
|
-
})}
|
|
106
|
-
</Typography>
|
|
107
|
-
</StyledStatus>
|
|
108
|
-
);
|
|
70
|
+
cellFormatter({ publishedAt }) {
|
|
71
|
+
return <PublicationState isPublished={!!publishedAt} />;
|
|
109
72
|
},
|
|
110
|
-
}
|
|
111
|
-
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// this should not exist. Ideally we would use registerHook() similar to what has been done
|
|
77
|
+
// in the i18n plugin. In order to do that review-workflows should have been a plugin. In
|
|
78
|
+
// a future iteration we need to find a better pattern.
|
|
79
|
+
|
|
80
|
+
// In CE this will return null - in EE a column definition including the custom formatting component.
|
|
81
|
+
const reviewWorkflowColumn = getReviewWorkflowsColumn(layout);
|
|
82
|
+
|
|
83
|
+
if (reviewWorkflowColumn) {
|
|
84
|
+
formattedHeaders.push(reviewWorkflowColumn);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return formattedHeaders;
|
|
112
88
|
}, [runHookWaterfall, displayedHeaders, layout, hasDraftAndPublish, formatMessage]);
|
|
113
89
|
|
|
114
90
|
return (
|
|
@@ -41,6 +41,8 @@ const IconButtonCustom = styled(IconButton)`
|
|
|
41
41
|
}
|
|
42
42
|
`;
|
|
43
43
|
|
|
44
|
+
// TODO: Delete once https://github.com/strapi/design-system/pull/858
|
|
45
|
+
// is merged and released.
|
|
44
46
|
const StyledBox = styled(Box)`
|
|
45
47
|
> div:first-child {
|
|
46
48
|
box-shadow: ${({ theme }) => theme.shadows.tableShadow};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { useRef } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import PropTypes from 'prop-types';
|
|
3
3
|
import { useIntl } from 'react-intl';
|
|
4
4
|
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
|
|
5
5
|
import { Box, Divider, Flex, Typography } from '@strapi/design-system';
|
|
@@ -8,23 +8,44 @@ import { getTrad } from '../../../utils';
|
|
|
8
8
|
import getUnits from './utils/getUnits';
|
|
9
9
|
import { getFullName } from '../../../../utils';
|
|
10
10
|
|
|
11
|
+
const Title = () => {
|
|
12
|
+
const { formatMessage } = useIntl();
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<Flex direction="column" alignItems="stretch" gap={2}>
|
|
16
|
+
<Typography variant="sigma" textColor="neutral600" id="additional-information">
|
|
17
|
+
{formatMessage({
|
|
18
|
+
id: getTrad('containers.Edit.information'),
|
|
19
|
+
defaultMessage: 'Information',
|
|
20
|
+
})}
|
|
21
|
+
</Typography>
|
|
22
|
+
|
|
23
|
+
<Box>
|
|
24
|
+
<Divider />
|
|
25
|
+
</Box>
|
|
26
|
+
</Flex>
|
|
27
|
+
);
|
|
28
|
+
};
|
|
29
|
+
|
|
11
30
|
const KeyValuePair = ({ label, value }) => {
|
|
12
31
|
return (
|
|
13
32
|
<Flex justifyContent="space-between">
|
|
14
|
-
<Typography as="dt" fontWeight="bold" textColor="
|
|
33
|
+
<Typography as="dt" fontWeight="bold" textColor="neutral800" variant="pi">
|
|
15
34
|
{label}
|
|
16
35
|
</Typography>
|
|
17
|
-
<Typography as="dd">
|
|
36
|
+
<Typography as="dd" variant="pi" textColor="neutral600">
|
|
37
|
+
{value}
|
|
38
|
+
</Typography>
|
|
18
39
|
</Flex>
|
|
19
40
|
);
|
|
20
41
|
};
|
|
21
42
|
|
|
22
43
|
KeyValuePair.propTypes = {
|
|
23
|
-
label:
|
|
24
|
-
value:
|
|
44
|
+
label: PropTypes.string.isRequired,
|
|
45
|
+
value: PropTypes.string.isRequired,
|
|
25
46
|
};
|
|
26
47
|
|
|
27
|
-
const
|
|
48
|
+
const Body = () => {
|
|
28
49
|
const { formatMessage, formatRelativeTime } = useIntl();
|
|
29
50
|
const { initialData, isCreatingEntry } = useCMEditViewDataManager();
|
|
30
51
|
const currentTime = useRef(Date.now());
|
|
@@ -49,57 +70,60 @@ const Information = () => {
|
|
|
49
70
|
const created = getFieldInfo('createdAt', 'createdBy');
|
|
50
71
|
|
|
51
72
|
return (
|
|
52
|
-
<Flex direction="column" alignItems="stretch" gap={
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
73
|
+
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
74
|
+
<Flex direction="column" alignItems="stretch" gap={2} as="dl">
|
|
75
|
+
<KeyValuePair
|
|
76
|
+
label={formatMessage({
|
|
77
|
+
id: getTrad('containers.Edit.information.created'),
|
|
78
|
+
defaultMessage: 'Created',
|
|
79
|
+
})}
|
|
80
|
+
value={created.at}
|
|
81
|
+
/>
|
|
59
82
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
83
|
+
<KeyValuePair
|
|
84
|
+
label={formatMessage({
|
|
85
|
+
id: getTrad('containers.Edit.information.by'),
|
|
86
|
+
defaultMessage: 'By',
|
|
87
|
+
})}
|
|
88
|
+
value={created.by}
|
|
89
|
+
/>
|
|
90
|
+
</Flex>
|
|
63
91
|
|
|
64
|
-
<Flex direction="column" alignItems="stretch" gap={
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
/>
|
|
81
|
-
</Flex>
|
|
82
|
-
|
|
83
|
-
<Flex direction="column" alignItems="stretch" gap={2} as="dl">
|
|
84
|
-
<KeyValuePair
|
|
85
|
-
label={formatMessage({
|
|
86
|
-
id: getTrad('containers.Edit.information.lastUpdate'),
|
|
87
|
-
defaultMessage: 'Last update',
|
|
88
|
-
})}
|
|
89
|
-
value={updated.at}
|
|
90
|
-
/>
|
|
91
|
-
|
|
92
|
-
<KeyValuePair
|
|
93
|
-
label={formatMessage({
|
|
94
|
-
id: getTrad('containers.Edit.information.by'),
|
|
95
|
-
defaultMessage: 'By',
|
|
96
|
-
})}
|
|
97
|
-
value={updated.by}
|
|
98
|
-
/>
|
|
99
|
-
</Flex>
|
|
92
|
+
<Flex direction="column" alignItems="stretch" gap={2} as="dl">
|
|
93
|
+
<KeyValuePair
|
|
94
|
+
label={formatMessage({
|
|
95
|
+
id: getTrad('containers.Edit.information.lastUpdate'),
|
|
96
|
+
defaultMessage: 'Last update',
|
|
97
|
+
})}
|
|
98
|
+
value={updated.at}
|
|
99
|
+
/>
|
|
100
|
+
|
|
101
|
+
<KeyValuePair
|
|
102
|
+
label={formatMessage({
|
|
103
|
+
id: getTrad('containers.Edit.information.by'),
|
|
104
|
+
defaultMessage: 'By',
|
|
105
|
+
})}
|
|
106
|
+
value={updated.by}
|
|
107
|
+
/>
|
|
100
108
|
</Flex>
|
|
101
109
|
</Flex>
|
|
102
110
|
);
|
|
103
111
|
};
|
|
104
112
|
|
|
105
|
-
|
|
113
|
+
const Root = ({ children }) => {
|
|
114
|
+
return (
|
|
115
|
+
<Flex direction="column" alignItems="stretch" gap={4}>
|
|
116
|
+
{children}
|
|
117
|
+
</Flex>
|
|
118
|
+
);
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
Root.propTypes = {
|
|
122
|
+
children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default {
|
|
126
|
+
Root,
|
|
127
|
+
Title,
|
|
128
|
+
Body,
|
|
129
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import Information from '../Information';
|
|
4
|
+
|
|
5
|
+
// This component is overwritten by the EE counterpart
|
|
6
|
+
export function InformationBoxCE() {
|
|
7
|
+
return (
|
|
8
|
+
<Information.Root>
|
|
9
|
+
<Information.Title />
|
|
10
|
+
<Information.Body />
|
|
11
|
+
</Information.Root>
|
|
12
|
+
);
|
|
13
|
+
}
|
|
@@ -8,19 +8,18 @@ import {
|
|
|
8
8
|
LoadingIndicatorPage,
|
|
9
9
|
} from '@strapi/helper-plugin';
|
|
10
10
|
import { useIntl } from 'react-intl';
|
|
11
|
-
import { ContentLayout, Box, Grid, GridItem, Main
|
|
11
|
+
import { ContentLayout, Box, Flex, Grid, GridItem, Main } from '@strapi/design-system';
|
|
12
12
|
import { Pencil, Layer } from '@strapi/icons';
|
|
13
|
+
import InformationBox from 'ee_else_ce/content-manager/pages/EditView/InformationBox';
|
|
13
14
|
import { InjectionZone } from '../../../shared/components';
|
|
14
15
|
import permissions from '../../../permissions';
|
|
15
16
|
import DynamicZone from '../../components/DynamicZone';
|
|
16
|
-
|
|
17
17
|
import CollectionTypeFormWrapper from '../../components/CollectionTypeFormWrapper';
|
|
18
18
|
import EditViewDataManagerProvider from '../../components/EditViewDataManagerProvider';
|
|
19
19
|
import SingleTypeFormWrapper from '../../components/SingleTypeFormWrapper';
|
|
20
20
|
import { getTrad } from '../../utils';
|
|
21
21
|
import useLazyComponents from '../../hooks/useLazyComponents';
|
|
22
22
|
import DraftAndPublishBadge from './DraftAndPublishBadge';
|
|
23
|
-
import Information from './Information';
|
|
24
23
|
import Header from './Header';
|
|
25
24
|
import { getFieldsActionMatchingPermissions } from './utils';
|
|
26
25
|
import DeleteLink from './DeleteLink';
|
|
@@ -179,7 +178,7 @@ const EditView = ({ allowedActions, isSingleType, goBack, slug, id, origin, user
|
|
|
179
178
|
paddingTop={6}
|
|
180
179
|
shadow="tableShadow"
|
|
181
180
|
>
|
|
182
|
-
<
|
|
181
|
+
<InformationBox />
|
|
183
182
|
<InjectionZone area="contentManager.editView.informations" />
|
|
184
183
|
</Box>
|
|
185
184
|
<Box as="aside" aria-labelledby="links">
|
|
@@ -6,7 +6,6 @@ import isEqual from 'react-fast-compare';
|
|
|
6
6
|
import { bindActionCreators, compose } from 'redux';
|
|
7
7
|
import { useIntl } from 'react-intl';
|
|
8
8
|
import { useHistory, useLocation, Link as ReactRouterLink } from 'react-router-dom';
|
|
9
|
-
import get from 'lodash/get';
|
|
10
9
|
import { stringify } from 'qs';
|
|
11
10
|
import axios from 'axios';
|
|
12
11
|
|
|
@@ -74,12 +73,11 @@ function ListView({
|
|
|
74
73
|
slug,
|
|
75
74
|
}) {
|
|
76
75
|
const { total } = pagination;
|
|
76
|
+
const { contentType } = layout;
|
|
77
77
|
const {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
},
|
|
82
|
-
} = layout;
|
|
78
|
+
metadatas,
|
|
79
|
+
settings: { bulkable: isBulkable, filterable: isFilterable, searchable: isSearchable },
|
|
80
|
+
} = contentType;
|
|
83
81
|
|
|
84
82
|
const toggleNotification = useNotification();
|
|
85
83
|
const { trackUsage } = useTracking();
|
|
@@ -98,8 +96,7 @@ function ListView({
|
|
|
98
96
|
const { pathname } = useLocation();
|
|
99
97
|
const { push } = useHistory();
|
|
100
98
|
const { formatMessage } = useIntl();
|
|
101
|
-
const
|
|
102
|
-
const hasDraftAndPublish = get(contentType, 'options.draftAndPublish', false);
|
|
99
|
+
const hasDraftAndPublish = contentType.options?.draftAndPublish ?? false;
|
|
103
100
|
const fetchClient = useFetchClient();
|
|
104
101
|
const { post, del } = fetchClient;
|
|
105
102
|
|
|
@@ -137,7 +134,7 @@ function ListView({
|
|
|
137
134
|
return;
|
|
138
135
|
}
|
|
139
136
|
|
|
140
|
-
const resStatus =
|
|
137
|
+
const resStatus = err?.response?.status ?? null;
|
|
141
138
|
|
|
142
139
|
if (resStatus === 403) {
|
|
143
140
|
await fetchPermissionsRef.current();
|
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
GET_DATA,
|
|
3
3
|
GET_DATA_SUCCEEDED,
|
|
4
4
|
INIT_FORM,
|
|
5
|
+
UPDATE_PARTIAL_DATA,
|
|
5
6
|
RESET_PROPS,
|
|
6
7
|
SET_DATA_STRUCTURES,
|
|
7
8
|
SET_STATUS,
|
|
@@ -47,3 +48,8 @@ export const submitSucceeded = (data) => ({
|
|
|
47
48
|
export const clearSetModifiedDataOnly = () => ({
|
|
48
49
|
type: CLEAR_SET_MODIFIED_DATA_ONLY,
|
|
49
50
|
});
|
|
51
|
+
|
|
52
|
+
export const updatePartialData = (data) => ({
|
|
53
|
+
type: UPDATE_PARTIAL_DATA,
|
|
54
|
+
data,
|
|
55
|
+
});
|
|
@@ -7,3 +7,4 @@ export const SET_STATUS = 'ContentManager/CrudReducer/SET_STATUS';
|
|
|
7
7
|
export const SUBMIT_SUCCEEDED = 'ContentManager/CrudReducer/SUBMIT_SUCCEEDED';
|
|
8
8
|
export const CLEAR_SET_MODIFIED_DATA_ONLY =
|
|
9
9
|
'ContentManager/CrudReducer/CLEAR_SET_MODIFIED_DATA_ONLY';
|
|
10
|
+
export const UPDATE_PARTIAL_DATA = 'ContentManager/CrudReducer/PARTIAL_DATA_UPDATE';
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
GET_DATA,
|
|
13
13
|
GET_DATA_SUCCEEDED,
|
|
14
14
|
INIT_FORM,
|
|
15
|
+
UPDATE_PARTIAL_DATA,
|
|
15
16
|
RESET_PROPS,
|
|
16
17
|
SET_DATA_STRUCTURES,
|
|
17
18
|
SET_STATUS,
|
|
@@ -53,6 +54,10 @@ const crudReducer = (state = crudInitialState, action) =>
|
|
|
53
54
|
draftState.data = state.contentTypeDataStructure;
|
|
54
55
|
break;
|
|
55
56
|
}
|
|
57
|
+
case UPDATE_PARTIAL_DATA: {
|
|
58
|
+
draftState.data = { ...state.data, ...action.data };
|
|
59
|
+
break;
|
|
60
|
+
}
|
|
56
61
|
case RESET_PROPS: {
|
|
57
62
|
return crudInitialState;
|
|
58
63
|
}
|
package/admin/src/index.js
CHANGED
|
@@ -219,6 +219,11 @@
|
|
|
219
219
|
"Settings.profile.form.section.experience.title": "Experience",
|
|
220
220
|
"Settings.profile.form.section.helmet.title": "User profile",
|
|
221
221
|
"Settings.profile.form.section.profile.page.title": "Profile page",
|
|
222
|
+
"Settings.review-workflows.page.title": "Review Workflows",
|
|
223
|
+
"Settings.review-workflows.page.subtitle": "{count, plural, one {# stage} other {# stages}}",
|
|
224
|
+
"Settings.review-workflows.page.isLoading": "Workflow is loading",
|
|
225
|
+
"Settings.review-workflows.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the first stage. Are you sure you want to save this?",
|
|
226
|
+
"Settings.review-workflows.stage.name.label": "Stage name",
|
|
222
227
|
"Settings.roles.create.description": "Define the rights given to the role",
|
|
223
228
|
"Settings.roles.create.title": "Create a role",
|
|
224
229
|
"Settings.roles.created": "Role created",
|
|
@@ -803,6 +808,7 @@
|
|
|
803
808
|
"content-manager.relation.notAvailable": "No relations available",
|
|
804
809
|
"content-manager.relation.publicationState.draft": "Draft",
|
|
805
810
|
"content-manager.relation.publicationState.published": "Published",
|
|
811
|
+
"content-manager.reviewWorkflows.stage.label": "Review stage",
|
|
806
812
|
"content-manager.select.currently.selected": "{count} currently selected",
|
|
807
813
|
"content-manager.success.record.delete": "Deleted",
|
|
808
814
|
"content-manager.success.record.publish": "Published",
|
package/build/{Admin-authenticatedApp.217db666.chunk.js → Admin-authenticatedApp.52c88751.chunk.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[801],{29761:function(Q,S,n){n.r(S),n.d(S,{default:function(){return Kt}});var e=n(32735),s=n(43383),O=n(20108),C=n(33795),b=n.n(C),I={i8:"4.
|
|
1
|
+
"use strict";(self.webpackChunk_strapi_admin=self.webpackChunk_strapi_admin||[]).push([[801],{29761:function(Q,S,n){n.r(S),n.d(S,{default:function(){return Kt}});var e=n(32735),s=n(43383),O=n(20108),C=n(33795),b=n.n(C),I=JSON.parse('{"i8":"4.10.0-beta.1"}'),T=n(67927),f=n(53038),y=n(15062),N=n(74506),$=n(51968),z=n(88311),se=n.n(z),xe=n(58107),M=n(8471),be=n(60216),r=n.n(be),B=n(67879),m=n(87933),re=n(71933),V=n(67563),De=n(50563),P=n(72850),H=n(41415),ie=n(35331);const ke=(0,M.ZP)(m.k)`
|
|
2
2
|
position: fixed;
|
|
3
3
|
z-index: 4;
|
|
4
4
|
inset: 0;
|
|
@@ -76,4 +76,4 @@
|
|
|
76
76
|
:hover {
|
|
77
77
|
text-decoration: underline;
|
|
78
78
|
}
|
|
79
|
-
`;var Tt=()=>{const t=(0,e.useRef)(),[a,o]=(0,e.useState)(!1),{formatMessage:i}=(0,B.Z)(),{communityEdition:p}=(0,s.QI)(),d=()=>{o(u=>!u)},h=[...ft,{label:{id:"Settings.application.get-help",defaultMessage:"Get help"},icon:ct.Z,href:p?"https://discord.strapi.io":"https://support.strapi.io/support/home"}];return e.createElement(P.x,{as:"aside",position:"fixed",bottom:2,right:2},e.createElement(Et,{"aria-label":i(a?{id:"app.components.Onboarding.help.button-close",defaultMessage:"Close help menu"}:{id:"app.components.Onboarding.help.button",defaultMessage:"Open help menu"}),onClick:d,ref:t},e.createElement(_.J,{as:a?ie.Z:dt.Z,color:"buttonNeutral0"})),a&&e.createElement(re.h,null,e.createElement(it.M.Content,{padding:0,source:t,placement:"top-end",spacing:12},e.createElement(V.i,{onEscape:d},e.createElement(m.k,{justifyContent:"space-between",paddingBottom:5,paddingRight:6,paddingLeft:6,paddingTop:6},e.createElement(Ce,{fontWeight:"bold"},i({id:"app.components.Onboarding.title",defaultMessage:"Get started videos"})),e.createElement(Te,{as:"a",href:ve.href,target:"_blank",rel:"noreferrer noopener",variant:"pi",textColor:"primary600"},i(ve.label))),e.createElement(ge.i,null),ht.map(({href:u,duration:g,label:c},v)=>e.createElement(vt,{as:"a",href:u,target:"_blank",rel:"noreferrer noopener",key:u,hasRadius:!0,paddingTop:4,paddingBottom:4,paddingLeft:6,paddingRight:11},e.createElement(P.x,{paddingRight:5},e.createElement(E.Z,{textColor:"neutral200",variant:"alpha"},v+1)),e.createElement(P.x,{position:"relative"},e.createElement(Ct,{src:pt,alt:""}),e.createElement(yt,{position:"absolute",top:"50%",left:"50%",background:"primary600",borderRadius:"50%",justifyContent:"center",width:6,height:6},e.createElement(_.J,{as:ut.Z,color:"buttonNeutral0",width:3,height:3}))),e.createElement(m.k,{direction:"column",alignItems:"start",paddingLeft:4},e.createElement(E.Z,{fontWeight:"bold"},i(c)),e.createElement(lt.T,null,":"),e.createElement(E.Z,{textColor:"neutral600",variant:"pi"},g)))),e.createElement(m.k,{direction:"column",alignItems:"stretch",gap:2,paddingLeft:5,paddingTop:2,paddingBottom:5},h.map(({label:u,href:g,icon:c})=>e.createElement(m.k,{gap:3,key:g},e.createElement(_.J,{as:c,color:"primary600"}),e.createElement(Te,{as:"a",href:g,target:"_blank",rel:"noreferrer noopener",variant:"sigma",textColor:"primary700"},i(u)))))))))};const Mt=(0,e.lazy)(()=>Promise.all([n.e(462),n.e(1657),n.e(994)]).then(n.bind(n,30258))),Pt=(0,e.lazy)(()=>n.e(3981).then(n.bind(n,55129))),St=(0,e.lazy)(()=>n.e(3677).then(n.bind(n,15415))),It=(0,e.lazy)(()=>n.e(5516).then(n.bind(n,84538))),Me=(0,e.lazy)(()=>Promise.resolve().then(n.bind(n,53951))),Rt=(0,e.lazy)(()=>n.e(9501).then(n.bind(n,92336))),At=(0,e.lazy)(()=>n.e(9497).then(n.bind(n,9972))),Pe=(0,e.lazy)(()=>n.e(5895).then(n.bind(n,74750))),Ot=()=>{const{trackUsage:t}=(0,s.rS)(),a=(0,y.I0)(),o=(0,y.v9)(i=>i.admin_app.status);(0,e.useEffect)(()=>{o==="init"&&(t("didAccessAuthenticatedAdministration"),a({type:rt.e}))},[o])};var Lt=()=>{Ot();const{isLoading:t,generalSectionLinks:a,pluginsSectionLinks:o}=(0,T.H9)(),{menu:i}=(0,s.j1)(),{showTutorials:p}=(0,T.um)(),d=(0,e.useMemo)(()=>i.filter(h=>h.Component).map(({to:h,Component:u,exact:g})=>(0,q.ot)(u,h,g)),[i]);return t?e.createElement(s.dO,null):e.createElement(N.DndProvider,{backend:$.PD},e.createElement(st,{sideNav:e.createElement(nt,{generalSectionLinks:a,pluginsSectionLinks:o})},e.createElement(e.Suspense,{fallback:e.createElement(s.dO,null)},e.createElement(f.rs,null,e.createElement(f.AW,{path:"/",component:Pt,exact:!0}),e.createElement(f.AW,{path:"/me",component:At,exact:!0}),e.createElement(f.AW,{path:"/content-manager",component:Mt}),d,e.createElement(f.AW,{path:"/settings/:settingId",component:Pe}),e.createElement(f.AW,{path:"/settings",component:Pe,exact:!0}),e.createElement(f.AW,{path:"/marketplace"},e.createElement(It,null)),e.createElement(f.AW,{path:"/list-plugins",exact:!0},e.createElement(St,null)),e.createElement(f.AW,{path:"/404",component:Me}),e.createElement(f.AW,{path:"/500",component:Rt}),e.createElement(f.AW,{path:"",component:Me}))),e.createElement(Ve,null),p&&e.createElement(Tt,null)))},xt=t=>({plugins:Object.keys(t).reduce((a,o)=>(a[o]={...t[o]},a),{})}),bt=n(3040),Dt=n.n(bt);const Se={plugins:null};var kt=(t=Se,a)=>(0,ce.ZP)(t,o=>{switch(a.type){case"SET_PLUGIN_READY":{Dt()(o,["plugins",a.pluginId,"isReady"],!0);break}default:return o}}),Zt=()=>{const{plugins:t}=(0,s.j1)(),[{plugins:a},o]=(0,e.useReducer)(kt,Se,()=>xt(t)),i=(0,e.useRef)(d=>{o({type:"SET_PLUGIN_READY",pluginId:d})});if(Object.keys(a).some(d=>a[d].isReady===!1)){const d=Object.keys(a).reduce((h,u)=>{const g=a[u].initializer;if(g){const c=a[u].pluginId;h.push(e.createElement(g,{key:c,setPlugin:i.current}))}return h},[]);return e.createElement(e.Fragment,null,d,e.createElement(s.dO,null))}return e.createElement(Lt,null)},Ie=n(17367);const Bt=()=>({type:Ie.l}),Wt=t=>({type:Ie.m,permissions:t}),Re=({children:t,permissions:a,refetchPermissions:o})=>{const{allPermissions:i}=(0,y.v9)(d=>d.rbacProvider),p=(0,y.I0)();return(0,e.useEffect)(()=>(p(Wt(a)),()=>{p(Bt())}),[a,p]),i?e.createElement(s.oL.Provider,{value:{allPermissions:i,refetchPermissions:o}},t):e.createElement(s.dO,null)};Re.propTypes={children:r().element.isRequired,permissions:r().array.isRequired,refetchPermissions:r().func.isRequired};var Gt=Re,Nt=n(84306),Ut=n(54770),ee=n.n(Ut),Ae=(t,a)=>!ee().valid(t)||!ee().valid(a)?!1:ee().lt(t,a);const Oe=I.i8,Ft=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),{get:te}=(0,s.tg)(),jt=async t=>{try{const{data:{tag_name:a}}=await Nt.Z.get("https://api.github.com/repos/strapi/strapi/releases/latest");return Ae(Oe,a)&&Ft&&t({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${a}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)}),a}catch{return Oe}},Qt=async()=>{try{const{data:t,headers:a}=await te("/admin/information");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}},$t=async()=>{try{const{data:t,headers:a}=await te("/admin/users/me/permissions");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}},zt=async()=>{try{const{data:{data:{roles:t}}}=await te("/admin/users/me");return t}catch(t){throw new Error(t)}},Le=I.i8;var Kt=()=>{const{setGuidedTourVisibility:t}=(0,s.c1)(),a=(0,s.lm)(),o=(0,e.useRef)(t),i=s.I8.getUserInfo(),p=b()(i,"username")||(0,q.Pp)(i.firstname,i.lastname),[d,h]=(0,e.useState)(p),[u,g]=(0,e.useState)(null),{showReleaseNotification:c}=(0,T.um)(),[{data:v,status:D},{data:L,isLoading:F},{data:G,status:R,refetch:j,isFetched:k,isFetching:x},{data:A}]=(0,O.useQueries)([{queryKey:"app-infos",queryFn:Qt},{queryKey:"strapi-release",queryFn:()=>jt(a),enabled:c,initialData:Le},{queryKey:"admin-users-permission",queryFn:$t,initialData:[]},{queryKey:"user-roles",queryFn:zt}]),l=(0,e.useMemo)(()=>Ae(Le,L),[L]);(0,e.useEffect)(()=>{A&&A.find(({code:oe})=>oe==="strapi-super-admin")&&v?.autoReload&&o.current(!0)},[A,v]),(0,e.useEffect)(()=>{(async()=>{const oe=await(0,q.Qy)(i);g(oe)})()},[i]);const K=F||(x&&k||D==="loading"||R==="loading"),ne=(0,e.useMemo)(()=>({...v,userId:u,latestStrapiReleaseTag:L,setUserDisplayName:h,shouldUpdateStrapi:l,userDisplayName:d}),[v,L,l,d,u]);return K?e.createElement(s.dO,null):D==="error"?e.createElement("div",null,"error..."):e.createElement(s.NY.Provider,{value:ne},e.createElement(Gt,{permissions:G,refetchPermissions:j},e.createElement(Zt,null)))}},78024:function(Q,S,n){var e=n(32735),s=n(60216),O=n.n(s),C=n(43383),b=n(72850),I=n(23678);const T=({type:f,...y})=>e.createElement(b.x,{width:(0,C.Q1)(2),height:"100%",background:f===I.VM?"neutral300":"primary500",hasRadius:!0,...y});T.defaultProps={type:I.VM},T.propTypes={type:O().oneOf([I.lW,I.hx,I.VM])},S.Z=T},14317:function(Q,S,n){var e=n(32735),s=n(60216),O=n.n(s),C=n(43383),b=n(87933),I=n(99140),T=n(49372),f=n(66456),y=n(23678);const N=({type:$,number:z})=>$===y.hx?e.createElement(b.k,{background:"primary600",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(I.J,{as:f.Z,"aria-hidden":!0,width:(0,C.Q1)(16),color:"neutral0"})):$===y.lW?e.createElement(b.k,{background:"primary600",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(T.Z,{fontWeight:"semiBold",textColor:"neutral0"},z)):e.createElement(b.k,{borderColor:"neutral500",borderWidth:"1px",borderStyle:"solid",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(T.Z,{fontWeight:"semiBold",textColor:"neutral600"},z));N.defaultProps={number:void 0,type:y.VM},N.propTypes={number:O().number,type:O().oneOf([y.lW,y.hx,y.VM])},S.Z=N},23678:function(Q,S,n){n.d(S,{VM:function(){return O},hx:function(){return s},lW:function(){return e}});const e="isActive",s="isDone",O="isNotDone"},58107:function(Q,S){const n={contentTypeBuilder:{home:{title:{id:"app.components.GuidedTour.home.CTB.title",defaultMessage:"\u{1F9E0} Build the content structure"},cta:{title:{id:"app.components.GuidedTour.home.CTB.cta.title",defaultMessage:"Go to the Content type Builder"},type:"REDIRECT",target:"/plugins/content-type-builder"},trackingEvent:"didClickGuidedTourHomepageContentTypeBuilder"},create:{title:{id:"app.components.GuidedTour.CTB.create.title",defaultMessage:"\u{1F9E0} Create a first Collection type"},content:{id:"app.components.GuidedTour.CTB.create.content",defaultMessage:"<p>Collection types help you manage several entries, Single types are suitable to manage only one entry.</p> <p>Ex: For a Blog website, Articles would be a Collection type whereas a Homepage would be a Single type.</p>"},cta:{title:{id:"app.components.GuidedTour.CTB.create.cta.title",defaultMessage:"Build a Collection type"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep1CollectionType"},success:{title:{id:"app.components.GuidedTour.CTB.success.title",defaultMessage:"Step 1: Completed \u2705"},content:{id:"app.components.GuidedTour.CTB.success.content",defaultMessage:"<p>Good going!</p><b>\u26A1\uFE0F What would you like to share with the world?</b>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didCreateGuidedTourCollectionType"}},contentManager:{home:{title:{id:"app.components.GuidedTour.home.CM.title",defaultMessage:"\u26A1\uFE0F What would you like to share with the world?"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didClickGuidedTourHomepageContentManager"},create:{title:{id:"app.components.GuidedTour.CM.create.title",defaultMessage:"\u26A1\uFE0F Create content"},content:{id:"app.components.GuidedTour.CM.create.content",defaultMessage:"<p>Create and manage all the content here in the Content Manager.</p><p>Ex: Taking the Blog website example further, one can write an Article, save and publish it as they like.</p><p>\u{1F4A1} Quick tip - Don't forget to hit publish on the content you create.</p>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep2ContentManager"},success:{title:{id:"app.components.GuidedTour.CM.success.title",defaultMessage:"Step 2: Completed \u2705"},content:{id:"app.components.GuidedTour.CM.success.content",defaultMessage:"<p>Awesome, one last step to go!</p><b>\u{1F680} See content in action</b>"},cta:{title:{id:"app.components.GuidedTour.CM.success.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didCreateGuidedTourEntry"}},apiTokens:{home:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},cta:{title:{id:"app.components.GuidedTour.home.apiTokens.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didClickGuidedTourHomepageApiTokens"},create:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},content:{id:"app.components.GuidedTour.apiTokens.create.content",defaultMessage:"<p>Generate an authentication token here and retrieve the content you just created.</p>"},cta:{title:{id:"app.components.GuidedTour.apiTokens.create.cta.title",defaultMessage:"Generate an API Token"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep3ApiTokens"},success:{title:{id:"app.components.GuidedTour.apiTokens.success.title",defaultMessage:"Step 3: Completed \u2705"},content:{id:"app.components.GuidedTour.apiTokens.success.content",defaultMessage:"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>"},trackingEvent:"didGenerateGuidedTourApiTokens"}}};S.Z=n}}]);
|
|
79
|
+
`;var Tt=()=>{const t=(0,e.useRef)(),[a,o]=(0,e.useState)(!1),{formatMessage:i}=(0,B.Z)(),{communityEdition:p}=(0,s.QI)(),d=()=>{o(u=>!u)},h=[...ft,{label:{id:"Settings.application.get-help",defaultMessage:"Get help"},icon:ct.Z,href:p?"https://discord.strapi.io":"https://support.strapi.io/support/home"}];return e.createElement(P.x,{as:"aside",position:"fixed",bottom:2,right:2},e.createElement(Et,{"aria-label":i(a?{id:"app.components.Onboarding.help.button-close",defaultMessage:"Close help menu"}:{id:"app.components.Onboarding.help.button",defaultMessage:"Open help menu"}),onClick:d,ref:t},e.createElement(_.J,{as:a?ie.Z:dt.Z,color:"buttonNeutral0"})),a&&e.createElement(re.h,null,e.createElement(it.M.Content,{padding:0,source:t,placement:"top-end",spacing:12},e.createElement(V.i,{onEscape:d},e.createElement(m.k,{justifyContent:"space-between",paddingBottom:5,paddingRight:6,paddingLeft:6,paddingTop:6},e.createElement(Ce,{fontWeight:"bold"},i({id:"app.components.Onboarding.title",defaultMessage:"Get started videos"})),e.createElement(Te,{as:"a",href:ve.href,target:"_blank",rel:"noreferrer noopener",variant:"pi",textColor:"primary600"},i(ve.label))),e.createElement(ge.i,null),ht.map(({href:u,duration:g,label:c},v)=>e.createElement(vt,{as:"a",href:u,target:"_blank",rel:"noreferrer noopener",key:u,hasRadius:!0,paddingTop:4,paddingBottom:4,paddingLeft:6,paddingRight:11},e.createElement(P.x,{paddingRight:5},e.createElement(E.Z,{textColor:"neutral200",variant:"alpha"},v+1)),e.createElement(P.x,{position:"relative"},e.createElement(Ct,{src:pt,alt:""}),e.createElement(yt,{position:"absolute",top:"50%",left:"50%",background:"primary600",borderRadius:"50%",justifyContent:"center",width:6,height:6},e.createElement(_.J,{as:ut.Z,color:"buttonNeutral0",width:3,height:3}))),e.createElement(m.k,{direction:"column",alignItems:"start",paddingLeft:4},e.createElement(E.Z,{fontWeight:"bold"},i(c)),e.createElement(lt.T,null,":"),e.createElement(E.Z,{textColor:"neutral600",variant:"pi"},g)))),e.createElement(m.k,{direction:"column",alignItems:"stretch",gap:2,paddingLeft:5,paddingTop:2,paddingBottom:5},h.map(({label:u,href:g,icon:c})=>e.createElement(m.k,{gap:3,key:g},e.createElement(_.J,{as:c,color:"primary600"}),e.createElement(Te,{as:"a",href:g,target:"_blank",rel:"noreferrer noopener",variant:"sigma",textColor:"primary700"},i(u)))))))))};const Mt=(0,e.lazy)(()=>Promise.all([n.e(462),n.e(1657),n.e(994)]).then(n.bind(n,99546))),Pt=(0,e.lazy)(()=>n.e(3981).then(n.bind(n,55129))),St=(0,e.lazy)(()=>n.e(3677).then(n.bind(n,15415))),It=(0,e.lazy)(()=>n.e(5516).then(n.bind(n,84538))),Me=(0,e.lazy)(()=>Promise.resolve().then(n.bind(n,53951))),Rt=(0,e.lazy)(()=>n.e(9501).then(n.bind(n,92336))),At=(0,e.lazy)(()=>n.e(9497).then(n.bind(n,9972))),Pe=(0,e.lazy)(()=>n.e(5895).then(n.bind(n,74750))),Ot=()=>{const{trackUsage:t}=(0,s.rS)(),a=(0,y.I0)(),o=(0,y.v9)(i=>i.admin_app.status);(0,e.useEffect)(()=>{o==="init"&&(t("didAccessAuthenticatedAdministration"),a({type:rt.e}))},[o])};var Lt=()=>{Ot();const{isLoading:t,generalSectionLinks:a,pluginsSectionLinks:o}=(0,T.H9)(),{menu:i}=(0,s.j1)(),{showTutorials:p}=(0,T.um)(),d=(0,e.useMemo)(()=>i.filter(h=>h.Component).map(({to:h,Component:u,exact:g})=>(0,q.ot)(u,h,g)),[i]);return t?e.createElement(s.dO,null):e.createElement(N.DndProvider,{backend:$.PD},e.createElement(st,{sideNav:e.createElement(nt,{generalSectionLinks:a,pluginsSectionLinks:o})},e.createElement(e.Suspense,{fallback:e.createElement(s.dO,null)},e.createElement(f.rs,null,e.createElement(f.AW,{path:"/",component:Pt,exact:!0}),e.createElement(f.AW,{path:"/me",component:At,exact:!0}),e.createElement(f.AW,{path:"/content-manager",component:Mt}),d,e.createElement(f.AW,{path:"/settings/:settingId",component:Pe}),e.createElement(f.AW,{path:"/settings",component:Pe,exact:!0}),e.createElement(f.AW,{path:"/marketplace"},e.createElement(It,null)),e.createElement(f.AW,{path:"/list-plugins",exact:!0},e.createElement(St,null)),e.createElement(f.AW,{path:"/404",component:Me}),e.createElement(f.AW,{path:"/500",component:Rt}),e.createElement(f.AW,{path:"",component:Me}))),e.createElement(Ve,null),p&&e.createElement(Tt,null)))},xt=t=>({plugins:Object.keys(t).reduce((a,o)=>(a[o]={...t[o]},a),{})}),bt=n(3040),Dt=n.n(bt);const Se={plugins:null};var kt=(t=Se,a)=>(0,ce.ZP)(t,o=>{switch(a.type){case"SET_PLUGIN_READY":{Dt()(o,["plugins",a.pluginId,"isReady"],!0);break}default:return o}}),Zt=()=>{const{plugins:t}=(0,s.j1)(),[{plugins:a},o]=(0,e.useReducer)(kt,Se,()=>xt(t)),i=(0,e.useRef)(d=>{o({type:"SET_PLUGIN_READY",pluginId:d})});if(Object.keys(a).some(d=>a[d].isReady===!1)){const d=Object.keys(a).reduce((h,u)=>{const g=a[u].initializer;if(g){const c=a[u].pluginId;h.push(e.createElement(g,{key:c,setPlugin:i.current}))}return h},[]);return e.createElement(e.Fragment,null,d,e.createElement(s.dO,null))}return e.createElement(Lt,null)},Ie=n(17367);const Bt=()=>({type:Ie.l}),Wt=t=>({type:Ie.m,permissions:t}),Re=({children:t,permissions:a,refetchPermissions:o})=>{const{allPermissions:i}=(0,y.v9)(d=>d.rbacProvider),p=(0,y.I0)();return(0,e.useEffect)(()=>(p(Wt(a)),()=>{p(Bt())}),[a,p]),i?e.createElement(s.oL.Provider,{value:{allPermissions:i,refetchPermissions:o}},t):e.createElement(s.dO,null)};Re.propTypes={children:r().element.isRequired,permissions:r().array.isRequired,refetchPermissions:r().func.isRequired};var Gt=Re,Nt=n(84306),Ut=n(54770),ee=n.n(Ut),Ae=(t,a)=>!ee().valid(t)||!ee().valid(a)?!1:ee().lt(t,a);const Oe=I.i8,Ft=!JSON.parse(localStorage.getItem("STRAPI_UPDATE_NOTIF")),{get:te}=(0,s.tg)(),jt=async t=>{try{const{data:{tag_name:a}}=await Nt.Z.get("https://api.github.com/repos/strapi/strapi/releases/latest");return Ae(Oe,a)&&Ft&&t({type:"info",message:{id:"notification.version.update.message"},link:{url:`https://github.com/strapi/strapi/releases/tag/${a}`,label:{id:"global.see-more"}},blockTransition:!0,onClose:()=>localStorage.setItem("STRAPI_UPDATE_NOTIF",!0)}),a}catch{return Oe}},Qt=async()=>{try{const{data:t,headers:a}=await te("/admin/information");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}},$t=async()=>{try{const{data:t,headers:a}=await te("/admin/users/me/permissions");if(!a["content-type"].includes("application/json"))throw new Error("Not found");return t.data}catch(t){throw new Error(t)}},zt=async()=>{try{const{data:{data:{roles:t}}}=await te("/admin/users/me");return t}catch(t){throw new Error(t)}},Le=I.i8;var Kt=()=>{const{setGuidedTourVisibility:t}=(0,s.c1)(),a=(0,s.lm)(),o=(0,e.useRef)(t),i=s.I8.getUserInfo(),p=b()(i,"username")||(0,q.Pp)(i.firstname,i.lastname),[d,h]=(0,e.useState)(p),[u,g]=(0,e.useState)(null),{showReleaseNotification:c}=(0,T.um)(),[{data:v,status:D},{data:L,isLoading:F},{data:G,status:R,refetch:j,isFetched:k,isFetching:x},{data:A}]=(0,O.useQueries)([{queryKey:"app-infos",queryFn:Qt},{queryKey:"strapi-release",queryFn:()=>jt(a),enabled:c,initialData:Le},{queryKey:"admin-users-permission",queryFn:$t,initialData:[]},{queryKey:"user-roles",queryFn:zt}]),l=(0,e.useMemo)(()=>Ae(Le,L),[L]);(0,e.useEffect)(()=>{A&&A.find(({code:oe})=>oe==="strapi-super-admin")&&v?.autoReload&&o.current(!0)},[A,v]),(0,e.useEffect)(()=>{(async()=>{const oe=await(0,q.Qy)(i);g(oe)})()},[i]);const K=F||(x&&k||D==="loading"||R==="loading"),ne=(0,e.useMemo)(()=>({...v,userId:u,latestStrapiReleaseTag:L,setUserDisplayName:h,shouldUpdateStrapi:l,userDisplayName:d}),[v,L,l,d,u]);return K?e.createElement(s.dO,null):D==="error"?e.createElement("div",null,"error..."):e.createElement(s.NY.Provider,{value:ne},e.createElement(Gt,{permissions:G,refetchPermissions:j},e.createElement(Zt,null)))}},78024:function(Q,S,n){var e=n(32735),s=n(60216),O=n.n(s),C=n(43383),b=n(72850),I=n(23678);const T=({type:f,...y})=>e.createElement(b.x,{width:(0,C.Q1)(2),height:"100%",background:f===I.VM?"neutral300":"primary500",hasRadius:!0,...y});T.defaultProps={type:I.VM},T.propTypes={type:O().oneOf([I.lW,I.hx,I.VM])},S.Z=T},14317:function(Q,S,n){var e=n(32735),s=n(60216),O=n.n(s),C=n(43383),b=n(87933),I=n(99140),T=n(49372),f=n(66456),y=n(23678);const N=({type:$,number:z})=>$===y.hx?e.createElement(b.k,{background:"primary600",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(I.J,{as:f.Z,"aria-hidden":!0,width:(0,C.Q1)(16),color:"neutral0"})):$===y.lW?e.createElement(b.k,{background:"primary600",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(T.Z,{fontWeight:"semiBold",textColor:"neutral0"},z)):e.createElement(b.k,{borderColor:"neutral500",borderWidth:"1px",borderStyle:"solid",padding:2,borderRadius:"50%",width:(0,C.Q1)(30),height:(0,C.Q1)(30),justifyContent:"center"},e.createElement(T.Z,{fontWeight:"semiBold",textColor:"neutral600"},z));N.defaultProps={number:void 0,type:y.VM},N.propTypes={number:O().number,type:O().oneOf([y.lW,y.hx,y.VM])},S.Z=N},23678:function(Q,S,n){n.d(S,{VM:function(){return O},hx:function(){return s},lW:function(){return e}});const e="isActive",s="isDone",O="isNotDone"},58107:function(Q,S){const n={contentTypeBuilder:{home:{title:{id:"app.components.GuidedTour.home.CTB.title",defaultMessage:"\u{1F9E0} Build the content structure"},cta:{title:{id:"app.components.GuidedTour.home.CTB.cta.title",defaultMessage:"Go to the Content type Builder"},type:"REDIRECT",target:"/plugins/content-type-builder"},trackingEvent:"didClickGuidedTourHomepageContentTypeBuilder"},create:{title:{id:"app.components.GuidedTour.CTB.create.title",defaultMessage:"\u{1F9E0} Create a first Collection type"},content:{id:"app.components.GuidedTour.CTB.create.content",defaultMessage:"<p>Collection types help you manage several entries, Single types are suitable to manage only one entry.</p> <p>Ex: For a Blog website, Articles would be a Collection type whereas a Homepage would be a Single type.</p>"},cta:{title:{id:"app.components.GuidedTour.CTB.create.cta.title",defaultMessage:"Build a Collection type"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep1CollectionType"},success:{title:{id:"app.components.GuidedTour.CTB.success.title",defaultMessage:"Step 1: Completed \u2705"},content:{id:"app.components.GuidedTour.CTB.success.content",defaultMessage:"<p>Good going!</p><b>\u26A1\uFE0F What would you like to share with the world?</b>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didCreateGuidedTourCollectionType"}},contentManager:{home:{title:{id:"app.components.GuidedTour.home.CM.title",defaultMessage:"\u26A1\uFE0F What would you like to share with the world?"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"REDIRECT",target:"/content-manager"},trackingEvent:"didClickGuidedTourHomepageContentManager"},create:{title:{id:"app.components.GuidedTour.CM.create.title",defaultMessage:"\u26A1\uFE0F Create content"},content:{id:"app.components.GuidedTour.CM.create.content",defaultMessage:"<p>Create and manage all the content here in the Content Manager.</p><p>Ex: Taking the Blog website example further, one can write an Article, save and publish it as they like.</p><p>\u{1F4A1} Quick tip - Don't forget to hit publish on the content you create.</p>"},cta:{title:{id:"app.components.GuidedTour.create-content",defaultMessage:"Create content"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep2ContentManager"},success:{title:{id:"app.components.GuidedTour.CM.success.title",defaultMessage:"Step 2: Completed \u2705"},content:{id:"app.components.GuidedTour.CM.success.content",defaultMessage:"<p>Awesome, one last step to go!</p><b>\u{1F680} See content in action</b>"},cta:{title:{id:"app.components.GuidedTour.CM.success.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didCreateGuidedTourEntry"}},apiTokens:{home:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},cta:{title:{id:"app.components.GuidedTour.home.apiTokens.cta.title",defaultMessage:"Test the API"},type:"REDIRECT",target:"/settings/api-tokens"},trackingEvent:"didClickGuidedTourHomepageApiTokens"},create:{title:{id:"app.components.GuidedTour.apiTokens.create.title",defaultMessage:"\u{1F680} See content in action"},content:{id:"app.components.GuidedTour.apiTokens.create.content",defaultMessage:"<p>Generate an authentication token here and retrieve the content you just created.</p>"},cta:{title:{id:"app.components.GuidedTour.apiTokens.create.cta.title",defaultMessage:"Generate an API Token"},type:"CLOSE"},trackingEvent:"didClickGuidedTourStep3ApiTokens"},success:{title:{id:"app.components.GuidedTour.apiTokens.success.title",defaultMessage:"Step 3: Completed \u2705"},content:{id:"app.components.GuidedTour.apiTokens.success.content",defaultMessage:"<p>See content in action by making an HTTP request:</p><ul><li><p>To this URL: <light>https://'<'YOUR_DOMAIN'>'/api/'<'YOUR_CT'>'</light></p></li><li><p>With the header: <light>Authorization: bearer '<'YOUR_API_TOKEN'>'</light></p></li></ul><p>For more ways to interact with content, see the <documentationLink>documentation</documentationLink>.</p>"},trackingEvent:"didGenerateGuidedTourApiTokens"}}};S.Z=n}}]);
|