@strapi/review-workflows 5.0.0-beta.5 → 5.0.0-beta.7
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-dGg4FA1R.js → Layout-60gjGInX.js} +8 -10
- package/dist/_chunks/Layout-60gjGInX.js.map +1 -0
- package/dist/_chunks/{Layout-facLKucY.mjs → Layout-CJYuYwXO.mjs} +10 -10
- package/dist/_chunks/Layout-CJYuYwXO.mjs.map +1 -0
- package/dist/_chunks/{_id-B6DgrtpA.js → _id-BO7wNLt1.js} +210 -242
- package/dist/_chunks/_id-BO7wNLt1.js.map +1 -0
- package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-UJ-8gken.mjs} +198 -228
- package/dist/_chunks/_id-UJ-8gken.mjs.map +1 -0
- package/dist/_chunks/{index-DX8AGcIP.js → index-CfiZnfhM.js} +83 -69
- package/dist/_chunks/index-CfiZnfhM.js.map +1 -0
- package/dist/_chunks/{index-QbWLXdZR.mjs → index-DhEhUlv9.mjs} +15 -21
- package/dist/_chunks/index-DhEhUlv9.mjs.map +1 -0
- package/dist/_chunks/{index-D7Y0ofdg.mjs → index-DmQNXb0P.mjs} +83 -67
- package/dist/_chunks/index-DmQNXb0P.mjs.map +1 -0
- package/dist/_chunks/{index-BuKZWpJw.js → index-DnXnsrOM.js} +16 -24
- package/dist/_chunks/index-DnXnsrOM.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-BiQI7EcM.js} +3 -3
- package/dist/_chunks/{router-CL62NScV.js.map → router-BiQI7EcM.js.map} +1 -1
- package/dist/_chunks/{router-ylD0eA48.mjs → router-DFD0S0ey.mjs} +3 -3
- package/dist/_chunks/{router-ylD0eA48.mjs.map → router-DFD0S0ey.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- 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/content-manager.d.ts +1 -1
- package/dist/admin/src/utils/api.d.ts +8 -9
- package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
- package/package.json +11 -12
- 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-CfiZnfhM.js");
|
|
15
|
+
const Layout = require("./Layout-60gjGInX.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,7 +36,6 @@ 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 {
|
|
@@ -273,7 +270,7 @@ 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
|
border: "neutral150",
|
|
279
276
|
paddingBottom: 3,
|
|
@@ -282,62 +279,23 @@ const AddStage = ({ children, ...props }) => {
|
|
|
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
301
|
const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
@@ -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,
|
|
@@ -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 = ({
|
|
@@ -500,7 +458,7 @@ const Stage = ({
|
|
|
500
458
|
const handleCloneClick = () => {
|
|
501
459
|
addFieldRow("stages", { name, color, permissions });
|
|
502
460
|
};
|
|
503
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref:
|
|
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,
|
|
@@ -536,16 +494,16 @@ const Stage = ({
|
|
|
536
494
|
title: name,
|
|
537
495
|
togglePosition: "left",
|
|
538
496
|
action: (canDelete || canUpdate) && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
539
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
497
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
540
498
|
/* @__PURE__ */ jsxRuntime.jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
|
|
541
499
|
/* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
|
|
542
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, {
|
|
500
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage({
|
|
543
501
|
id: "[tbdb].components.DynamicZone.more-actions",
|
|
544
502
|
defaultMessage: "More actions"
|
|
545
503
|
}) })
|
|
546
504
|
] }),
|
|
547
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
548
|
-
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
505
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.SubRoot, { children: [
|
|
506
|
+
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
549
507
|
id: "Settings.review-workflows.stage.delete",
|
|
550
508
|
defaultMessage: "Duplicate stage"
|
|
551
509
|
}) }),
|
|
@@ -559,7 +517,7 @@ const Stage = ({
|
|
|
559
517
|
DragIconButton,
|
|
560
518
|
{
|
|
561
519
|
background: "transparent",
|
|
562
|
-
|
|
520
|
+
tag: "div",
|
|
563
521
|
hasRadius: true,
|
|
564
522
|
role: "button",
|
|
565
523
|
noBorder: true,
|
|
@@ -622,10 +580,10 @@ const Stage = ({
|
|
|
622
580
|
)
|
|
623
581
|
] });
|
|
624
582
|
};
|
|
625
|
-
const DeleteMenuItem =
|
|
583
|
+
const DeleteMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
626
584
|
color: ${({ theme }) => theme.colors.danger600};
|
|
627
585
|
`;
|
|
628
|
-
const ContextMenuTrigger =
|
|
586
|
+
const ContextMenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
|
|
629
587
|
:hover,
|
|
630
588
|
:focus {
|
|
631
589
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
@@ -635,7 +593,7 @@ const ContextMenuTrigger = styled__default.default(v2.Menu.Trigger)`
|
|
|
635
593
|
font-size: 0;
|
|
636
594
|
}
|
|
637
595
|
`;
|
|
638
|
-
const DragIconButton =
|
|
596
|
+
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
|
639
597
|
align-items: center;
|
|
640
598
|
border-radius: ${({ theme }) => theme.borderRadius};
|
|
641
599
|
display: flex;
|
|
@@ -676,54 +634,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
|
|
|
676
634
|
color: hex
|
|
677
635
|
}));
|
|
678
636
|
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,
|
|
637
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required, children: [
|
|
638
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: label }),
|
|
639
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
640
|
+
designSystem.SingleSelect,
|
|
641
|
+
{
|
|
642
|
+
disabled,
|
|
643
|
+
onChange: (v) => {
|
|
644
|
+
onChange(name, v.toString());
|
|
645
|
+
},
|
|
646
|
+
value: value?.toUpperCase(),
|
|
647
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
648
|
+
designSystem.Flex,
|
|
706
649
|
{
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
650
|
+
tag: "span",
|
|
651
|
+
height: 2,
|
|
652
|
+
background: value,
|
|
653
|
+
borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
|
|
654
|
+
hasRadius: true,
|
|
655
|
+
shrink: 0,
|
|
656
|
+
width: 2
|
|
657
|
+
}
|
|
658
|
+
),
|
|
659
|
+
children: colorOptions.map(({ value: value2, label: label2, color }) => {
|
|
660
|
+
const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
|
|
661
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
662
|
+
designSystem.SingleSelectOption,
|
|
663
|
+
{
|
|
664
|
+
value: value2,
|
|
665
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
666
|
+
designSystem.Flex,
|
|
667
|
+
{
|
|
668
|
+
tag: "span",
|
|
669
|
+
height: 2,
|
|
670
|
+
background: color,
|
|
671
|
+
borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
|
|
672
|
+
hasRadius: true,
|
|
673
|
+
shrink: 0,
|
|
674
|
+
width: 2
|
|
675
|
+
}
|
|
676
|
+
),
|
|
677
|
+
children: label2
|
|
678
|
+
},
|
|
679
|
+
value2
|
|
680
|
+
);
|
|
681
|
+
})
|
|
682
|
+
}
|
|
683
|
+
),
|
|
684
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
685
|
+
] });
|
|
727
686
|
};
|
|
728
687
|
const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
729
688
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -747,68 +706,76 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
747
706
|
}
|
|
748
707
|
}, [formatMessage, isLoading, roles, toggleNotification]);
|
|
749
708
|
if (!isLoading && filteredRoles.length === 0) {
|
|
750
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
751
|
-
designSystem.
|
|
709
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
710
|
+
designSystem.Field.Root,
|
|
752
711
|
{
|
|
753
|
-
disabled: true,
|
|
754
712
|
name,
|
|
755
713
|
hint: formatMessage({
|
|
756
714
|
id: "Settings.review-workflows.stage.permissions.noPermissions.description",
|
|
757
715
|
defaultMessage: "You don’t have the permission to see roles"
|
|
758
716
|
}),
|
|
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
717
|
required,
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
value: ""
|
|
771
|
-
}
|
|
772
|
-
);
|
|
773
|
-
}
|
|
774
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
775
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
|
|
776
|
-
/* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
777
|
-
designSystem.MultiSelect,
|
|
778
|
-
{
|
|
779
|
-
disabled,
|
|
780
|
-
error,
|
|
781
|
-
id: name,
|
|
782
|
-
label: formatMessage({
|
|
718
|
+
children: [
|
|
719
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
783
720
|
id: "Settings.review-workflows.stage.permissions.label",
|
|
784
721
|
defaultMessage: "Roles that can change this stage"
|
|
785
|
-
}),
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
role: parseInt(value2, 10),
|
|
789
|
-
action: "admin::review-workflows.stage.transition"
|
|
790
|
-
}));
|
|
791
|
-
onChange(name, permissions);
|
|
792
|
-
},
|
|
793
|
-
placeholder,
|
|
794
|
-
required: true,
|
|
795
|
-
value: value.map((permission) => `${permission.role}`),
|
|
796
|
-
withTags: true,
|
|
797
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
798
|
-
designSystem.MultiSelectGroup,
|
|
722
|
+
}) }),
|
|
723
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
724
|
+
designSystem.TextInput,
|
|
799
725
|
{
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
726
|
+
disabled: true,
|
|
727
|
+
placeholder: formatMessage({
|
|
728
|
+
id: "components.NotAllowedInput.text",
|
|
729
|
+
defaultMessage: "No permissions to see this field"
|
|
803
730
|
}),
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
})
|
|
731
|
+
startAction: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, {}),
|
|
732
|
+
type: "text",
|
|
733
|
+
value: ""
|
|
808
734
|
}
|
|
809
|
-
)
|
|
810
|
-
|
|
811
|
-
|
|
735
|
+
),
|
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
|
737
|
+
]
|
|
738
|
+
}
|
|
739
|
+
);
|
|
740
|
+
}
|
|
741
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
742
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
|
|
743
|
+
/* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required: true, children: [
|
|
744
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
745
|
+
id: "Settings.review-workflows.stage.permissions.label",
|
|
746
|
+
defaultMessage: "Roles that can change this stage"
|
|
747
|
+
}) }),
|
|
748
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
749
|
+
designSystem.MultiSelect,
|
|
750
|
+
{
|
|
751
|
+
disabled,
|
|
752
|
+
onChange: (values) => {
|
|
753
|
+
const permissions = values.map((value2) => ({
|
|
754
|
+
role: parseInt(value2, 10),
|
|
755
|
+
action: "admin::review-workflows.stage.transition"
|
|
756
|
+
}));
|
|
757
|
+
onChange(name, permissions);
|
|
758
|
+
},
|
|
759
|
+
placeholder,
|
|
760
|
+
value: value.map((permission) => `${permission.role}`),
|
|
761
|
+
withTags: true,
|
|
762
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
763
|
+
designSystem.MultiSelectGroup,
|
|
764
|
+
{
|
|
765
|
+
label: formatMessage({
|
|
766
|
+
id: "Settings.review-workflows.stage.permissions.allRoles.label",
|
|
767
|
+
defaultMessage: "All roles"
|
|
768
|
+
}),
|
|
769
|
+
values: filteredRoles.map((r) => `${r.id}`),
|
|
770
|
+
children: filteredRoles.map((role) => {
|
|
771
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NestedOption$1, { value: `${role.id}`, children: role.name }, role.id);
|
|
772
|
+
})
|
|
773
|
+
}
|
|
774
|
+
)
|
|
775
|
+
}
|
|
776
|
+
),
|
|
777
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
778
|
+
] }) }),
|
|
812
779
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
813
780
|
designSystem.IconButton,
|
|
814
781
|
{
|
|
@@ -855,15 +822,15 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
855
822
|
)
|
|
856
823
|
] });
|
|
857
824
|
};
|
|
858
|
-
const StyledIcon =
|
|
825
|
+
const StyledIcon = styledComponents.styled(icons.EyeStriked)`
|
|
859
826
|
& > path {
|
|
860
827
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
861
828
|
}
|
|
862
829
|
`;
|
|
863
|
-
const NestedOption$1 =
|
|
830
|
+
const NestedOption$1 = styledComponents.styled(designSystem.MultiSelectOption)`
|
|
864
831
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
865
832
|
`;
|
|
866
|
-
const PermissionWrapper =
|
|
833
|
+
const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
|
|
867
834
|
> * {
|
|
868
835
|
flex-grow: 1;
|
|
869
836
|
}
|
|
@@ -905,86 +872,87 @@ const ContentTypesSelector = ({ disabled }) => {
|
|
|
905
872
|
label: contentType.info.displayName,
|
|
906
873
|
value: contentType.uid
|
|
907
874
|
}));
|
|
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,
|
|
875
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name: "contentTypes", children: [
|
|
876
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
877
|
+
id: "Settings.review-workflows.workflow.contentTypes.label",
|
|
878
|
+
defaultMessage: "Associated to"
|
|
879
|
+
}) }),
|
|
880
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
881
|
+
designSystem.MultiSelect,
|
|
882
|
+
{
|
|
883
|
+
customizeContent: (value2) => formatMessage(
|
|
954
884
|
{
|
|
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
|
-
})
|
|
885
|
+
id: "Settings.review-workflows.workflow.contentTypes.displayValue",
|
|
886
|
+
defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
|
|
977
887
|
},
|
|
978
|
-
|
|
979
|
-
)
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
888
|
+
{ count: value2?.length }
|
|
889
|
+
),
|
|
890
|
+
disabled: isDisabled,
|
|
891
|
+
onChange: (values) => {
|
|
892
|
+
onChange("contentTypes", values);
|
|
893
|
+
},
|
|
894
|
+
value,
|
|
895
|
+
placeholder: formatMessage({
|
|
896
|
+
id: "Settings.review-workflows.workflow.contentTypes.placeholder",
|
|
897
|
+
defaultMessage: "Select"
|
|
898
|
+
}),
|
|
899
|
+
children: [
|
|
900
|
+
...collectionTypes.length > 0 ? [
|
|
901
|
+
{
|
|
902
|
+
label: formatMessage({
|
|
903
|
+
id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
|
|
904
|
+
defaultMessage: "Collection Types"
|
|
905
|
+
}),
|
|
906
|
+
children: collectionTypes
|
|
907
|
+
}
|
|
908
|
+
] : [],
|
|
909
|
+
...singleTypes.length > 0 ? [
|
|
910
|
+
{
|
|
911
|
+
label: formatMessage({
|
|
912
|
+
id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
|
|
913
|
+
defaultMessage: "Single Types"
|
|
914
|
+
}),
|
|
915
|
+
children: singleTypes
|
|
916
|
+
}
|
|
917
|
+
] : []
|
|
918
|
+
].map((opt) => {
|
|
919
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
920
|
+
designSystem.MultiSelectGroup,
|
|
921
|
+
{
|
|
922
|
+
label: opt.label,
|
|
923
|
+
values: opt.children.map((child) => child.value.toString()),
|
|
924
|
+
children: opt.children.map((child) => {
|
|
925
|
+
const { name: assignedWorkflowName } = workflows?.find(
|
|
926
|
+
(workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
|
|
927
|
+
) ?? {};
|
|
928
|
+
return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
|
929
|
+
// @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
|
|
930
|
+
children: formatMessage(
|
|
931
|
+
{
|
|
932
|
+
id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
|
|
933
|
+
defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
label: child.label,
|
|
937
|
+
name: assignedWorkflowName,
|
|
938
|
+
em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "em", fontWeight: "bold", children }),
|
|
939
|
+
i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
|
|
940
|
+
}
|
|
941
|
+
)
|
|
942
|
+
}) }, child.value);
|
|
943
|
+
})
|
|
944
|
+
},
|
|
945
|
+
opt.label
|
|
946
|
+
);
|
|
947
|
+
})
|
|
948
|
+
}
|
|
949
|
+
)
|
|
950
|
+
] });
|
|
983
951
|
};
|
|
984
|
-
const NestedOption =
|
|
952
|
+
const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
|
|
985
953
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
986
954
|
`;
|
|
987
|
-
const ContentTypeTakeNotice =
|
|
955
|
+
const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
|
|
988
956
|
font-style: italic;
|
|
989
957
|
`;
|
|
990
958
|
const WORKFLOW_SCHEMA = yup__namespace.object({
|
|
@@ -1330,4 +1298,4 @@ const ProtectedEditPage = () => {
|
|
|
1330
1298
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
|
|
1331
1299
|
};
|
|
1332
1300
|
exports.ProtectedEditPage = ProtectedEditPage;
|
|
1333
|
-
//# sourceMappingURL=_id-
|
|
1301
|
+
//# sourceMappingURL=_id-BO7wNLt1.js.map
|