@strapi/review-workflows 5.9.0 → 5.10.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/dist/admin/chunks/Layout-27uslS7w.mjs +265 -0
- package/dist/admin/chunks/Layout-27uslS7w.mjs.map +1 -0
- package/dist/admin/chunks/Layout-B4l91S3p.js +290 -0
- package/dist/admin/chunks/Layout-B4l91S3p.js.map +1 -0
- package/dist/admin/chunks/en-BixG7IBu.mjs +14 -0
- package/dist/admin/chunks/en-BixG7IBu.mjs.map +1 -0
- package/dist/admin/chunks/en-C6SESe-Y.js +16 -0
- package/dist/admin/chunks/en-C6SESe-Y.js.map +1 -0
- package/dist/admin/chunks/id-DnRGfGvc.js +1442 -0
- package/dist/admin/chunks/id-DnRGfGvc.js.map +1 -0
- package/dist/admin/chunks/id-LAMc9ydb.mjs +1420 -0
- package/dist/admin/chunks/id-LAMc9ydb.mjs.map +1 -0
- package/dist/admin/chunks/index-BiGArvbK.mjs +271 -0
- package/dist/admin/chunks/index-BiGArvbK.mjs.map +1 -0
- package/dist/admin/chunks/index-C5IeISWp.js +960 -0
- package/dist/admin/chunks/index-C5IeISWp.js.map +1 -0
- package/dist/admin/chunks/index-CSYOmjZt.mjs +926 -0
- package/dist/admin/chunks/index-CSYOmjZt.mjs.map +1 -0
- package/dist/admin/chunks/index-DZpcSUvc.js +293 -0
- package/dist/admin/chunks/index-DZpcSUvc.js.map +1 -0
- package/dist/admin/chunks/purchase-review-workflows-CEP8kvxZ.mjs +53 -0
- package/dist/admin/chunks/purchase-review-workflows-CEP8kvxZ.mjs.map +1 -0
- package/dist/admin/chunks/purchase-review-workflows-Drlxm8yP.js +55 -0
- package/dist/admin/chunks/purchase-review-workflows-Drlxm8yP.js.map +1 -0
- package/dist/admin/chunks/router-CrN8UbpP.js +30 -0
- package/dist/admin/chunks/router-CrN8UbpP.js.map +1 -0
- package/dist/admin/chunks/router-Z3AR7XZ7.mjs +28 -0
- package/dist/admin/chunks/router-Z3AR7XZ7.mjs.map +1 -0
- package/dist/admin/index.js +17 -2
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +12 -4
- package/dist/admin/index.mjs.map +1 -1
- package/dist/server/index.js +2109 -7839
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +2114 -7847
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/services/document-service-middleware.d.ts +1 -1
- package/dist/server/src/services/document-service-middleware.d.ts.map +1 -1
- package/dist/shared/contracts/review-workflows.d.ts +0 -1
- package/package.json +14 -10
- package/dist/_chunks/Layout-C3IORH2n.js +0 -250
- package/dist/_chunks/Layout-C3IORH2n.js.map +0 -1
- package/dist/_chunks/Layout-DNKR5bym.mjs +0 -233
- package/dist/_chunks/Layout-DNKR5bym.mjs.map +0 -1
- package/dist/_chunks/en-CYgjfSep.js +0 -15
- package/dist/_chunks/en-CYgjfSep.js.map +0 -1
- package/dist/_chunks/en-D9dxziEb.mjs +0 -15
- package/dist/_chunks/en-D9dxziEb.mjs.map +0 -1
- package/dist/_chunks/id-C9Ku9Br9.mjs +0 -1274
- package/dist/_chunks/id-C9Ku9Br9.mjs.map +0 -1
- package/dist/_chunks/id-oOE1bYls.js +0 -1293
- package/dist/_chunks/id-oOE1bYls.js.map +0 -1
- package/dist/_chunks/index-ByXbOW-R.mjs +0 -815
- package/dist/_chunks/index-ByXbOW-R.mjs.map +0 -1
- package/dist/_chunks/index-CmHHjN95.js +0 -231
- package/dist/_chunks/index-CmHHjN95.js.map +0 -1
- package/dist/_chunks/index-CyhaJuJG.mjs +0 -213
- package/dist/_chunks/index-CyhaJuJG.mjs.map +0 -1
- package/dist/_chunks/index-DMT27jNE.js +0 -832
- package/dist/_chunks/index-DMT27jNE.js.map +0 -1
- package/dist/_chunks/purchase-review-workflows-BxoDFxQ5.js +0 -52
- package/dist/_chunks/purchase-review-workflows-BxoDFxQ5.js.map +0 -1
- package/dist/_chunks/purchase-review-workflows-DyFV_H0I.mjs +0 -52
- package/dist/_chunks/purchase-review-workflows-DyFV_H0I.mjs.map +0 -1
- package/dist/_chunks/router-BPl2HZMq.mjs +0 -24
- package/dist/_chunks/router-BPl2HZMq.mjs.map +0 -1
- package/dist/_chunks/router-vDfGt9bq.js +0 -24
- package/dist/_chunks/router-vDfGt9bq.js.map +0 -1
- /package/dist/admin/src/routes/content-manager/{[model] → model}/components/AssigneeFilter.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model] → model}/components/StageFilter.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model] → model}/components/TableColumns.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model] → model}/configure/constants.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model] → model}/constants.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model]/[id] → model/id}/components/AssigneeSelect.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model]/[id] → model/id}/components/Panel.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model]/[id] → model/id}/components/StageSelect.d.ts +0 -0
- /package/dist/admin/src/routes/content-manager/{[model]/[id] → model/id}/components/constants.d.ts +0 -0
@@ -0,0 +1,265 @@
|
|
1
|
+
import * as React from 'react';
|
2
|
+
import { useNotification, useAPIErrorHandler, Page, Layouts } from '@strapi/admin/strapi-admin';
|
3
|
+
import { useIntl } from 'react-intl';
|
4
|
+
import { c as useGetWorkflowsQuery, d as useCreateWorkflowMutation, e as useUpdateWorkflowMutation, f as useDeleteWorkflowMutation } from './index-CSYOmjZt.mjs';
|
5
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
6
|
+
import { Flex, Typography, Box } from '@strapi/design-system';
|
7
|
+
import { useDragLayer } from 'react-dnd';
|
8
|
+
import { CaretDown } from '@strapi/icons';
|
9
|
+
|
10
|
+
const DEFAULT_UNEXPECTED_ERROR_MSG = {
|
11
|
+
id: 'notification.error',
|
12
|
+
defaultMessage: 'An error occurred, please try again'
|
13
|
+
};
|
14
|
+
const useReviewWorkflows = (params = {})=>{
|
15
|
+
const { toggleNotification } = useNotification();
|
16
|
+
const { formatMessage } = useIntl();
|
17
|
+
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
18
|
+
const { skip = false, ...queryParams } = params;
|
19
|
+
const { data, isLoading, error } = useGetWorkflowsQuery({
|
20
|
+
populate: [
|
21
|
+
'stages',
|
22
|
+
'stageRequiredToPublish'
|
23
|
+
],
|
24
|
+
...queryParams
|
25
|
+
}, {
|
26
|
+
skip
|
27
|
+
});
|
28
|
+
React.useEffect(()=>{
|
29
|
+
if (error) {
|
30
|
+
toggleNotification({
|
31
|
+
type: 'danger',
|
32
|
+
message: formatAPIError(error)
|
33
|
+
});
|
34
|
+
}
|
35
|
+
}, [
|
36
|
+
error,
|
37
|
+
formatAPIError,
|
38
|
+
toggleNotification
|
39
|
+
]);
|
40
|
+
const [createWorkflow] = useCreateWorkflowMutation();
|
41
|
+
const create = React.useCallback(async (data)=>{
|
42
|
+
try {
|
43
|
+
const res = await createWorkflow({
|
44
|
+
data
|
45
|
+
});
|
46
|
+
if ('error' in res) {
|
47
|
+
toggleNotification({
|
48
|
+
type: 'danger',
|
49
|
+
message: formatAPIError(res.error)
|
50
|
+
});
|
51
|
+
return res;
|
52
|
+
}
|
53
|
+
toggleNotification({
|
54
|
+
type: 'success',
|
55
|
+
message: formatMessage({
|
56
|
+
id: 'actions.created',
|
57
|
+
defaultMessage: 'Created workflow'
|
58
|
+
})
|
59
|
+
});
|
60
|
+
return res;
|
61
|
+
} catch (err) {
|
62
|
+
toggleNotification({
|
63
|
+
type: 'danger',
|
64
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
65
|
+
});
|
66
|
+
throw err;
|
67
|
+
}
|
68
|
+
}, [
|
69
|
+
createWorkflow,
|
70
|
+
formatAPIError,
|
71
|
+
formatMessage,
|
72
|
+
toggleNotification
|
73
|
+
]);
|
74
|
+
const [updateWorkflow] = useUpdateWorkflowMutation();
|
75
|
+
const update = React.useCallback(async (id, data)=>{
|
76
|
+
try {
|
77
|
+
const res = await updateWorkflow({
|
78
|
+
id,
|
79
|
+
data
|
80
|
+
});
|
81
|
+
if ('error' in res) {
|
82
|
+
toggleNotification({
|
83
|
+
type: 'danger',
|
84
|
+
message: formatAPIError(res.error)
|
85
|
+
});
|
86
|
+
return res;
|
87
|
+
}
|
88
|
+
toggleNotification({
|
89
|
+
type: 'success',
|
90
|
+
message: formatMessage({
|
91
|
+
id: 'actions.updated',
|
92
|
+
defaultMessage: 'Updated workflow'
|
93
|
+
})
|
94
|
+
});
|
95
|
+
return res;
|
96
|
+
} catch (err) {
|
97
|
+
toggleNotification({
|
98
|
+
type: 'danger',
|
99
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
100
|
+
});
|
101
|
+
throw err;
|
102
|
+
}
|
103
|
+
}, [
|
104
|
+
formatAPIError,
|
105
|
+
formatMessage,
|
106
|
+
toggleNotification,
|
107
|
+
updateWorkflow
|
108
|
+
]);
|
109
|
+
const [deleteWorkflow] = useDeleteWorkflowMutation();
|
110
|
+
const deleteAction = React.useCallback(async (id)=>{
|
111
|
+
try {
|
112
|
+
const res = await deleteWorkflow({
|
113
|
+
id
|
114
|
+
});
|
115
|
+
if ('error' in res) {
|
116
|
+
toggleNotification({
|
117
|
+
type: 'danger',
|
118
|
+
message: formatAPIError(res.error)
|
119
|
+
});
|
120
|
+
return;
|
121
|
+
}
|
122
|
+
toggleNotification({
|
123
|
+
type: 'success',
|
124
|
+
message: formatMessage({
|
125
|
+
id: 'actions.deleted',
|
126
|
+
defaultMessage: 'Deleted workflow'
|
127
|
+
})
|
128
|
+
});
|
129
|
+
return res.data;
|
130
|
+
} catch (err) {
|
131
|
+
toggleNotification({
|
132
|
+
type: 'danger',
|
133
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
134
|
+
});
|
135
|
+
throw err;
|
136
|
+
}
|
137
|
+
}, [
|
138
|
+
deleteWorkflow,
|
139
|
+
formatAPIError,
|
140
|
+
formatMessage,
|
141
|
+
toggleNotification
|
142
|
+
]);
|
143
|
+
const { workflows = [], meta } = data ?? {};
|
144
|
+
return {
|
145
|
+
// meta contains e.g. the total of all workflows. we can not use
|
146
|
+
// the pagination object here, because the list is not paginated.
|
147
|
+
meta,
|
148
|
+
workflows,
|
149
|
+
isLoading,
|
150
|
+
error,
|
151
|
+
create,
|
152
|
+
delete: deleteAction,
|
153
|
+
update
|
154
|
+
};
|
155
|
+
};
|
156
|
+
|
157
|
+
const DRAG_DROP_TYPES = {
|
158
|
+
STAGE: 'stage'
|
159
|
+
};
|
160
|
+
|
161
|
+
const StageDragPreview = ({ name })=>{
|
162
|
+
return /*#__PURE__*/ jsxs(Flex, {
|
163
|
+
background: "primary100",
|
164
|
+
borderStyle: "dashed",
|
165
|
+
borderColor: "primary600",
|
166
|
+
borderWidth: "1px",
|
167
|
+
gap: 3,
|
168
|
+
hasRadius: true,
|
169
|
+
padding: 3,
|
170
|
+
shadow: "tableShadow",
|
171
|
+
width: "30rem",
|
172
|
+
children: [
|
173
|
+
/*#__PURE__*/ jsx(Flex, {
|
174
|
+
alignItems: "center",
|
175
|
+
background: "neutral200",
|
176
|
+
borderRadius: "50%",
|
177
|
+
height: 6,
|
178
|
+
justifyContent: "center",
|
179
|
+
width: 6,
|
180
|
+
children: /*#__PURE__*/ jsx(CaretDown, {
|
181
|
+
width: "0.8rem",
|
182
|
+
fill: "neutral600"
|
183
|
+
})
|
184
|
+
}),
|
185
|
+
/*#__PURE__*/ jsx(Typography, {
|
186
|
+
fontWeight: "bold",
|
187
|
+
children: name
|
188
|
+
})
|
189
|
+
]
|
190
|
+
});
|
191
|
+
};
|
192
|
+
|
193
|
+
function getStyle(initialOffset, currentOffset, mouseOffset) {
|
194
|
+
if (!initialOffset || !currentOffset || !mouseOffset) {
|
195
|
+
return {
|
196
|
+
display: 'none'
|
197
|
+
};
|
198
|
+
}
|
199
|
+
const { x, y } = mouseOffset;
|
200
|
+
return {
|
201
|
+
transform: `translate(${x}px, ${y}px)`
|
202
|
+
};
|
203
|
+
}
|
204
|
+
const DragLayerRendered = ()=>{
|
205
|
+
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer((monitor)=>({
|
206
|
+
item: monitor.getItem(),
|
207
|
+
itemType: monitor.getItemType(),
|
208
|
+
initialOffset: monitor.getInitialSourceClientOffset(),
|
209
|
+
currentOffset: monitor.getSourceClientOffset(),
|
210
|
+
isDragging: monitor.isDragging(),
|
211
|
+
mouseOffset: monitor.getClientOffset()
|
212
|
+
}));
|
213
|
+
if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {
|
214
|
+
return null;
|
215
|
+
}
|
216
|
+
return /*#__PURE__*/ jsx(Box, {
|
217
|
+
height: "100%",
|
218
|
+
left: 0,
|
219
|
+
position: "fixed",
|
220
|
+
pointerEvents: "none",
|
221
|
+
top: 0,
|
222
|
+
zIndex: 100,
|
223
|
+
width: "100%",
|
224
|
+
children: /*#__PURE__*/ jsxs(Box, {
|
225
|
+
style: getStyle(initialOffset, currentOffset, mouseOffset),
|
226
|
+
children: [
|
227
|
+
/*#__PURE__*/ jsx(StageDragPreview, {
|
228
|
+
name: typeof item.item === 'string' ? item.item : null
|
229
|
+
}),
|
230
|
+
";"
|
231
|
+
]
|
232
|
+
})
|
233
|
+
});
|
234
|
+
};
|
235
|
+
const Root = ({ children })=>{
|
236
|
+
return /*#__PURE__*/ jsx(Page.Main, {
|
237
|
+
children: /*#__PURE__*/ jsx(Layouts.Content, {
|
238
|
+
children: children
|
239
|
+
})
|
240
|
+
});
|
241
|
+
};
|
242
|
+
const Header = ({ title, subtitle, navigationAction, primaryAction })=>{
|
243
|
+
const { formatMessage } = useIntl();
|
244
|
+
return /*#__PURE__*/ jsxs(Fragment, {
|
245
|
+
children: [
|
246
|
+
/*#__PURE__*/ jsx(Page.Title, {
|
247
|
+
children: formatMessage({
|
248
|
+
id: 'Settings.PageTitle',
|
249
|
+
defaultMessage: 'Settings - {name}'
|
250
|
+
}, {
|
251
|
+
name: title
|
252
|
+
})
|
253
|
+
}),
|
254
|
+
/*#__PURE__*/ jsx(Layouts.BaseHeader, {
|
255
|
+
navigationAction: navigationAction,
|
256
|
+
primaryAction: primaryAction,
|
257
|
+
title: title,
|
258
|
+
subtitle: subtitle
|
259
|
+
})
|
260
|
+
]
|
261
|
+
});
|
262
|
+
};
|
263
|
+
|
264
|
+
export { DRAG_DROP_TYPES as D, Header as H, Root as R, DragLayerRendered as a, useReviewWorkflows as u };
|
265
|
+
//# sourceMappingURL=Layout-27uslS7w.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Layout-27uslS7w.mjs","sources":["../../../admin/src/routes/settings/hooks/useReviewWorkflows.ts","../../../admin/src/routes/settings/constants.ts","../../../admin/src/routes/settings/components/StageDragPreview.tsx","../../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport {\n GetWorkflowsParams,\n useCreateWorkflowMutation,\n useDeleteWorkflowMutation,\n useGetWorkflowsQuery,\n useUpdateWorkflowMutation,\n} from '../../../services/settings';\n\nimport type { Create, Update } from '../../../../../shared/contracts/review-workflows';\n\nconst DEFAULT_UNEXPECTED_ERROR_MSG = {\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n} satisfies MessageDescriptor;\n\ntype UseReviewWorkflowsArgs = GetWorkflowsParams & {\n skip?: boolean;\n};\n\nconst useReviewWorkflows = (params: UseReviewWorkflowsArgs = {}) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n populate: ['stages', 'stageRequiredToPublish'],\n ...queryParams,\n },\n {\n skip,\n }\n );\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const [createWorkflow] = useCreateWorkflowMutation();\n const create = React.useCallback(\n async (data: Create.Request['body']['data']) => {\n try {\n const res = await createWorkflow({ data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.created', defaultMessage: 'Created workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [createWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const [updateWorkflow] = useUpdateWorkflowMutation();\n const update = React.useCallback(\n async (id: string, data: Update.Request['body']['data']) => {\n try {\n const res = await updateWorkflow({ id, data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.updated', defaultMessage: 'Updated workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [formatAPIError, formatMessage, toggleNotification, updateWorkflow]\n );\n\n const [deleteWorkflow] = useDeleteWorkflowMutation();\n const deleteAction = React.useCallback(\n async (id: string) => {\n try {\n const res = await deleteWorkflow({ id });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.deleted', defaultMessage: 'Deleted workflow' }),\n });\n\n return res.data;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [deleteWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const { workflows = [], meta } = data ?? {};\n\n return {\n // meta contains e.g. the total of all workflows. we can not use\n // the pagination object here, because the list is not paginated.\n meta,\n workflows,\n isLoading,\n error,\n create,\n delete: deleteAction,\n update,\n };\n};\n\nexport { useReviewWorkflows };\n","export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n","import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["DEFAULT_UNEXPECTED_ERROR_MSG","id","defaultMessage","useReviewWorkflows","params","toggleNotification","useNotification","formatMessage","useIntl","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","skip","queryParams","data","isLoading","error","useGetWorkflowsQuery","populate","React","useEffect","type","message","createWorkflow","useCreateWorkflowMutation","create","useCallback","res","err","updateWorkflow","useUpdateWorkflowMutation","update","deleteWorkflow","useDeleteWorkflowMutation","deleteAction","workflows","meta","delete","DRAG_DROP_TYPES","STAGE","StageDragPreview","name","_jsxs","Flex","background","borderStyle","borderColor","borderWidth","gap","hasRadius","padding","shadow","width","_jsx","alignItems","borderRadius","height","justifyContent","CaretDown","fill","Typography","fontWeight","getStyle","initialOffset","currentOffset","mouseOffset","display","x","y","transform","DragLayerRendered","itemType","isDragging","item","useDragLayer","monitor","getItem","getItemType","getInitialSourceClientOffset","getSourceClientOffset","getClientOffset","Box","left","position","pointerEvents","top","zIndex","style","Root","children","Page","Main","Layouts","Content","Header","title","subtitle","navigationAction","primaryAction","_Fragment","Title","BaseHeader"],"mappings":";;;;;;;;;AAeA,MAAMA,4BAA+B,GAAA;IACnCC,EAAI,EAAA,oBAAA;IACJC,cAAgB,EAAA;AAClB,CAAA;AAMA,MAAMC,kBAAqB,GAAA,CAACC,MAAiC,GAAA,EAAE,GAAA;IAC7D,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,eAAAA,EAAAA;IAC/B,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAM,EAAEC,uBAAAA,EAAyBC,cAAc,EAAE,GAAGC,kBAAAA,EAAAA;AAEpD,IAAA,MAAM,EAAEC,IAAO,GAAA,KAAK,EAAE,GAAGC,aAAa,GAAGT,MAAAA;IAEzC,MAAM,EAAEU,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,oBACjC,CAAA;QACEC,QAAU,EAAA;AAAC,YAAA,QAAA;AAAU,YAAA;AAAyB,SAAA;AAC9C,QAAA,GAAGL;KAEL,EAAA;AACED,QAAAA;AACF,KAAA,CAAA;AAGFO,IAAAA,KAAAA,CAAMC,SAAS,CAAC,IAAA;AACd,QAAA,IAAIJ,KAAO,EAAA;YACTX,kBAAmB,CAAA;gBACjBgB,IAAM,EAAA,QAAA;AACNC,gBAAAA,OAAAA,EAASZ,cAAeM,CAAAA,KAAAA;AAC1B,aAAA,CAAA;AACF;KACC,EAAA;AAACA,QAAAA,KAAAA;AAAON,QAAAA,cAA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|
6
|
+
var index = require('./index-C5IeISWp.js');
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
8
|
+
var designSystem = require('@strapi/design-system');
|
9
|
+
var reactDnd = require('react-dnd');
|
10
|
+
var icons = require('@strapi/icons');
|
11
|
+
|
12
|
+
function _interopNamespaceDefault(e) {
|
13
|
+
var n = Object.create(null);
|
14
|
+
if (e) {
|
15
|
+
Object.keys(e).forEach(function (k) {
|
16
|
+
if (k !== 'default') {
|
17
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
18
|
+
Object.defineProperty(n, k, d.get ? d : {
|
19
|
+
enumerable: true,
|
20
|
+
get: function () { return e[k]; }
|
21
|
+
});
|
22
|
+
}
|
23
|
+
});
|
24
|
+
}
|
25
|
+
n.default = e;
|
26
|
+
return Object.freeze(n);
|
27
|
+
}
|
28
|
+
|
29
|
+
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
30
|
+
|
31
|
+
const DEFAULT_UNEXPECTED_ERROR_MSG = {
|
32
|
+
id: 'notification.error',
|
33
|
+
defaultMessage: 'An error occurred, please try again'
|
34
|
+
};
|
35
|
+
const useReviewWorkflows = (params = {})=>{
|
36
|
+
const { toggleNotification } = strapiAdmin.useNotification();
|
37
|
+
const { formatMessage } = reactIntl.useIntl();
|
38
|
+
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
39
|
+
const { skip = false, ...queryParams } = params;
|
40
|
+
const { data, isLoading, error } = index.useGetWorkflowsQuery({
|
41
|
+
populate: [
|
42
|
+
'stages',
|
43
|
+
'stageRequiredToPublish'
|
44
|
+
],
|
45
|
+
...queryParams
|
46
|
+
}, {
|
47
|
+
skip
|
48
|
+
});
|
49
|
+
React__namespace.useEffect(()=>{
|
50
|
+
if (error) {
|
51
|
+
toggleNotification({
|
52
|
+
type: 'danger',
|
53
|
+
message: formatAPIError(error)
|
54
|
+
});
|
55
|
+
}
|
56
|
+
}, [
|
57
|
+
error,
|
58
|
+
formatAPIError,
|
59
|
+
toggleNotification
|
60
|
+
]);
|
61
|
+
const [createWorkflow] = index.useCreateWorkflowMutation();
|
62
|
+
const create = React__namespace.useCallback(async (data)=>{
|
63
|
+
try {
|
64
|
+
const res = await createWorkflow({
|
65
|
+
data
|
66
|
+
});
|
67
|
+
if ('error' in res) {
|
68
|
+
toggleNotification({
|
69
|
+
type: 'danger',
|
70
|
+
message: formatAPIError(res.error)
|
71
|
+
});
|
72
|
+
return res;
|
73
|
+
}
|
74
|
+
toggleNotification({
|
75
|
+
type: 'success',
|
76
|
+
message: formatMessage({
|
77
|
+
id: 'actions.created',
|
78
|
+
defaultMessage: 'Created workflow'
|
79
|
+
})
|
80
|
+
});
|
81
|
+
return res;
|
82
|
+
} catch (err) {
|
83
|
+
toggleNotification({
|
84
|
+
type: 'danger',
|
85
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
86
|
+
});
|
87
|
+
throw err;
|
88
|
+
}
|
89
|
+
}, [
|
90
|
+
createWorkflow,
|
91
|
+
formatAPIError,
|
92
|
+
formatMessage,
|
93
|
+
toggleNotification
|
94
|
+
]);
|
95
|
+
const [updateWorkflow] = index.useUpdateWorkflowMutation();
|
96
|
+
const update = React__namespace.useCallback(async (id, data)=>{
|
97
|
+
try {
|
98
|
+
const res = await updateWorkflow({
|
99
|
+
id,
|
100
|
+
data
|
101
|
+
});
|
102
|
+
if ('error' in res) {
|
103
|
+
toggleNotification({
|
104
|
+
type: 'danger',
|
105
|
+
message: formatAPIError(res.error)
|
106
|
+
});
|
107
|
+
return res;
|
108
|
+
}
|
109
|
+
toggleNotification({
|
110
|
+
type: 'success',
|
111
|
+
message: formatMessage({
|
112
|
+
id: 'actions.updated',
|
113
|
+
defaultMessage: 'Updated workflow'
|
114
|
+
})
|
115
|
+
});
|
116
|
+
return res;
|
117
|
+
} catch (err) {
|
118
|
+
toggleNotification({
|
119
|
+
type: 'danger',
|
120
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
121
|
+
});
|
122
|
+
throw err;
|
123
|
+
}
|
124
|
+
}, [
|
125
|
+
formatAPIError,
|
126
|
+
formatMessage,
|
127
|
+
toggleNotification,
|
128
|
+
updateWorkflow
|
129
|
+
]);
|
130
|
+
const [deleteWorkflow] = index.useDeleteWorkflowMutation();
|
131
|
+
const deleteAction = React__namespace.useCallback(async (id)=>{
|
132
|
+
try {
|
133
|
+
const res = await deleteWorkflow({
|
134
|
+
id
|
135
|
+
});
|
136
|
+
if ('error' in res) {
|
137
|
+
toggleNotification({
|
138
|
+
type: 'danger',
|
139
|
+
message: formatAPIError(res.error)
|
140
|
+
});
|
141
|
+
return;
|
142
|
+
}
|
143
|
+
toggleNotification({
|
144
|
+
type: 'success',
|
145
|
+
message: formatMessage({
|
146
|
+
id: 'actions.deleted',
|
147
|
+
defaultMessage: 'Deleted workflow'
|
148
|
+
})
|
149
|
+
});
|
150
|
+
return res.data;
|
151
|
+
} catch (err) {
|
152
|
+
toggleNotification({
|
153
|
+
type: 'danger',
|
154
|
+
message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG)
|
155
|
+
});
|
156
|
+
throw err;
|
157
|
+
}
|
158
|
+
}, [
|
159
|
+
deleteWorkflow,
|
160
|
+
formatAPIError,
|
161
|
+
formatMessage,
|
162
|
+
toggleNotification
|
163
|
+
]);
|
164
|
+
const { workflows = [], meta } = data ?? {};
|
165
|
+
return {
|
166
|
+
// meta contains e.g. the total of all workflows. we can not use
|
167
|
+
// the pagination object here, because the list is not paginated.
|
168
|
+
meta,
|
169
|
+
workflows,
|
170
|
+
isLoading,
|
171
|
+
error,
|
172
|
+
create,
|
173
|
+
delete: deleteAction,
|
174
|
+
update
|
175
|
+
};
|
176
|
+
};
|
177
|
+
|
178
|
+
const DRAG_DROP_TYPES = {
|
179
|
+
STAGE: 'stage'
|
180
|
+
};
|
181
|
+
|
182
|
+
const StageDragPreview = ({ name })=>{
|
183
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
184
|
+
background: "primary100",
|
185
|
+
borderStyle: "dashed",
|
186
|
+
borderColor: "primary600",
|
187
|
+
borderWidth: "1px",
|
188
|
+
gap: 3,
|
189
|
+
hasRadius: true,
|
190
|
+
padding: 3,
|
191
|
+
shadow: "tableShadow",
|
192
|
+
width: "30rem",
|
193
|
+
children: [
|
194
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
|
195
|
+
alignItems: "center",
|
196
|
+
background: "neutral200",
|
197
|
+
borderRadius: "50%",
|
198
|
+
height: 6,
|
199
|
+
justifyContent: "center",
|
200
|
+
width: 6,
|
201
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(icons.CaretDown, {
|
202
|
+
width: "0.8rem",
|
203
|
+
fill: "neutral600"
|
204
|
+
})
|
205
|
+
}),
|
206
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
207
|
+
fontWeight: "bold",
|
208
|
+
children: name
|
209
|
+
})
|
210
|
+
]
|
211
|
+
});
|
212
|
+
};
|
213
|
+
|
214
|
+
function getStyle(initialOffset, currentOffset, mouseOffset) {
|
215
|
+
if (!initialOffset || !currentOffset || !mouseOffset) {
|
216
|
+
return {
|
217
|
+
display: 'none'
|
218
|
+
};
|
219
|
+
}
|
220
|
+
const { x, y } = mouseOffset;
|
221
|
+
return {
|
222
|
+
transform: `translate(${x}px, ${y}px)`
|
223
|
+
};
|
224
|
+
}
|
225
|
+
const DragLayerRendered = ()=>{
|
226
|
+
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = reactDnd.useDragLayer((monitor)=>({
|
227
|
+
item: monitor.getItem(),
|
228
|
+
itemType: monitor.getItemType(),
|
229
|
+
initialOffset: monitor.getInitialSourceClientOffset(),
|
230
|
+
currentOffset: monitor.getSourceClientOffset(),
|
231
|
+
isDragging: monitor.isDragging(),
|
232
|
+
mouseOffset: monitor.getClientOffset()
|
233
|
+
}));
|
234
|
+
if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {
|
235
|
+
return null;
|
236
|
+
}
|
237
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
238
|
+
height: "100%",
|
239
|
+
left: 0,
|
240
|
+
position: "fixed",
|
241
|
+
pointerEvents: "none",
|
242
|
+
top: 0,
|
243
|
+
zIndex: 100,
|
244
|
+
width: "100%",
|
245
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Box, {
|
246
|
+
style: getStyle(initialOffset, currentOffset, mouseOffset),
|
247
|
+
children: [
|
248
|
+
/*#__PURE__*/ jsxRuntime.jsx(StageDragPreview, {
|
249
|
+
name: typeof item.item === 'string' ? item.item : null
|
250
|
+
}),
|
251
|
+
";"
|
252
|
+
]
|
253
|
+
})
|
254
|
+
});
|
255
|
+
};
|
256
|
+
const Root = ({ children })=>{
|
257
|
+
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Main, {
|
258
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.Content, {
|
259
|
+
children: children
|
260
|
+
})
|
261
|
+
});
|
262
|
+
};
|
263
|
+
const Header = ({ title, subtitle, navigationAction, primaryAction })=>{
|
264
|
+
const { formatMessage } = reactIntl.useIntl();
|
265
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
266
|
+
children: [
|
267
|
+
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Title, {
|
268
|
+
children: formatMessage({
|
269
|
+
id: 'Settings.PageTitle',
|
270
|
+
defaultMessage: 'Settings - {name}'
|
271
|
+
}, {
|
272
|
+
name: title
|
273
|
+
})
|
274
|
+
}),
|
275
|
+
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.BaseHeader, {
|
276
|
+
navigationAction: navigationAction,
|
277
|
+
primaryAction: primaryAction,
|
278
|
+
title: title,
|
279
|
+
subtitle: subtitle
|
280
|
+
})
|
281
|
+
]
|
282
|
+
});
|
283
|
+
};
|
284
|
+
|
285
|
+
exports.DRAG_DROP_TYPES = DRAG_DROP_TYPES;
|
286
|
+
exports.DragLayerRendered = DragLayerRendered;
|
287
|
+
exports.Header = Header;
|
288
|
+
exports.Root = Root;
|
289
|
+
exports.useReviewWorkflows = useReviewWorkflows;
|
290
|
+
//# sourceMappingURL=Layout-B4l91S3p.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Layout-B4l91S3p.js","sources":["../../../admin/src/routes/settings/hooks/useReviewWorkflows.ts","../../../admin/src/routes/settings/constants.ts","../../../admin/src/routes/settings/components/StageDragPreview.tsx","../../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport {\n GetWorkflowsParams,\n useCreateWorkflowMutation,\n useDeleteWorkflowMutation,\n useGetWorkflowsQuery,\n useUpdateWorkflowMutation,\n} from '../../../services/settings';\n\nimport type { Create, Update } from '../../../../../shared/contracts/review-workflows';\n\nconst DEFAULT_UNEXPECTED_ERROR_MSG = {\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n} satisfies MessageDescriptor;\n\ntype UseReviewWorkflowsArgs = GetWorkflowsParams & {\n skip?: boolean;\n};\n\nconst useReviewWorkflows = (params: UseReviewWorkflowsArgs = {}) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n populate: ['stages', 'stageRequiredToPublish'],\n ...queryParams,\n },\n {\n skip,\n }\n );\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const [createWorkflow] = useCreateWorkflowMutation();\n const create = React.useCallback(\n async (data: Create.Request['body']['data']) => {\n try {\n const res = await createWorkflow({ data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.created', defaultMessage: 'Created workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [createWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const [updateWorkflow] = useUpdateWorkflowMutation();\n const update = React.useCallback(\n async (id: string, data: Update.Request['body']['data']) => {\n try {\n const res = await updateWorkflow({ id, data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.updated', defaultMessage: 'Updated workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [formatAPIError, formatMessage, toggleNotification, updateWorkflow]\n );\n\n const [deleteWorkflow] = useDeleteWorkflowMutation();\n const deleteAction = React.useCallback(\n async (id: string) => {\n try {\n const res = await deleteWorkflow({ id });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.deleted', defaultMessage: 'Deleted workflow' }),\n });\n\n return res.data;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [deleteWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const { workflows = [], meta } = data ?? {};\n\n return {\n // meta contains e.g. the total of all workflows. we can not use\n // the pagination object here, because the list is not paginated.\n meta,\n workflows,\n isLoading,\n error,\n create,\n delete: deleteAction,\n update,\n };\n};\n\nexport { useReviewWorkflows };\n","export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n","import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["DEFAULT_UNEXPECTED_ERROR_MSG","id","defaultMessage","useReviewWorkflows","params","toggleNotification","useNotification","formatMessage","useIntl","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","skip","queryParams","data","isLoading","error","useGetWorkflowsQuery","populate","React","useEffect","type","message","createWorkflow","useCreateWorkflowMutation","create","useCallback","res","err","updateWorkflow","useUpdateWorkflowMutation","update","deleteWorkflow","useDeleteWorkflowMutation","deleteAction","workflows","meta","delete","DRAG_DROP_TYPES","STAGE","StageDragPreview","name","_jsxs","Flex","background","borderStyle","borderColor","borderWidth","gap","hasRadius","padding","shadow","width","_jsx","alignItems","borderRadius","height","justifyContent","CaretDown","fill","Typography","fontWeight","getStyle","initialOffset","currentOffset","mouseOffset","display","x","y","transform","DragLayerRendered","itemType","isDragging","item","useDragLayer","monitor","getItem","getItemType","getInitialSourceClientOffset","getSourceClientOffset","getClientOffset","Box","left","position","pointerEvents","top","zIndex","style","Root","children","Page","Main","Layouts","Content","Header","title","subtitle","navigationAction","primaryAction","_Fragment","Title","BaseHeader"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAMA,4BAA+B,GAAA;IACnCC,EAAI,EAAA,oBAAA;IACJC,cAAgB,EAAA;AAClB,CAAA;AAMA,MAAMC,kBAAqB,GAAA,CAACC,MAAiC,GAAA,EAAE,GAAA;IAC7D,MAAM,EAAEC,kBAAkB,EAAE,GAAGC,2BAAAA,EAAAA;IAC/B,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAC1B,IAAA,MAAM,EAAEC,uBAAAA,EAAyBC,cAAc,EAAE,GAAGC,8BAAAA,EAAAA;AAEpD,IAAA,MAAM,EAAEC,IAAO,GAAA,KAAK,EAAE,GAAGC,aAAa,GAAGT,MAAAA;IAEzC,MAAM,EAAEU,IAAI,EAAEC,SAAS,EAAEC,KAAK,EAAE,GAAGC,0BACjC,CAAA;QACEC,QAAU,EAAA;AAAC,YAAA,QAAA;AAAU,YAAA;AAAyB,SAAA;AAC9C,QAAA,GAAGL;KAEL,EAAA;AACED,QAAAA;AACF,KAAA,CAAA;AAGFO,IAAAA,gBAAAA,CAAMC,SAAS,CAAC,IAAA;AACd,QAAA,IAAIJ,KAAO,EAAA;YACTX,kBAAmB,CAAA;gBACjBgB,IAAM,EAAA,QAAA;AACNC,gBAAAA,OAAAA,EAASZ,cAAeM,CAAAA,KAAAA;AAC1B,aAAA,CAAA;AACF;KACC,EAAA;AAACA,QAAAA,KAAAA;AAAON,QAAAA,cAAAA;AAAgBL,QAAAA;AAAmB,KAAA,CAAA;IAE9C,MAAM,CAACkB,eAAe,GAAGC,+BAAAA,EAAAA;AACzB,IAAA,MAAMC,MAASN,GAAAA,gBAAAA,CAAMO,WAAW,CAC9B,OAAOZ,IA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C,aAAeC,EAAAA,WAAAA,CAAAA;;8BACjDZ,cAACb,CAAAA,gBAAAA,EAAAA;AAAiBC,oBAAAA,IAAAA,EAAM,OAAOgC,IAAKA,CAAAA,IAAI,KAAK,QAAWA,GAAAA,IAAAA,CAAKA,IAAI,GAAG;;AAAQ,gBAAA;;;;AAIpF;AAEA,MAAMe,IAA0C,GAAA,CAAC,EAAEC,QAAQ,EAAE,GAAA;IAC3D,qBACEpC,cAAA,CAACqC,iBAAKC,IAAI,EAAA;gCACRtC,cAAA,CAACuC,oBAAQC,OAAO,EAAA;AAAEJ,YAAAA,QAAAA,EAAAA;;;AAGxB;AAUMK,MAAAA,MAAAA,GAAgC,CAAC,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,gBAAgB,EAAEC,aAAa,EAAE,GAAA;IACzF,MAAM,EAAE3F,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;IAC1B,qBACEkC,eAAA,CAAAyD,mBAAA,EAAA;;AACE,0BAAA9C,cAAA,CAACqC,iBAAKU,KAAK,EAAA;0BACR7F,aACC,CAAA;oBAAEN,EAAI,EAAA,oBAAA;oBAAsBC,cAAgB,EAAA;iBAC5C,EAAA;oBACEuC,IAAMsD,EAAAA;AACR,iBAAA;;AAGJ,0BAAA1C,cAAA,CAACuC,oBAAQS,UAAU,EAAA;gBACjBJ,gBAAkBA,EAAAA,gBAAAA;gBAClBC,aAAeA,EAAAA,aAAAA;gBACfH,KAAOA,EAAAA,KAAAA;gBACPC,QAAUA,EAAAA;;;;AAIlB;;;;;;;;"}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
var en = {
|
2
|
+
"settings.page.title": "Review Workflows",
|
3
|
+
"settings.page.subtitle": "{count, plural, one {# stage} other {# stages}}",
|
4
|
+
"settings.page.isLoading": "Workflow is loading",
|
5
|
+
"settings.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the previous stage. Are you sure you want to save?",
|
6
|
+
"settings.stage.name.label": "Stage name",
|
7
|
+
"settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows.",
|
8
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Required stage for publishing",
|
9
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Any stage",
|
10
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Prevents entries from being published if they are not at the required stage."
|
11
|
+
};
|
12
|
+
|
13
|
+
export { en as default };
|
14
|
+
//# sourceMappingURL=en-BixG7IBu.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"en-BixG7IBu.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
'use strict';
|
2
|
+
|
3
|
+
var en = {
|
4
|
+
"settings.page.title": "Review Workflows",
|
5
|
+
"settings.page.subtitle": "{count, plural, one {# stage} other {# stages}}",
|
6
|
+
"settings.page.isLoading": "Workflow is loading",
|
7
|
+
"settings.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the previous stage. Are you sure you want to save?",
|
8
|
+
"settings.stage.name.label": "Stage name",
|
9
|
+
"settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows.",
|
10
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.label": "Required stage for publishing",
|
11
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.any": "Any stage",
|
12
|
+
"settings.review-workflows.workflow.stageRequiredToPublish.hint": "Prevents entries from being published if they are not at the required stage."
|
13
|
+
};
|
14
|
+
|
15
|
+
exports.default = en;
|
16
|
+
//# sourceMappingURL=en-C6SESe-Y.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"en-C6SESe-Y.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
|