@strapi/review-workflows 0.0.0-experimental.d23c1d5b0e45dd06ef09977f526c85468be05403 → 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d
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/_chunks/{Layout-facLKucY.mjs → Layout-BDKzgDbH.mjs} +10 -16
- package/dist/_chunks/Layout-BDKzgDbH.mjs.map +1 -0
- package/dist/_chunks/{Layout-dGg4FA1R.js → Layout-y4m6QHjX.js} +7 -15
- package/dist/_chunks/Layout-y4m6QHjX.js.map +1 -0
- package/dist/_chunks/{_id-B6DgrtpA.js → _id-CB3lqKgb.js} +300 -359
- package/dist/_chunks/_id-CB3lqKgb.js.map +1 -0
- package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-yOfUu1Rs.mjs} +294 -351
- package/dist/_chunks/_id-yOfUu1Rs.mjs.map +1 -0
- package/dist/_chunks/{index-QbWLXdZR.mjs → index--7HYUi67.mjs} +24 -37
- package/dist/_chunks/index--7HYUi67.mjs.map +1 -0
- package/dist/_chunks/{index-DX8AGcIP.js → index-Bj7gelY1.js} +113 -165
- package/dist/_chunks/index-Bj7gelY1.js.map +1 -0
- package/dist/_chunks/{index-D7Y0ofdg.mjs → index-Bx0Y1GZR.mjs} +113 -163
- package/dist/_chunks/index-Bx0Y1GZR.mjs.map +1 -0
- package/dist/_chunks/{index-BuKZWpJw.js → index-CNKQvAnM.js} +25 -40
- package/dist/_chunks/index-CNKQvAnM.js.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-B-V0sA2I.mjs → purchase-review-workflows-BN-5Ube7.mjs} +8 -7
- package/dist/_chunks/purchase-review-workflows-BN-5Ube7.mjs.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-DlCDg0fD.js} +7 -6
- package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +1 -0
- package/dist/_chunks/{router-CL62NScV.js → router-LZ2xbb95.js} +3 -3
- package/dist/_chunks/{router-CL62NScV.js.map → router-LZ2xbb95.js.map} +1 -1
- package/dist/_chunks/{router-ylD0eA48.mjs → router-t6Nj4F0T.mjs} +3 -3
- package/dist/_chunks/{router-ylD0eA48.mjs.map → router-t6Nj4F0T.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/LimitsModal.d.ts +2 -4
- package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +1 -1
- package/dist/admin/src/routes/settings/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +3 -3
- package/dist/admin/src/services/admin.d.ts +2 -2
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/content-manager.d.ts +7 -7
- package/dist/admin/src/services/settings.d.ts +4 -4
- package/dist/admin/src/utils/api.d.ts +4 -19
- package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
- package/package.json +14 -15
- package/dist/_chunks/Layout-dGg4FA1R.js.map +0 -1
- package/dist/_chunks/Layout-facLKucY.mjs.map +0 -1
- package/dist/_chunks/_id-B6DgrtpA.js.map +0 -1
- package/dist/_chunks/_id-D4CXKOqG.mjs.map +0 -1
- package/dist/_chunks/index-BuKZWpJw.js.map +0 -1
- package/dist/_chunks/index-D7Y0ofdg.mjs.map +0 -1
- package/dist/_chunks/index-DX8AGcIP.js.map +0 -1
- package/dist/_chunks/index-QbWLXdZR.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +0 -1
|
@@ -11,13 +11,11 @@ const reactIntl = require("react-intl");
|
|
|
11
11
|
const reactRedux = require("react-redux");
|
|
12
12
|
const reactRouterDom = require("react-router-dom");
|
|
13
13
|
const yup = require("yup");
|
|
14
|
-
const index = require("./index-
|
|
15
|
-
const Layout = require("./Layout-
|
|
16
|
-
const v2 = require("@strapi/design-system/v2");
|
|
14
|
+
const index = require("./index-Bj7gelY1.js");
|
|
15
|
+
const Layout = require("./Layout-y4m6QHjX.js");
|
|
17
16
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
|
18
|
-
const
|
|
17
|
+
const styledComponents = require("styled-components");
|
|
19
18
|
const reactDnd = require("react-dnd");
|
|
20
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
21
19
|
function _interopNamespace(e) {
|
|
22
20
|
if (e && e.__esModule)
|
|
23
21
|
return e;
|
|
@@ -38,11 +36,10 @@ function _interopNamespace(e) {
|
|
|
38
36
|
}
|
|
39
37
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
40
38
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
41
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
42
39
|
const adminApi = index.reviewWorkflowsApi.injectEndpoints({
|
|
43
40
|
endpoints(builder) {
|
|
44
41
|
return {
|
|
45
|
-
|
|
42
|
+
getAdminRoles: builder.query({
|
|
46
43
|
query: () => ({
|
|
47
44
|
url: `/admin/roles`,
|
|
48
45
|
method: "GET"
|
|
@@ -54,7 +51,7 @@ const adminApi = index.reviewWorkflowsApi.injectEndpoints({
|
|
|
54
51
|
};
|
|
55
52
|
}
|
|
56
53
|
});
|
|
57
|
-
const {
|
|
54
|
+
const { useGetAdminRolesQuery } = adminApi;
|
|
58
55
|
const useKeyboardDragAndDrop = (active, index2, { onCancel, onDropItem, onGrabItem, onMoveItem }) => {
|
|
59
56
|
const [isSelected, setIsSelected] = React__namespace.useState(false);
|
|
60
57
|
const handleMove = (movement) => {
|
|
@@ -273,74 +270,35 @@ const AddStage = ({ children, ...props }) => {
|
|
|
273
270
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
274
271
|
StyledButton,
|
|
275
272
|
{
|
|
276
|
-
|
|
273
|
+
tag: "button",
|
|
277
274
|
background: "neutral0",
|
|
278
|
-
|
|
275
|
+
borderColor: "neutral150",
|
|
279
276
|
paddingBottom: 3,
|
|
280
277
|
paddingLeft: 4,
|
|
281
278
|
paddingRight: 4,
|
|
282
279
|
paddingTop: 3,
|
|
283
280
|
shadow: "filterShadow",
|
|
284
281
|
...props,
|
|
285
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
286
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
287
|
-
|
|
288
|
-
] })
|
|
282
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
|
283
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
|
|
284
|
+
children
|
|
285
|
+
] }) })
|
|
289
286
|
}
|
|
290
287
|
);
|
|
291
288
|
};
|
|
292
|
-
const
|
|
293
|
-
> circle {
|
|
294
|
-
fill: ${({ theme }) => theme.colors.neutral150};
|
|
295
|
-
}
|
|
296
|
-
> path {
|
|
297
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
298
|
-
}
|
|
299
|
-
`;
|
|
300
|
-
const StyledButton = styled__default.default(designSystem.Box)`
|
|
289
|
+
const StyledButton = styledComponents.styled(designSystem.Box)`
|
|
301
290
|
border-radius: 26px;
|
|
302
|
-
|
|
303
|
-
svg {
|
|
304
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
305
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
306
|
-
|
|
307
|
-
> path {
|
|
308
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
309
|
-
}
|
|
310
|
-
}
|
|
291
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
311
292
|
|
|
312
293
|
&:hover {
|
|
313
|
-
color: ${({ theme }) => theme.colors.primary600}
|
|
314
|
-
${designSystem.Typography} {
|
|
315
|
-
color: ${({ theme }) => theme.colors.primary600} !important;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
${StyledAddIcon} {
|
|
319
|
-
> circle {
|
|
320
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
321
|
-
}
|
|
322
|
-
> path {
|
|
323
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
324
|
-
}
|
|
325
|
-
}
|
|
294
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
326
295
|
}
|
|
327
296
|
|
|
328
297
|
&:active {
|
|
329
|
-
${
|
|
330
|
-
color: ${({ theme }) => theme.colors.primary600};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
${StyledAddIcon} {
|
|
334
|
-
> circle {
|
|
335
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
336
|
-
}
|
|
337
|
-
> path {
|
|
338
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
339
|
-
}
|
|
340
|
-
}
|
|
298
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
341
299
|
}
|
|
342
300
|
`;
|
|
343
|
-
const Stages = ({ canDelete = true, canUpdate = true, isCreating
|
|
301
|
+
const Stages = ({ canDelete = true, canUpdate = true, isCreating }) => {
|
|
344
302
|
const { formatMessage } = reactIntl.useIntl();
|
|
345
303
|
const { trackUsage } = strapiAdmin.useTracking();
|
|
346
304
|
const addFieldRow = strapiAdmin.useForm("Stages", (state) => state.addFieldRow);
|
|
@@ -367,9 +325,9 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
|
367
325
|
gap: 6,
|
|
368
326
|
zIndex: 2,
|
|
369
327
|
position: "relative",
|
|
370
|
-
|
|
328
|
+
tag: "ol",
|
|
371
329
|
children: stages.map((stage, index2) => {
|
|
372
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, {
|
|
330
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
373
331
|
Stage,
|
|
374
332
|
{
|
|
375
333
|
index: index2,
|
|
@@ -377,7 +335,7 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
|
377
335
|
canReorder: stages.length > 1,
|
|
378
336
|
canUpdate,
|
|
379
337
|
stagesCount: stages.length,
|
|
380
|
-
|
|
338
|
+
defaultOpen: isCreating,
|
|
381
339
|
...stage
|
|
382
340
|
}
|
|
383
341
|
) }, stage.__temp_key__);
|
|
@@ -401,7 +359,7 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
|
401
359
|
)
|
|
402
360
|
] });
|
|
403
361
|
};
|
|
404
|
-
const Background =
|
|
362
|
+
const Background = styledComponents.styled(designSystem.Box)`
|
|
405
363
|
transform: translateX(-50%);
|
|
406
364
|
`;
|
|
407
365
|
const Stage = ({
|
|
@@ -409,16 +367,15 @@ const Stage = ({
|
|
|
409
367
|
canDelete = false,
|
|
410
368
|
canReorder = false,
|
|
411
369
|
canUpdate = false,
|
|
412
|
-
isOpen: isOpenDefault = false,
|
|
413
370
|
stagesCount,
|
|
414
371
|
name,
|
|
415
372
|
permissions,
|
|
416
|
-
color
|
|
373
|
+
color,
|
|
374
|
+
defaultOpen
|
|
417
375
|
}) => {
|
|
418
376
|
const [liveText, setLiveText] = React__namespace.useState();
|
|
419
377
|
const { formatMessage } = reactIntl.useIntl();
|
|
420
378
|
const { trackUsage } = strapiAdmin.useTracking();
|
|
421
|
-
const [isOpen, setIsOpen] = React__namespace.useState(isOpenDefault);
|
|
422
379
|
const stageErrors = strapiAdmin.useForm("Stages", (state) => state.errors.stages);
|
|
423
380
|
const error = stageErrors?.[index2];
|
|
424
381
|
const addFieldRow = strapiAdmin.useForm("Stage", (state) => state.addFieldRow);
|
|
@@ -500,7 +457,8 @@ const Stage = ({
|
|
|
500
457
|
const handleCloneClick = () => {
|
|
501
458
|
addFieldRow("stages", { name, color, permissions });
|
|
502
459
|
};
|
|
503
|
-
|
|
460
|
+
const id = React__namespace.useId();
|
|
461
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref: composedRef, children: [
|
|
504
462
|
liveText && /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
|
|
505
463
|
isDragging ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
506
464
|
designSystem.Box,
|
|
@@ -511,74 +469,61 @@ const Stage = ({
|
|
|
511
469
|
borderWidth: "1px",
|
|
512
470
|
display: "block",
|
|
513
471
|
hasRadius: true,
|
|
514
|
-
padding: 6
|
|
515
|
-
shadow: "tableShadow"
|
|
472
|
+
padding: 6
|
|
516
473
|
}
|
|
517
|
-
) : /* @__PURE__ */ jsxRuntime.
|
|
518
|
-
|
|
474
|
+
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
475
|
+
AccordionRoot,
|
|
519
476
|
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
onToggle: () => {
|
|
523
|
-
setIsOpen(!isOpen);
|
|
524
|
-
if (!isOpen) {
|
|
477
|
+
onValueChange: (value) => {
|
|
478
|
+
if (value) {
|
|
525
479
|
trackUsage("willEditStage");
|
|
526
480
|
}
|
|
527
481
|
},
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
|
|
542
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { as: "span", children: formatMessage({
|
|
543
|
-
id: "[tbdb].components.DynamicZone.more-actions",
|
|
544
|
-
defaultMessage: "More actions"
|
|
545
|
-
}) })
|
|
546
|
-
] }),
|
|
547
|
-
/* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.SubRoot, { children: [
|
|
548
|
-
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(v2.MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
549
|
-
id: "Settings.review-workflows.stage.delete",
|
|
550
|
-
defaultMessage: "Duplicate stage"
|
|
551
|
-
}) }),
|
|
552
|
-
canDelete && /* @__PURE__ */ jsxRuntime.jsx(DeleteMenuItem, { onClick: () => removeFieldRow("stages", index2), children: formatMessage({
|
|
553
|
-
id: "Settings.review-workflows.stage.delete",
|
|
554
|
-
defaultMessage: "Delete"
|
|
555
|
-
}) })
|
|
556
|
-
] }) })
|
|
482
|
+
defaultValue: defaultOpen ? id : void 0,
|
|
483
|
+
$error: Object.values(error ?? {}).length > 0,
|
|
484
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: id, children: [
|
|
485
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
|
486
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Trigger, { children: name }),
|
|
487
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: canDelete || canUpdate ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
488
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
489
|
+
/* @__PURE__ */ jsxRuntime.jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
|
|
490
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
|
|
491
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage({
|
|
492
|
+
id: "[tbdb].components.DynamicZone.more-actions",
|
|
493
|
+
defaultMessage: "More actions"
|
|
494
|
+
}) })
|
|
557
495
|
] }),
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
496
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.SubRoot, { children: [
|
|
497
|
+
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
498
|
+
id: "Settings.review-workflows.stage.delete",
|
|
499
|
+
defaultMessage: "Duplicate stage"
|
|
500
|
+
}) }),
|
|
501
|
+
canDelete && /* @__PURE__ */ jsxRuntime.jsx(DeleteMenuItem, { onClick: () => removeFieldRow("stages", index2), children: formatMessage({
|
|
502
|
+
id: "Settings.review-workflows.stage.delete",
|
|
503
|
+
defaultMessage: "Delete"
|
|
504
|
+
}) })
|
|
505
|
+
] }) })
|
|
506
|
+
] }),
|
|
507
|
+
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
508
|
+
designSystem.IconButton,
|
|
509
|
+
{
|
|
510
|
+
background: "transparent",
|
|
511
|
+
hasRadius: true,
|
|
512
|
+
borderWidth: 0,
|
|
513
|
+
"data-handler-id": handlerId,
|
|
514
|
+
ref: dragRef,
|
|
515
|
+
label: formatMessage({
|
|
516
|
+
id: "Settings.review-workflows.stage.drag",
|
|
517
|
+
defaultMessage: "Drag"
|
|
518
|
+
}),
|
|
519
|
+
onClick: (e) => e.stopPropagation(),
|
|
520
|
+
onKeyDown: handleKeyDown,
|
|
521
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Drag, {})
|
|
522
|
+
}
|
|
523
|
+
)
|
|
524
|
+
] }) : null })
|
|
525
|
+
] }),
|
|
526
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, padding: 6, children: [
|
|
582
527
|
{
|
|
583
528
|
disabled: !canUpdate,
|
|
584
529
|
label: formatMessage({
|
|
@@ -616,16 +561,20 @@ const Stage = ({
|
|
|
616
561
|
size: 6,
|
|
617
562
|
type: "permissions"
|
|
618
563
|
}
|
|
619
|
-
].map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
620
|
-
]
|
|
564
|
+
].map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(InputRenderer, { ...field }) }, field.name)) }) })
|
|
565
|
+
] })
|
|
621
566
|
}
|
|
622
567
|
)
|
|
623
568
|
] });
|
|
624
569
|
};
|
|
625
|
-
const
|
|
570
|
+
const AccordionRoot = styledComponents.styled(designSystem.Accordion.Root)`
|
|
571
|
+
border: 1px solid
|
|
572
|
+
${({ theme, $error }) => $error ? theme.colors.danger600 : theme.colors.neutral200};
|
|
573
|
+
`;
|
|
574
|
+
const DeleteMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
626
575
|
color: ${({ theme }) => theme.colors.danger600};
|
|
627
576
|
`;
|
|
628
|
-
const ContextMenuTrigger =
|
|
577
|
+
const ContextMenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
|
|
629
578
|
:hover,
|
|
630
579
|
:focus {
|
|
631
580
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
@@ -635,22 +584,6 @@ const ContextMenuTrigger = styled__default.default(v2.Menu.Trigger)`
|
|
|
635
584
|
font-size: 0;
|
|
636
585
|
}
|
|
637
586
|
`;
|
|
638
|
-
const DragIconButton = styled__default.default(designSystem.IconButton)`
|
|
639
|
-
align-items: center;
|
|
640
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
641
|
-
display: flex;
|
|
642
|
-
justify-content: center;
|
|
643
|
-
|
|
644
|
-
&:hover,
|
|
645
|
-
&:focus {
|
|
646
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
svg {
|
|
650
|
-
height: auto;
|
|
651
|
-
width: ${({ theme }) => theme.spaces[3]};
|
|
652
|
-
}
|
|
653
|
-
`;
|
|
654
587
|
const InputRenderer = (props) => {
|
|
655
588
|
switch (props.type) {
|
|
656
589
|
case "color":
|
|
@@ -676,54 +609,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
|
|
|
676
609
|
color: hex
|
|
677
610
|
}));
|
|
678
611
|
const { themeColorName } = index.getStageColorByHex(value) ?? {};
|
|
679
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
680
|
-
designSystem.
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
designSystem.Flex,
|
|
692
|
-
{
|
|
693
|
-
as: "span",
|
|
694
|
-
height: 2,
|
|
695
|
-
background: value,
|
|
696
|
-
borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
|
|
697
|
-
hasRadius: true,
|
|
698
|
-
shrink: 0,
|
|
699
|
-
width: 2
|
|
700
|
-
}
|
|
701
|
-
),
|
|
702
|
-
children: colorOptions.map(({ value: value2, label: label2, color }) => {
|
|
703
|
-
const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
|
|
704
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
705
|
-
designSystem.SingleSelectOption,
|
|
612
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required, children: [
|
|
613
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: label }),
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
615
|
+
designSystem.SingleSelect,
|
|
616
|
+
{
|
|
617
|
+
disabled,
|
|
618
|
+
onChange: (v) => {
|
|
619
|
+
onChange(name, v.toString());
|
|
620
|
+
},
|
|
621
|
+
value: value?.toUpperCase(),
|
|
622
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
623
|
+
designSystem.Flex,
|
|
706
624
|
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
625
|
+
tag: "span",
|
|
626
|
+
height: 2,
|
|
627
|
+
background: value,
|
|
628
|
+
borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
|
|
629
|
+
hasRadius: true,
|
|
630
|
+
shrink: 0,
|
|
631
|
+
width: 2
|
|
632
|
+
}
|
|
633
|
+
),
|
|
634
|
+
children: colorOptions.map(({ value: value2, label: label2, color }) => {
|
|
635
|
+
const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
|
|
636
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
637
|
+
designSystem.SingleSelectOption,
|
|
638
|
+
{
|
|
639
|
+
value: value2,
|
|
640
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
641
|
+
designSystem.Flex,
|
|
642
|
+
{
|
|
643
|
+
tag: "span",
|
|
644
|
+
height: 2,
|
|
645
|
+
background: color,
|
|
646
|
+
borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
|
|
647
|
+
hasRadius: true,
|
|
648
|
+
shrink: 0,
|
|
649
|
+
width: 2
|
|
650
|
+
}
|
|
651
|
+
),
|
|
652
|
+
children: label2
|
|
653
|
+
},
|
|
654
|
+
value2
|
|
655
|
+
);
|
|
656
|
+
})
|
|
657
|
+
}
|
|
658
|
+
),
|
|
659
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
660
|
+
] });
|
|
727
661
|
};
|
|
728
662
|
const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
729
663
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -732,7 +666,7 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
732
666
|
const { value = [], error, onChange } = strapiAdmin.useField(name);
|
|
733
667
|
const allStages = strapiAdmin.useForm("PermissionsField", (state) => state.values.stages);
|
|
734
668
|
const onFormValueChange = strapiAdmin.useForm("PermissionsField", (state) => state.onChange);
|
|
735
|
-
const { data: roles = [], isLoading } =
|
|
669
|
+
const { data: roles = [], isLoading } = useGetAdminRolesQuery();
|
|
736
670
|
const filteredRoles = roles?.filter((role) => role.code !== "strapi-super-admin") ?? [];
|
|
737
671
|
React__namespace.useEffect(() => {
|
|
738
672
|
if (!isLoading && roles.length === 0) {
|
|
@@ -747,42 +681,48 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
747
681
|
}
|
|
748
682
|
}, [formatMessage, isLoading, roles, toggleNotification]);
|
|
749
683
|
if (!isLoading && filteredRoles.length === 0) {
|
|
750
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
751
|
-
designSystem.
|
|
684
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
685
|
+
designSystem.Field.Root,
|
|
752
686
|
{
|
|
753
|
-
disabled: true,
|
|
754
687
|
name,
|
|
755
688
|
hint: formatMessage({
|
|
756
689
|
id: "Settings.review-workflows.stage.permissions.noPermissions.description",
|
|
757
690
|
defaultMessage: "You don’t have the permission to see roles"
|
|
758
691
|
}),
|
|
759
|
-
label: formatMessage({
|
|
760
|
-
id: "Settings.review-workflows.stage.permissions.label",
|
|
761
|
-
defaultMessage: "Roles that can change this stage"
|
|
762
|
-
}),
|
|
763
|
-
placeholder: formatMessage({
|
|
764
|
-
id: "components.NotAllowedInput.text",
|
|
765
|
-
defaultMessage: "No permissions to see this field"
|
|
766
|
-
}),
|
|
767
692
|
required,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
693
|
+
children: [
|
|
694
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
695
|
+
id: "Settings.review-workflows.stage.permissions.label",
|
|
696
|
+
defaultMessage: "Roles that can change this stage"
|
|
697
|
+
}) }),
|
|
698
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
699
|
+
designSystem.TextInput,
|
|
700
|
+
{
|
|
701
|
+
disabled: true,
|
|
702
|
+
placeholder: formatMessage({
|
|
703
|
+
id: "components.NotAllowedInput.text",
|
|
704
|
+
defaultMessage: "No permissions to see this field"
|
|
705
|
+
}),
|
|
706
|
+
startAction: /* @__PURE__ */ jsxRuntime.jsx(icons.EyeStriked, { fill: "neutral600" }),
|
|
707
|
+
type: "text",
|
|
708
|
+
value: ""
|
|
709
|
+
}
|
|
710
|
+
),
|
|
711
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
712
|
+
]
|
|
771
713
|
}
|
|
772
714
|
);
|
|
773
715
|
}
|
|
774
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
775
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
|
776
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
716
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
|
|
717
|
+
/* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required: true, children: [
|
|
718
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
719
|
+
id: "Settings.review-workflows.stage.permissions.label",
|
|
720
|
+
defaultMessage: "Roles that can change this stage"
|
|
721
|
+
}) }),
|
|
722
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
777
723
|
designSystem.MultiSelect,
|
|
778
724
|
{
|
|
779
725
|
disabled,
|
|
780
|
-
error,
|
|
781
|
-
id: name,
|
|
782
|
-
label: formatMessage({
|
|
783
|
-
id: "Settings.review-workflows.stage.permissions.label",
|
|
784
|
-
defaultMessage: "Roles that can change this stage"
|
|
785
|
-
}),
|
|
786
726
|
onChange: (values) => {
|
|
787
727
|
const permissions = values.map((value2) => ({
|
|
788
728
|
role: parseInt(value2, 10),
|
|
@@ -791,7 +731,6 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
791
731
|
onChange(name, permissions);
|
|
792
732
|
},
|
|
793
733
|
placeholder,
|
|
794
|
-
required: true,
|
|
795
734
|
value: value.map((permission) => `${permission.role}`),
|
|
796
735
|
withTags: true,
|
|
797
736
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -808,70 +747,65 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
808
747
|
}
|
|
809
748
|
)
|
|
810
749
|
}
|
|
811
|
-
)
|
|
812
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
750
|
+
),
|
|
751
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
752
|
+
] }) }),
|
|
753
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isApplyAllConfirmationOpen, onOpenChange: setIsApplyAllConfirmationOpen, children: [
|
|
754
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
813
755
|
designSystem.IconButton,
|
|
814
756
|
{
|
|
815
757
|
disabled,
|
|
816
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {}),
|
|
817
758
|
label: formatMessage({
|
|
818
759
|
id: "Settings.review-workflows.stage.permissions.apply.label",
|
|
819
760
|
defaultMessage: "Apply to all stages"
|
|
820
761
|
}),
|
|
821
762
|
size: "L",
|
|
822
763
|
variant: "secondary",
|
|
823
|
-
|
|
764
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {})
|
|
765
|
+
}
|
|
766
|
+
) }),
|
|
767
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
768
|
+
strapiAdmin.ConfirmDialog,
|
|
769
|
+
{
|
|
770
|
+
onConfirm: () => {
|
|
771
|
+
onFormValueChange(
|
|
772
|
+
"stages",
|
|
773
|
+
allStages.map((stage) => ({
|
|
774
|
+
...stage,
|
|
775
|
+
permissions: value
|
|
776
|
+
}))
|
|
777
|
+
);
|
|
778
|
+
setIsApplyAllConfirmationOpen(false);
|
|
779
|
+
toggleNotification({
|
|
780
|
+
type: "success",
|
|
781
|
+
message: formatMessage({
|
|
782
|
+
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success",
|
|
783
|
+
defaultMessage: "Applied roles to all other stages of the workflow"
|
|
784
|
+
})
|
|
785
|
+
});
|
|
786
|
+
},
|
|
787
|
+
variant: "default",
|
|
788
|
+
children: formatMessage({
|
|
789
|
+
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy",
|
|
790
|
+
defaultMessage: "Roles that can change that stage will be applied to all the other stages."
|
|
791
|
+
})
|
|
824
792
|
}
|
|
825
793
|
)
|
|
826
|
-
] })
|
|
827
|
-
|
|
828
|
-
strapiAdmin.ConfirmDialog,
|
|
829
|
-
{
|
|
830
|
-
isOpen: isApplyAllConfirmationOpen,
|
|
831
|
-
onClose: () => setIsApplyAllConfirmationOpen(false),
|
|
832
|
-
onConfirm: () => {
|
|
833
|
-
onFormValueChange(
|
|
834
|
-
"stages",
|
|
835
|
-
allStages.map((stage) => ({
|
|
836
|
-
...stage,
|
|
837
|
-
permissions: value
|
|
838
|
-
}))
|
|
839
|
-
);
|
|
840
|
-
setIsApplyAllConfirmationOpen(false);
|
|
841
|
-
toggleNotification({
|
|
842
|
-
type: "success",
|
|
843
|
-
message: formatMessage({
|
|
844
|
-
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success",
|
|
845
|
-
defaultMessage: "Applied roles to all other stages of the workflow"
|
|
846
|
-
})
|
|
847
|
-
});
|
|
848
|
-
},
|
|
849
|
-
variant: "default",
|
|
850
|
-
children: formatMessage({
|
|
851
|
-
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy",
|
|
852
|
-
defaultMessage: "Roles that can change that stage will be applied to all the other stages."
|
|
853
|
-
})
|
|
854
|
-
}
|
|
855
|
-
)
|
|
856
|
-
] });
|
|
794
|
+
] })
|
|
795
|
+
] }) });
|
|
857
796
|
};
|
|
858
|
-
const
|
|
859
|
-
& > path {
|
|
860
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
861
|
-
}
|
|
862
|
-
`;
|
|
863
|
-
const NestedOption$1 = styled__default.default(designSystem.MultiSelectOption)`
|
|
797
|
+
const NestedOption$1 = styledComponents.styled(designSystem.MultiSelectOption)`
|
|
864
798
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
865
799
|
`;
|
|
866
|
-
const PermissionWrapper =
|
|
800
|
+
const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
|
|
867
801
|
> * {
|
|
868
802
|
flex-grow: 1;
|
|
869
803
|
}
|
|
870
804
|
`;
|
|
871
805
|
const WorkflowAttributes = ({ canUpdate = true }) => {
|
|
872
806
|
const { formatMessage } = reactIntl.useIntl();
|
|
873
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
|
|
874
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
807
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
|
|
808
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
875
809
|
strapiAdmin.InputRenderer,
|
|
876
810
|
{
|
|
877
811
|
disabled: !canUpdate,
|
|
@@ -884,7 +818,7 @@ const WorkflowAttributes = ({ canUpdate = true }) => {
|
|
|
884
818
|
type: "string"
|
|
885
819
|
}
|
|
886
820
|
) }),
|
|
887
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
821
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(ContentTypesSelector, { disabled: !canUpdate }) })
|
|
888
822
|
] });
|
|
889
823
|
};
|
|
890
824
|
const ContentTypesSelector = ({ disabled }) => {
|
|
@@ -905,86 +839,87 @@ const ContentTypesSelector = ({ disabled }) => {
|
|
|
905
839
|
label: contentType.info.displayName,
|
|
906
840
|
value: contentType.uid
|
|
907
841
|
}));
|
|
908
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
909
|
-
designSystem.
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
),
|
|
918
|
-
disabled: isDisabled,
|
|
919
|
-
error,
|
|
920
|
-
label: formatMessage({
|
|
921
|
-
id: "Settings.review-workflows.workflow.contentTypes.label",
|
|
922
|
-
defaultMessage: "Associated to"
|
|
923
|
-
}),
|
|
924
|
-
onChange: (values) => {
|
|
925
|
-
onChange("contentTypes", values);
|
|
926
|
-
},
|
|
927
|
-
value,
|
|
928
|
-
placeholder: formatMessage({
|
|
929
|
-
id: "Settings.review-workflows.workflow.contentTypes.placeholder",
|
|
930
|
-
defaultMessage: "Select"
|
|
931
|
-
}),
|
|
932
|
-
children: [
|
|
933
|
-
...collectionTypes.length > 0 ? [
|
|
934
|
-
{
|
|
935
|
-
label: formatMessage({
|
|
936
|
-
id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
|
|
937
|
-
defaultMessage: "Collection Types"
|
|
938
|
-
}),
|
|
939
|
-
children: collectionTypes
|
|
940
|
-
}
|
|
941
|
-
] : [],
|
|
942
|
-
...singleTypes.length > 0 ? [
|
|
943
|
-
{
|
|
944
|
-
label: formatMessage({
|
|
945
|
-
id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
|
|
946
|
-
defaultMessage: "Single Types"
|
|
947
|
-
}),
|
|
948
|
-
children: singleTypes
|
|
949
|
-
}
|
|
950
|
-
] : []
|
|
951
|
-
].map((opt) => {
|
|
952
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
953
|
-
designSystem.MultiSelectGroup,
|
|
842
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name: "contentTypes", children: [
|
|
843
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
844
|
+
id: "Settings.review-workflows.workflow.contentTypes.label",
|
|
845
|
+
defaultMessage: "Associated to"
|
|
846
|
+
}) }),
|
|
847
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
848
|
+
designSystem.MultiSelect,
|
|
849
|
+
{
|
|
850
|
+
customizeContent: (value2) => formatMessage(
|
|
954
851
|
{
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
children: opt.children.map((child) => {
|
|
958
|
-
const { name: assignedWorkflowName } = workflows?.find(
|
|
959
|
-
(workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
|
|
960
|
-
) ?? {};
|
|
961
|
-
return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
|
962
|
-
// @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
|
|
963
|
-
children: formatMessage(
|
|
964
|
-
{
|
|
965
|
-
id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
|
|
966
|
-
defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
|
|
967
|
-
},
|
|
968
|
-
{
|
|
969
|
-
label: child.label,
|
|
970
|
-
name: assignedWorkflowName,
|
|
971
|
-
em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "em", fontWeight: "bold", children }),
|
|
972
|
-
i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
|
|
973
|
-
}
|
|
974
|
-
)
|
|
975
|
-
}) }, child.value);
|
|
976
|
-
})
|
|
852
|
+
id: "Settings.review-workflows.workflow.contentTypes.displayValue",
|
|
853
|
+
defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
|
|
977
854
|
},
|
|
978
|
-
|
|
979
|
-
)
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
855
|
+
{ count: value2?.length }
|
|
856
|
+
),
|
|
857
|
+
disabled: isDisabled,
|
|
858
|
+
onChange: (values) => {
|
|
859
|
+
onChange("contentTypes", values);
|
|
860
|
+
},
|
|
861
|
+
value,
|
|
862
|
+
placeholder: formatMessage({
|
|
863
|
+
id: "Settings.review-workflows.workflow.contentTypes.placeholder",
|
|
864
|
+
defaultMessage: "Select"
|
|
865
|
+
}),
|
|
866
|
+
children: [
|
|
867
|
+
...collectionTypes.length > 0 ? [
|
|
868
|
+
{
|
|
869
|
+
label: formatMessage({
|
|
870
|
+
id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
|
|
871
|
+
defaultMessage: "Collection Types"
|
|
872
|
+
}),
|
|
873
|
+
children: collectionTypes
|
|
874
|
+
}
|
|
875
|
+
] : [],
|
|
876
|
+
...singleTypes.length > 0 ? [
|
|
877
|
+
{
|
|
878
|
+
label: formatMessage({
|
|
879
|
+
id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
|
|
880
|
+
defaultMessage: "Single Types"
|
|
881
|
+
}),
|
|
882
|
+
children: singleTypes
|
|
883
|
+
}
|
|
884
|
+
] : []
|
|
885
|
+
].map((opt) => {
|
|
886
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
887
|
+
designSystem.MultiSelectGroup,
|
|
888
|
+
{
|
|
889
|
+
label: opt.label,
|
|
890
|
+
values: opt.children.map((child) => child.value.toString()),
|
|
891
|
+
children: opt.children.map((child) => {
|
|
892
|
+
const { name: assignedWorkflowName } = workflows?.find(
|
|
893
|
+
(workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
|
|
894
|
+
) ?? {};
|
|
895
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
|
896
|
+
// @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
|
|
897
|
+
children: formatMessage(
|
|
898
|
+
{
|
|
899
|
+
id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
|
|
900
|
+
defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
label: child.label,
|
|
904
|
+
name: assignedWorkflowName,
|
|
905
|
+
em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "em", fontWeight: "bold", children }),
|
|
906
|
+
i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
|
|
907
|
+
}
|
|
908
|
+
)
|
|
909
|
+
}) }, child.value);
|
|
910
|
+
})
|
|
911
|
+
},
|
|
912
|
+
opt.label
|
|
913
|
+
);
|
|
914
|
+
})
|
|
915
|
+
}
|
|
916
|
+
)
|
|
917
|
+
] });
|
|
983
918
|
};
|
|
984
|
-
const NestedOption =
|
|
919
|
+
const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
|
|
985
920
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
986
921
|
`;
|
|
987
|
-
const ContentTypeTakeNotice =
|
|
922
|
+
const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
|
|
988
923
|
font-style: italic;
|
|
989
924
|
`;
|
|
990
925
|
const WORKFLOW_SCHEMA = yup__namespace.object({
|
|
@@ -1251,12 +1186,11 @@ const EditPage = () => {
|
|
|
1251
1186
|
)
|
|
1252
1187
|
] }) }),
|
|
1253
1188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1254
|
-
|
|
1189
|
+
designSystem.Dialog.Root,
|
|
1255
1190
|
{
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
onConfirm: handleConfirmDeleteDialog(values, { setErrors }),
|
|
1259
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 5, children: [
|
|
1191
|
+
open: Object.keys(savePrompts).length > 0,
|
|
1192
|
+
onOpenChange: handleConfirmClose,
|
|
1193
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleConfirmDeleteDialog(values, { setErrors }), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 5, children: [
|
|
1260
1194
|
savePrompts.hasDeletedServerStages && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", variant: "omega", children: formatMessage({
|
|
1261
1195
|
id: "review-workflows.page.delete.confirm.stages.body",
|
|
1262
1196
|
defaultMessage: "All entries assigned to deleted stages will be moved to the previous stage."
|
|
@@ -1276,7 +1210,7 @@ const EditPage = () => {
|
|
|
1276
1210
|
id: "review-workflows.page.delete.confirm.confirm",
|
|
1277
1211
|
defaultMessage: "Are you sure you want to save?"
|
|
1278
1212
|
}) })
|
|
1279
|
-
] })
|
|
1213
|
+
] }) })
|
|
1280
1214
|
}
|
|
1281
1215
|
)
|
|
1282
1216
|
] })
|
|
@@ -1285,8 +1219,8 @@ const EditPage = () => {
|
|
|
1285
1219
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1286
1220
|
index.LimitsModal.Root,
|
|
1287
1221
|
{
|
|
1288
|
-
|
|
1289
|
-
|
|
1222
|
+
open: showLimitModal === "workflow",
|
|
1223
|
+
onOpenChange: () => setShowLimitModal(null),
|
|
1290
1224
|
children: [
|
|
1291
1225
|
/* @__PURE__ */ jsxRuntime.jsx(index.LimitsModal.Title, { children: formatMessage({
|
|
1292
1226
|
id: "review-workflows.edit.page.workflows.limit.title",
|
|
@@ -1299,16 +1233,23 @@ const EditPage = () => {
|
|
|
1299
1233
|
]
|
|
1300
1234
|
}
|
|
1301
1235
|
),
|
|
1302
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1236
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1237
|
+
index.LimitsModal.Root,
|
|
1238
|
+
{
|
|
1239
|
+
open: showLimitModal === "stage",
|
|
1240
|
+
onOpenChange: () => setShowLimitModal(null),
|
|
1241
|
+
children: [
|
|
1242
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.LimitsModal.Title, { children: formatMessage({
|
|
1243
|
+
id: "review-workflows.edit.page.stages.limit.title",
|
|
1244
|
+
defaultMessage: "You have reached the limit of stages for this workflow in your plan"
|
|
1245
|
+
}) }),
|
|
1246
|
+
/* @__PURE__ */ jsxRuntime.jsx(index.LimitsModal.Body, { children: formatMessage({
|
|
1247
|
+
id: "review-workflows.edit.page.stages.limit.body",
|
|
1248
|
+
defaultMessage: "Try deleting some stages or contact Sales to enable more stages."
|
|
1249
|
+
}) })
|
|
1250
|
+
]
|
|
1251
|
+
}
|
|
1252
|
+
)
|
|
1312
1253
|
] });
|
|
1313
1254
|
};
|
|
1314
1255
|
const addTmpKeysToStages = (data) => {
|
|
@@ -1330,4 +1271,4 @@ const ProtectedEditPage = () => {
|
|
|
1330
1271
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
|
|
1331
1272
|
};
|
|
1332
1273
|
exports.ProtectedEditPage = ProtectedEditPage;
|
|
1333
|
-
//# sourceMappingURL=_id-
|
|
1274
|
+
//# sourceMappingURL=_id-CB3lqKgb.js.map
|