@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
|
@@ -2,23 +2,22 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import { useTracking, useForm, useField, InputRenderer as InputRenderer$1, useNotification, ConfirmDialog, Page, useAPIErrorHandler, useRBAC, Form, BackButton } from "@strapi/admin/strapi-admin";
|
|
4
4
|
import { useLicenseLimits } from "@strapi/admin/strapi-admin/ee";
|
|
5
|
-
import { Box, Typography, Flex,
|
|
6
|
-
import { PlusCircle,
|
|
5
|
+
import { Box, Typography, Flex, Accordion, MenuItem, Menu, MultiSelectOption, useComposedRefs, VisuallyHidden, IconButton, Grid, Field, SingleSelect, SingleSelectOption, TextInput, MultiSelect, MultiSelectGroup, Dialog, useCollator, Button } from "@strapi/design-system";
|
|
6
|
+
import { PlusCircle, More, Drag, EyeStriked, Duplicate, Check } from "@strapi/icons";
|
|
7
7
|
import { generateNKeysBetween } from "fractional-indexing";
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
9
9
|
import { useDispatch } from "react-redux";
|
|
10
10
|
import { useParams, useNavigate } from "react-router-dom";
|
|
11
11
|
import * as yup from "yup";
|
|
12
|
-
import { r as reviewWorkflowsApi, A as AVAILABLE_COLORS, g as getStageColorByHex, u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, b as CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal, i as isBaseQueryError } from "./index-
|
|
13
|
-
import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-
|
|
14
|
-
import { MenuItem, Menu } from "@strapi/design-system/v2";
|
|
12
|
+
import { r as reviewWorkflowsApi, A as AVAILABLE_COLORS, g as getStageColorByHex, u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, b as CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal, i as isBaseQueryError } from "./index-Bx0Y1GZR.mjs";
|
|
13
|
+
import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-BDKzgDbH.mjs";
|
|
15
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
|
16
|
-
import styled from "styled-components";
|
|
15
|
+
import { styled } from "styled-components";
|
|
17
16
|
import { useDrop, useDrag } from "react-dnd";
|
|
18
17
|
const adminApi = reviewWorkflowsApi.injectEndpoints({
|
|
19
18
|
endpoints(builder) {
|
|
20
19
|
return {
|
|
21
|
-
|
|
20
|
+
getAdminRoles: builder.query({
|
|
22
21
|
query: () => ({
|
|
23
22
|
url: `/admin/roles`,
|
|
24
23
|
method: "GET"
|
|
@@ -30,7 +29,7 @@ const adminApi = reviewWorkflowsApi.injectEndpoints({
|
|
|
30
29
|
};
|
|
31
30
|
}
|
|
32
31
|
});
|
|
33
|
-
const {
|
|
32
|
+
const { useGetAdminRolesQuery } = adminApi;
|
|
34
33
|
const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem }) => {
|
|
35
34
|
const [isSelected, setIsSelected] = React.useState(false);
|
|
36
35
|
const handleMove = (movement) => {
|
|
@@ -249,74 +248,35 @@ const AddStage = ({ children, ...props }) => {
|
|
|
249
248
|
return /* @__PURE__ */ jsx(
|
|
250
249
|
StyledButton,
|
|
251
250
|
{
|
|
252
|
-
|
|
251
|
+
tag: "button",
|
|
253
252
|
background: "neutral0",
|
|
254
|
-
|
|
253
|
+
borderColor: "neutral150",
|
|
255
254
|
paddingBottom: 3,
|
|
256
255
|
paddingLeft: 4,
|
|
257
256
|
paddingRight: 4,
|
|
258
257
|
paddingTop: 3,
|
|
259
258
|
shadow: "filterShadow",
|
|
260
259
|
...props,
|
|
261
|
-
children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
262
|
-
/* @__PURE__ */ jsx(
|
|
263
|
-
|
|
264
|
-
] })
|
|
260
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
|
|
261
|
+
/* @__PURE__ */ jsx(PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
|
|
262
|
+
children
|
|
263
|
+
] }) })
|
|
265
264
|
}
|
|
266
265
|
);
|
|
267
266
|
};
|
|
268
|
-
const StyledAddIcon = styled(PlusCircle)`
|
|
269
|
-
> circle {
|
|
270
|
-
fill: ${({ theme }) => theme.colors.neutral150};
|
|
271
|
-
}
|
|
272
|
-
> path {
|
|
273
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
274
|
-
}
|
|
275
|
-
`;
|
|
276
267
|
const StyledButton = styled(Box)`
|
|
277
268
|
border-radius: 26px;
|
|
278
|
-
|
|
279
|
-
svg {
|
|
280
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
281
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
282
|
-
|
|
283
|
-
> path {
|
|
284
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
285
|
-
}
|
|
286
|
-
}
|
|
269
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
287
270
|
|
|
288
271
|
&:hover {
|
|
289
|
-
color: ${({ theme }) => theme.colors.primary600}
|
|
290
|
-
${Typography} {
|
|
291
|
-
color: ${({ theme }) => theme.colors.primary600} !important;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
${StyledAddIcon} {
|
|
295
|
-
> circle {
|
|
296
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
297
|
-
}
|
|
298
|
-
> path {
|
|
299
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
300
|
-
}
|
|
301
|
-
}
|
|
272
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
302
273
|
}
|
|
303
274
|
|
|
304
275
|
&:active {
|
|
305
|
-
${
|
|
306
|
-
color: ${({ theme }) => theme.colors.primary600};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
${StyledAddIcon} {
|
|
310
|
-
> circle {
|
|
311
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
312
|
-
}
|
|
313
|
-
> path {
|
|
314
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
315
|
-
}
|
|
316
|
-
}
|
|
276
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
317
277
|
}
|
|
318
278
|
`;
|
|
319
|
-
const Stages = ({ canDelete = true, canUpdate = true, isCreating
|
|
279
|
+
const Stages = ({ canDelete = true, canUpdate = true, isCreating }) => {
|
|
320
280
|
const { formatMessage } = useIntl();
|
|
321
281
|
const { trackUsage } = useTracking();
|
|
322
282
|
const addFieldRow = useForm("Stages", (state) => state.addFieldRow);
|
|
@@ -343,9 +303,9 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
|
343
303
|
gap: 6,
|
|
344
304
|
zIndex: 2,
|
|
345
305
|
position: "relative",
|
|
346
|
-
|
|
306
|
+
tag: "ol",
|
|
347
307
|
children: stages.map((stage, index) => {
|
|
348
|
-
return /* @__PURE__ */ jsx(Box, {
|
|
308
|
+
return /* @__PURE__ */ jsx(Box, { tag: "li", children: /* @__PURE__ */ jsx(
|
|
349
309
|
Stage,
|
|
350
310
|
{
|
|
351
311
|
index,
|
|
@@ -353,7 +313,7 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
|
353
313
|
canReorder: stages.length > 1,
|
|
354
314
|
canUpdate,
|
|
355
315
|
stagesCount: stages.length,
|
|
356
|
-
|
|
316
|
+
defaultOpen: isCreating,
|
|
357
317
|
...stage
|
|
358
318
|
}
|
|
359
319
|
) }, stage.__temp_key__);
|
|
@@ -385,16 +345,15 @@ const Stage = ({
|
|
|
385
345
|
canDelete = false,
|
|
386
346
|
canReorder = false,
|
|
387
347
|
canUpdate = false,
|
|
388
|
-
isOpen: isOpenDefault = false,
|
|
389
348
|
stagesCount,
|
|
390
349
|
name,
|
|
391
350
|
permissions,
|
|
392
|
-
color
|
|
351
|
+
color,
|
|
352
|
+
defaultOpen
|
|
393
353
|
}) => {
|
|
394
354
|
const [liveText, setLiveText] = React.useState();
|
|
395
355
|
const { formatMessage } = useIntl();
|
|
396
356
|
const { trackUsage } = useTracking();
|
|
397
|
-
const [isOpen, setIsOpen] = React.useState(isOpenDefault);
|
|
398
357
|
const stageErrors = useForm("Stages", (state) => state.errors.stages);
|
|
399
358
|
const error = stageErrors?.[index];
|
|
400
359
|
const addFieldRow = useForm("Stage", (state) => state.addFieldRow);
|
|
@@ -476,7 +435,8 @@ const Stage = ({
|
|
|
476
435
|
const handleCloneClick = () => {
|
|
477
436
|
addFieldRow("stages", { name, color, permissions });
|
|
478
437
|
};
|
|
479
|
-
|
|
438
|
+
const id = React.useId();
|
|
439
|
+
return /* @__PURE__ */ jsxs(Box, { ref: composedRef, children: [
|
|
480
440
|
liveText && /* @__PURE__ */ jsx(VisuallyHidden, { "aria-live": "assertive", children: liveText }),
|
|
481
441
|
isDragging ? /* @__PURE__ */ jsx(
|
|
482
442
|
Box,
|
|
@@ -487,74 +447,61 @@ const Stage = ({
|
|
|
487
447
|
borderWidth: "1px",
|
|
488
448
|
display: "block",
|
|
489
449
|
hasRadius: true,
|
|
490
|
-
padding: 6
|
|
491
|
-
shadow: "tableShadow"
|
|
450
|
+
padding: 6
|
|
492
451
|
}
|
|
493
|
-
) : /* @__PURE__ */
|
|
494
|
-
|
|
452
|
+
) : /* @__PURE__ */ jsx(
|
|
453
|
+
AccordionRoot,
|
|
495
454
|
{
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
onToggle: () => {
|
|
499
|
-
setIsOpen(!isOpen);
|
|
500
|
-
if (!isOpen) {
|
|
455
|
+
onValueChange: (value) => {
|
|
456
|
+
if (value) {
|
|
501
457
|
trackUsage("willEditStage");
|
|
502
458
|
}
|
|
503
459
|
},
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
/* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
|
|
518
|
-
/* @__PURE__ */ jsx(VisuallyHidden, { as: "span", children: formatMessage({
|
|
519
|
-
id: "[tbdb].components.DynamicZone.more-actions",
|
|
520
|
-
defaultMessage: "More actions"
|
|
521
|
-
}) })
|
|
522
|
-
] }),
|
|
523
|
-
/* @__PURE__ */ jsx(Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxs(Menu.SubRoot, { children: [
|
|
524
|
-
canUpdate && /* @__PURE__ */ jsx(MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
525
|
-
id: "Settings.review-workflows.stage.delete",
|
|
526
|
-
defaultMessage: "Duplicate stage"
|
|
527
|
-
}) }),
|
|
528
|
-
canDelete && /* @__PURE__ */ jsx(DeleteMenuItem, { onClick: () => removeFieldRow("stages", index), children: formatMessage({
|
|
529
|
-
id: "Settings.review-workflows.stage.delete",
|
|
530
|
-
defaultMessage: "Delete"
|
|
531
|
-
}) })
|
|
532
|
-
] }) })
|
|
460
|
+
defaultValue: defaultOpen ? id : void 0,
|
|
461
|
+
$error: Object.values(error ?? {}).length > 0,
|
|
462
|
+
children: /* @__PURE__ */ jsxs(Accordion.Item, { value: id, children: [
|
|
463
|
+
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
|
464
|
+
/* @__PURE__ */ jsx(Accordion.Trigger, { children: name }),
|
|
465
|
+
/* @__PURE__ */ jsx(Accordion.Actions, { children: canDelete || canUpdate ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
466
|
+
/* @__PURE__ */ jsxs(Menu.Root, { children: [
|
|
467
|
+
/* @__PURE__ */ jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
|
|
468
|
+
/* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
|
|
469
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { tag: "span", children: formatMessage({
|
|
470
|
+
id: "[tbdb].components.DynamicZone.more-actions",
|
|
471
|
+
defaultMessage: "More actions"
|
|
472
|
+
}) })
|
|
533
473
|
] }),
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
474
|
+
/* @__PURE__ */ jsx(Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxs(Menu.SubRoot, { children: [
|
|
475
|
+
canUpdate && /* @__PURE__ */ jsx(MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
476
|
+
id: "Settings.review-workflows.stage.delete",
|
|
477
|
+
defaultMessage: "Duplicate stage"
|
|
478
|
+
}) }),
|
|
479
|
+
canDelete && /* @__PURE__ */ jsx(DeleteMenuItem, { onClick: () => removeFieldRow("stages", index), children: formatMessage({
|
|
480
|
+
id: "Settings.review-workflows.stage.delete",
|
|
481
|
+
defaultMessage: "Delete"
|
|
482
|
+
}) })
|
|
483
|
+
] }) })
|
|
484
|
+
] }),
|
|
485
|
+
canUpdate && /* @__PURE__ */ jsx(
|
|
486
|
+
IconButton,
|
|
487
|
+
{
|
|
488
|
+
background: "transparent",
|
|
489
|
+
hasRadius: true,
|
|
490
|
+
borderWidth: 0,
|
|
491
|
+
"data-handler-id": handlerId,
|
|
492
|
+
ref: dragRef,
|
|
493
|
+
label: formatMessage({
|
|
494
|
+
id: "Settings.review-workflows.stage.drag",
|
|
495
|
+
defaultMessage: "Drag"
|
|
496
|
+
}),
|
|
497
|
+
onClick: (e) => e.stopPropagation(),
|
|
498
|
+
onKeyDown: handleKeyDown,
|
|
499
|
+
children: /* @__PURE__ */ jsx(Drag, {})
|
|
500
|
+
}
|
|
501
|
+
)
|
|
502
|
+
] }) : null })
|
|
503
|
+
] }),
|
|
504
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Grid.Root, { gap: 4, padding: 6, children: [
|
|
558
505
|
{
|
|
559
506
|
disabled: !canUpdate,
|
|
560
507
|
label: formatMessage({
|
|
@@ -592,12 +539,16 @@ const Stage = ({
|
|
|
592
539
|
size: 6,
|
|
593
540
|
type: "permissions"
|
|
594
541
|
}
|
|
595
|
-
].map(({ size, ...field }) => /* @__PURE__ */ jsx(
|
|
596
|
-
]
|
|
542
|
+
].map(({ size, ...field }) => /* @__PURE__ */ jsx(Grid.Item, { col: size, children: /* @__PURE__ */ jsx(InputRenderer, { ...field }) }, field.name)) }) })
|
|
543
|
+
] })
|
|
597
544
|
}
|
|
598
545
|
)
|
|
599
546
|
] });
|
|
600
547
|
};
|
|
548
|
+
const AccordionRoot = styled(Accordion.Root)`
|
|
549
|
+
border: 1px solid
|
|
550
|
+
${({ theme, $error }) => $error ? theme.colors.danger600 : theme.colors.neutral200};
|
|
551
|
+
`;
|
|
601
552
|
const DeleteMenuItem = styled(MenuItem)`
|
|
602
553
|
color: ${({ theme }) => theme.colors.danger600};
|
|
603
554
|
`;
|
|
@@ -611,22 +562,6 @@ const ContextMenuTrigger = styled(Menu.Trigger)`
|
|
|
611
562
|
font-size: 0;
|
|
612
563
|
}
|
|
613
564
|
`;
|
|
614
|
-
const DragIconButton = styled(IconButton)`
|
|
615
|
-
align-items: center;
|
|
616
|
-
border-radius: ${({ theme }) => theme.borderRadius};
|
|
617
|
-
display: flex;
|
|
618
|
-
justify-content: center;
|
|
619
|
-
|
|
620
|
-
&:hover,
|
|
621
|
-
&:focus {
|
|
622
|
-
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
svg {
|
|
626
|
-
height: auto;
|
|
627
|
-
width: ${({ theme }) => theme.spaces[3]};
|
|
628
|
-
}
|
|
629
|
-
`;
|
|
630
565
|
const InputRenderer = (props) => {
|
|
631
566
|
switch (props.type) {
|
|
632
567
|
case "color":
|
|
@@ -652,54 +587,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
|
|
|
652
587
|
color: hex
|
|
653
588
|
}));
|
|
654
589
|
const { themeColorName } = getStageColorByHex(value) ?? {};
|
|
655
|
-
return /* @__PURE__ */
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
Flex,
|
|
668
|
-
{
|
|
669
|
-
as: "span",
|
|
670
|
-
height: 2,
|
|
671
|
-
background: value,
|
|
672
|
-
borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
|
|
673
|
-
hasRadius: true,
|
|
674
|
-
shrink: 0,
|
|
675
|
-
width: 2
|
|
676
|
-
}
|
|
677
|
-
),
|
|
678
|
-
children: colorOptions.map(({ value: value2, label: label2, color }) => {
|
|
679
|
-
const { themeColorName: themeColorName2 } = getStageColorByHex(color) || {};
|
|
680
|
-
return /* @__PURE__ */ jsx(
|
|
681
|
-
SingleSelectOption,
|
|
590
|
+
return /* @__PURE__ */ jsxs(Field.Root, { error, name, required, children: [
|
|
591
|
+
/* @__PURE__ */ jsx(Field.Label, { children: label }),
|
|
592
|
+
/* @__PURE__ */ jsx(
|
|
593
|
+
SingleSelect,
|
|
594
|
+
{
|
|
595
|
+
disabled,
|
|
596
|
+
onChange: (v) => {
|
|
597
|
+
onChange(name, v.toString());
|
|
598
|
+
},
|
|
599
|
+
value: value?.toUpperCase(),
|
|
600
|
+
startIcon: /* @__PURE__ */ jsx(
|
|
601
|
+
Flex,
|
|
682
602
|
{
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
603
|
+
tag: "span",
|
|
604
|
+
height: 2,
|
|
605
|
+
background: value,
|
|
606
|
+
borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
|
|
607
|
+
hasRadius: true,
|
|
608
|
+
shrink: 0,
|
|
609
|
+
width: 2
|
|
610
|
+
}
|
|
611
|
+
),
|
|
612
|
+
children: colorOptions.map(({ value: value2, label: label2, color }) => {
|
|
613
|
+
const { themeColorName: themeColorName2 } = getStageColorByHex(color) || {};
|
|
614
|
+
return /* @__PURE__ */ jsx(
|
|
615
|
+
SingleSelectOption,
|
|
616
|
+
{
|
|
617
|
+
value: value2,
|
|
618
|
+
startIcon: /* @__PURE__ */ jsx(
|
|
619
|
+
Flex,
|
|
620
|
+
{
|
|
621
|
+
tag: "span",
|
|
622
|
+
height: 2,
|
|
623
|
+
background: color,
|
|
624
|
+
borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
|
|
625
|
+
hasRadius: true,
|
|
626
|
+
shrink: 0,
|
|
627
|
+
width: 2
|
|
628
|
+
}
|
|
629
|
+
),
|
|
630
|
+
children: label2
|
|
631
|
+
},
|
|
632
|
+
value2
|
|
633
|
+
);
|
|
634
|
+
})
|
|
635
|
+
}
|
|
636
|
+
),
|
|
637
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
638
|
+
] });
|
|
703
639
|
};
|
|
704
640
|
const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
705
641
|
const { formatMessage } = useIntl();
|
|
@@ -708,7 +644,7 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
708
644
|
const { value = [], error, onChange } = useField(name);
|
|
709
645
|
const allStages = useForm("PermissionsField", (state) => state.values.stages);
|
|
710
646
|
const onFormValueChange = useForm("PermissionsField", (state) => state.onChange);
|
|
711
|
-
const { data: roles = [], isLoading } =
|
|
647
|
+
const { data: roles = [], isLoading } = useGetAdminRolesQuery();
|
|
712
648
|
const filteredRoles = roles?.filter((role) => role.code !== "strapi-super-admin") ?? [];
|
|
713
649
|
React.useEffect(() => {
|
|
714
650
|
if (!isLoading && roles.length === 0) {
|
|
@@ -723,42 +659,48 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
723
659
|
}
|
|
724
660
|
}, [formatMessage, isLoading, roles, toggleNotification]);
|
|
725
661
|
if (!isLoading && filteredRoles.length === 0) {
|
|
726
|
-
return /* @__PURE__ */
|
|
727
|
-
|
|
662
|
+
return /* @__PURE__ */ jsxs(
|
|
663
|
+
Field.Root,
|
|
728
664
|
{
|
|
729
|
-
disabled: true,
|
|
730
665
|
name,
|
|
731
666
|
hint: formatMessage({
|
|
732
667
|
id: "Settings.review-workflows.stage.permissions.noPermissions.description",
|
|
733
668
|
defaultMessage: "You don’t have the permission to see roles"
|
|
734
669
|
}),
|
|
735
|
-
label: formatMessage({
|
|
736
|
-
id: "Settings.review-workflows.stage.permissions.label",
|
|
737
|
-
defaultMessage: "Roles that can change this stage"
|
|
738
|
-
}),
|
|
739
|
-
placeholder: formatMessage({
|
|
740
|
-
id: "components.NotAllowedInput.text",
|
|
741
|
-
defaultMessage: "No permissions to see this field"
|
|
742
|
-
}),
|
|
743
670
|
required,
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
671
|
+
children: [
|
|
672
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
673
|
+
id: "Settings.review-workflows.stage.permissions.label",
|
|
674
|
+
defaultMessage: "Roles that can change this stage"
|
|
675
|
+
}) }),
|
|
676
|
+
/* @__PURE__ */ jsx(
|
|
677
|
+
TextInput,
|
|
678
|
+
{
|
|
679
|
+
disabled: true,
|
|
680
|
+
placeholder: formatMessage({
|
|
681
|
+
id: "components.NotAllowedInput.text",
|
|
682
|
+
defaultMessage: "No permissions to see this field"
|
|
683
|
+
}),
|
|
684
|
+
startAction: /* @__PURE__ */ jsx(EyeStriked, { fill: "neutral600" }),
|
|
685
|
+
type: "text",
|
|
686
|
+
value: ""
|
|
687
|
+
}
|
|
688
|
+
),
|
|
689
|
+
/* @__PURE__ */ jsx(Field.Hint, {})
|
|
690
|
+
]
|
|
747
691
|
}
|
|
748
692
|
);
|
|
749
693
|
}
|
|
750
|
-
return /* @__PURE__ */
|
|
751
|
-
/* @__PURE__ */
|
|
752
|
-
/* @__PURE__ */ jsx(
|
|
694
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "flex-end", gap: 3, children: [
|
|
695
|
+
/* @__PURE__ */ jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxs(Field.Root, { error, name, required: true, children: [
|
|
696
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
697
|
+
id: "Settings.review-workflows.stage.permissions.label",
|
|
698
|
+
defaultMessage: "Roles that can change this stage"
|
|
699
|
+
}) }),
|
|
700
|
+
/* @__PURE__ */ jsx(
|
|
753
701
|
MultiSelect,
|
|
754
702
|
{
|
|
755
703
|
disabled,
|
|
756
|
-
error,
|
|
757
|
-
id: name,
|
|
758
|
-
label: formatMessage({
|
|
759
|
-
id: "Settings.review-workflows.stage.permissions.label",
|
|
760
|
-
defaultMessage: "Roles that can change this stage"
|
|
761
|
-
}),
|
|
762
704
|
onChange: (values) => {
|
|
763
705
|
const permissions = values.map((value2) => ({
|
|
764
706
|
role: parseInt(value2, 10),
|
|
@@ -767,7 +709,6 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
767
709
|
onChange(name, permissions);
|
|
768
710
|
},
|
|
769
711
|
placeholder,
|
|
770
|
-
required: true,
|
|
771
712
|
value: value.map((permission) => `${permission.role}`),
|
|
772
713
|
withTags: true,
|
|
773
714
|
children: /* @__PURE__ */ jsx(
|
|
@@ -784,58 +725,53 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
|
|
|
784
725
|
}
|
|
785
726
|
)
|
|
786
727
|
}
|
|
787
|
-
)
|
|
788
|
-
/* @__PURE__ */ jsx(
|
|
728
|
+
),
|
|
729
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
730
|
+
] }) }),
|
|
731
|
+
/* @__PURE__ */ jsxs(Dialog.Root, { open: isApplyAllConfirmationOpen, onOpenChange: setIsApplyAllConfirmationOpen, children: [
|
|
732
|
+
/* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
|
789
733
|
IconButton,
|
|
790
734
|
{
|
|
791
735
|
disabled,
|
|
792
|
-
icon: /* @__PURE__ */ jsx(Duplicate, {}),
|
|
793
736
|
label: formatMessage({
|
|
794
737
|
id: "Settings.review-workflows.stage.permissions.apply.label",
|
|
795
738
|
defaultMessage: "Apply to all stages"
|
|
796
739
|
}),
|
|
797
740
|
size: "L",
|
|
798
741
|
variant: "secondary",
|
|
799
|
-
|
|
742
|
+
children: /* @__PURE__ */ jsx(Duplicate, {})
|
|
743
|
+
}
|
|
744
|
+
) }),
|
|
745
|
+
/* @__PURE__ */ jsx(
|
|
746
|
+
ConfirmDialog,
|
|
747
|
+
{
|
|
748
|
+
onConfirm: () => {
|
|
749
|
+
onFormValueChange(
|
|
750
|
+
"stages",
|
|
751
|
+
allStages.map((stage) => ({
|
|
752
|
+
...stage,
|
|
753
|
+
permissions: value
|
|
754
|
+
}))
|
|
755
|
+
);
|
|
756
|
+
setIsApplyAllConfirmationOpen(false);
|
|
757
|
+
toggleNotification({
|
|
758
|
+
type: "success",
|
|
759
|
+
message: formatMessage({
|
|
760
|
+
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success",
|
|
761
|
+
defaultMessage: "Applied roles to all other stages of the workflow"
|
|
762
|
+
})
|
|
763
|
+
});
|
|
764
|
+
},
|
|
765
|
+
variant: "default",
|
|
766
|
+
children: formatMessage({
|
|
767
|
+
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy",
|
|
768
|
+
defaultMessage: "Roles that can change that stage will be applied to all the other stages."
|
|
769
|
+
})
|
|
800
770
|
}
|
|
801
771
|
)
|
|
802
|
-
] })
|
|
803
|
-
|
|
804
|
-
ConfirmDialog,
|
|
805
|
-
{
|
|
806
|
-
isOpen: isApplyAllConfirmationOpen,
|
|
807
|
-
onClose: () => setIsApplyAllConfirmationOpen(false),
|
|
808
|
-
onConfirm: () => {
|
|
809
|
-
onFormValueChange(
|
|
810
|
-
"stages",
|
|
811
|
-
allStages.map((stage) => ({
|
|
812
|
-
...stage,
|
|
813
|
-
permissions: value
|
|
814
|
-
}))
|
|
815
|
-
);
|
|
816
|
-
setIsApplyAllConfirmationOpen(false);
|
|
817
|
-
toggleNotification({
|
|
818
|
-
type: "success",
|
|
819
|
-
message: formatMessage({
|
|
820
|
-
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success",
|
|
821
|
-
defaultMessage: "Applied roles to all other stages of the workflow"
|
|
822
|
-
})
|
|
823
|
-
});
|
|
824
|
-
},
|
|
825
|
-
variant: "default",
|
|
826
|
-
children: formatMessage({
|
|
827
|
-
id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy",
|
|
828
|
-
defaultMessage: "Roles that can change that stage will be applied to all the other stages."
|
|
829
|
-
})
|
|
830
|
-
}
|
|
831
|
-
)
|
|
832
|
-
] });
|
|
772
|
+
] })
|
|
773
|
+
] }) });
|
|
833
774
|
};
|
|
834
|
-
const StyledIcon = styled(EyeStriked)`
|
|
835
|
-
& > path {
|
|
836
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
837
|
-
}
|
|
838
|
-
`;
|
|
839
775
|
const NestedOption$1 = styled(MultiSelectOption)`
|
|
840
776
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
841
777
|
`;
|
|
@@ -846,8 +782,8 @@ const PermissionWrapper = styled(Flex)`
|
|
|
846
782
|
`;
|
|
847
783
|
const WorkflowAttributes = ({ canUpdate = true }) => {
|
|
848
784
|
const { formatMessage } = useIntl();
|
|
849
|
-
return /* @__PURE__ */ jsxs(Grid, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
|
|
850
|
-
/* @__PURE__ */ jsx(
|
|
785
|
+
return /* @__PURE__ */ jsxs(Grid.Root, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
|
|
786
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(
|
|
851
787
|
InputRenderer$1,
|
|
852
788
|
{
|
|
853
789
|
disabled: !canUpdate,
|
|
@@ -860,7 +796,7 @@ const WorkflowAttributes = ({ canUpdate = true }) => {
|
|
|
860
796
|
type: "string"
|
|
861
797
|
}
|
|
862
798
|
) }),
|
|
863
|
-
/* @__PURE__ */ jsx(
|
|
799
|
+
/* @__PURE__ */ jsx(Grid.Item, { col: 6, children: /* @__PURE__ */ jsx(ContentTypesSelector, { disabled: !canUpdate }) })
|
|
864
800
|
] });
|
|
865
801
|
};
|
|
866
802
|
const ContentTypesSelector = ({ disabled }) => {
|
|
@@ -881,81 +817,82 @@ const ContentTypesSelector = ({ disabled }) => {
|
|
|
881
817
|
label: contentType.info.displayName,
|
|
882
818
|
value: contentType.uid
|
|
883
819
|
}));
|
|
884
|
-
return /* @__PURE__ */
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
),
|
|
894
|
-
disabled: isDisabled,
|
|
895
|
-
error,
|
|
896
|
-
label: formatMessage({
|
|
897
|
-
id: "Settings.review-workflows.workflow.contentTypes.label",
|
|
898
|
-
defaultMessage: "Associated to"
|
|
899
|
-
}),
|
|
900
|
-
onChange: (values) => {
|
|
901
|
-
onChange("contentTypes", values);
|
|
902
|
-
},
|
|
903
|
-
value,
|
|
904
|
-
placeholder: formatMessage({
|
|
905
|
-
id: "Settings.review-workflows.workflow.contentTypes.placeholder",
|
|
906
|
-
defaultMessage: "Select"
|
|
907
|
-
}),
|
|
908
|
-
children: [
|
|
909
|
-
...collectionTypes.length > 0 ? [
|
|
910
|
-
{
|
|
911
|
-
label: formatMessage({
|
|
912
|
-
id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
|
|
913
|
-
defaultMessage: "Collection Types"
|
|
914
|
-
}),
|
|
915
|
-
children: collectionTypes
|
|
916
|
-
}
|
|
917
|
-
] : [],
|
|
918
|
-
...singleTypes.length > 0 ? [
|
|
919
|
-
{
|
|
920
|
-
label: formatMessage({
|
|
921
|
-
id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
|
|
922
|
-
defaultMessage: "Single Types"
|
|
923
|
-
}),
|
|
924
|
-
children: singleTypes
|
|
925
|
-
}
|
|
926
|
-
] : []
|
|
927
|
-
].map((opt) => {
|
|
928
|
-
return /* @__PURE__ */ jsx(
|
|
929
|
-
MultiSelectGroup,
|
|
820
|
+
return /* @__PURE__ */ jsxs(Field.Root, { error, name: "contentTypes", children: [
|
|
821
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
822
|
+
id: "Settings.review-workflows.workflow.contentTypes.label",
|
|
823
|
+
defaultMessage: "Associated to"
|
|
824
|
+
}) }),
|
|
825
|
+
/* @__PURE__ */ jsx(
|
|
826
|
+
MultiSelect,
|
|
827
|
+
{
|
|
828
|
+
customizeContent: (value2) => formatMessage(
|
|
930
829
|
{
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
children: opt.children.map((child) => {
|
|
934
|
-
const { name: assignedWorkflowName } = workflows?.find(
|
|
935
|
-
(workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
|
|
936
|
-
) ?? {};
|
|
937
|
-
return /* @__PURE__ */ jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsx(Typography, {
|
|
938
|
-
// @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
|
|
939
|
-
children: formatMessage(
|
|
940
|
-
{
|
|
941
|
-
id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
|
|
942
|
-
defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
|
|
943
|
-
},
|
|
944
|
-
{
|
|
945
|
-
label: child.label,
|
|
946
|
-
name: assignedWorkflowName,
|
|
947
|
-
em: (...children) => /* @__PURE__ */ jsx(Typography, { as: "em", fontWeight: "bold", children }),
|
|
948
|
-
i: (...children) => /* @__PURE__ */ jsx(ContentTypeTakeNotice, { children })
|
|
949
|
-
}
|
|
950
|
-
)
|
|
951
|
-
}) }, child.value);
|
|
952
|
-
})
|
|
830
|
+
id: "Settings.review-workflows.workflow.contentTypes.displayValue",
|
|
831
|
+
defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
|
|
953
832
|
},
|
|
954
|
-
|
|
955
|
-
)
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
833
|
+
{ count: value2?.length }
|
|
834
|
+
),
|
|
835
|
+
disabled: isDisabled,
|
|
836
|
+
onChange: (values) => {
|
|
837
|
+
onChange("contentTypes", values);
|
|
838
|
+
},
|
|
839
|
+
value,
|
|
840
|
+
placeholder: formatMessage({
|
|
841
|
+
id: "Settings.review-workflows.workflow.contentTypes.placeholder",
|
|
842
|
+
defaultMessage: "Select"
|
|
843
|
+
}),
|
|
844
|
+
children: [
|
|
845
|
+
...collectionTypes.length > 0 ? [
|
|
846
|
+
{
|
|
847
|
+
label: formatMessage({
|
|
848
|
+
id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
|
|
849
|
+
defaultMessage: "Collection Types"
|
|
850
|
+
}),
|
|
851
|
+
children: collectionTypes
|
|
852
|
+
}
|
|
853
|
+
] : [],
|
|
854
|
+
...singleTypes.length > 0 ? [
|
|
855
|
+
{
|
|
856
|
+
label: formatMessage({
|
|
857
|
+
id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
|
|
858
|
+
defaultMessage: "Single Types"
|
|
859
|
+
}),
|
|
860
|
+
children: singleTypes
|
|
861
|
+
}
|
|
862
|
+
] : []
|
|
863
|
+
].map((opt) => {
|
|
864
|
+
return /* @__PURE__ */ jsx(
|
|
865
|
+
MultiSelectGroup,
|
|
866
|
+
{
|
|
867
|
+
label: opt.label,
|
|
868
|
+
values: opt.children.map((child) => child.value.toString()),
|
|
869
|
+
children: opt.children.map((child) => {
|
|
870
|
+
const { name: assignedWorkflowName } = workflows?.find(
|
|
871
|
+
(workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
|
|
872
|
+
) ?? {};
|
|
873
|
+
return /* @__PURE__ */ jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsx(Typography, {
|
|
874
|
+
// @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
|
|
875
|
+
children: formatMessage(
|
|
876
|
+
{
|
|
877
|
+
id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
|
|
878
|
+
defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
|
|
879
|
+
},
|
|
880
|
+
{
|
|
881
|
+
label: child.label,
|
|
882
|
+
name: assignedWorkflowName,
|
|
883
|
+
em: (...children) => /* @__PURE__ */ jsx(Typography, { tag: "em", fontWeight: "bold", children }),
|
|
884
|
+
i: (...children) => /* @__PURE__ */ jsx(ContentTypeTakeNotice, { children })
|
|
885
|
+
}
|
|
886
|
+
)
|
|
887
|
+
}) }, child.value);
|
|
888
|
+
})
|
|
889
|
+
},
|
|
890
|
+
opt.label
|
|
891
|
+
);
|
|
892
|
+
})
|
|
893
|
+
}
|
|
894
|
+
)
|
|
895
|
+
] });
|
|
959
896
|
};
|
|
960
897
|
const NestedOption = styled(MultiSelectOption)`
|
|
961
898
|
padding-left: ${({ theme }) => theme.spaces[7]};
|
|
@@ -1227,12 +1164,11 @@ const EditPage = () => {
|
|
|
1227
1164
|
)
|
|
1228
1165
|
] }) }),
|
|
1229
1166
|
/* @__PURE__ */ jsx(
|
|
1230
|
-
|
|
1167
|
+
Dialog.Root,
|
|
1231
1168
|
{
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
onConfirm: handleConfirmDeleteDialog(values, { setErrors }),
|
|
1235
|
-
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, children: [
|
|
1169
|
+
open: Object.keys(savePrompts).length > 0,
|
|
1170
|
+
onOpenChange: handleConfirmClose,
|
|
1171
|
+
children: /* @__PURE__ */ jsx(ConfirmDialog, { onConfirm: handleConfirmDeleteDialog(values, { setErrors }), children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, children: [
|
|
1236
1172
|
savePrompts.hasDeletedServerStages && /* @__PURE__ */ jsx(Typography, { textAlign: "center", variant: "omega", children: formatMessage({
|
|
1237
1173
|
id: "review-workflows.page.delete.confirm.stages.body",
|
|
1238
1174
|
defaultMessage: "All entries assigned to deleted stages will be moved to the previous stage."
|
|
@@ -1252,7 +1188,7 @@ const EditPage = () => {
|
|
|
1252
1188
|
id: "review-workflows.page.delete.confirm.confirm",
|
|
1253
1189
|
defaultMessage: "Are you sure you want to save?"
|
|
1254
1190
|
}) })
|
|
1255
|
-
] })
|
|
1191
|
+
] }) })
|
|
1256
1192
|
}
|
|
1257
1193
|
)
|
|
1258
1194
|
] })
|
|
@@ -1261,8 +1197,8 @@ const EditPage = () => {
|
|
|
1261
1197
|
/* @__PURE__ */ jsxs(
|
|
1262
1198
|
LimitsModal.Root,
|
|
1263
1199
|
{
|
|
1264
|
-
|
|
1265
|
-
|
|
1200
|
+
open: showLimitModal === "workflow",
|
|
1201
|
+
onOpenChange: () => setShowLimitModal(null),
|
|
1266
1202
|
children: [
|
|
1267
1203
|
/* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
|
|
1268
1204
|
id: "review-workflows.edit.page.workflows.limit.title",
|
|
@@ -1275,16 +1211,23 @@ const EditPage = () => {
|
|
|
1275
1211
|
]
|
|
1276
1212
|
}
|
|
1277
1213
|
),
|
|
1278
|
-
/* @__PURE__ */ jsxs(
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1214
|
+
/* @__PURE__ */ jsxs(
|
|
1215
|
+
LimitsModal.Root,
|
|
1216
|
+
{
|
|
1217
|
+
open: showLimitModal === "stage",
|
|
1218
|
+
onOpenChange: () => setShowLimitModal(null),
|
|
1219
|
+
children: [
|
|
1220
|
+
/* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
|
|
1221
|
+
id: "review-workflows.edit.page.stages.limit.title",
|
|
1222
|
+
defaultMessage: "You have reached the limit of stages for this workflow in your plan"
|
|
1223
|
+
}) }),
|
|
1224
|
+
/* @__PURE__ */ jsx(LimitsModal.Body, { children: formatMessage({
|
|
1225
|
+
id: "review-workflows.edit.page.stages.limit.body",
|
|
1226
|
+
defaultMessage: "Try deleting some stages or contact Sales to enable more stages."
|
|
1227
|
+
}) })
|
|
1228
|
+
]
|
|
1229
|
+
}
|
|
1230
|
+
)
|
|
1288
1231
|
] });
|
|
1289
1232
|
};
|
|
1290
1233
|
const addTmpKeysToStages = (data) => {
|
|
@@ -1308,4 +1251,4 @@ const ProtectedEditPage = () => {
|
|
|
1308
1251
|
export {
|
|
1309
1252
|
ProtectedEditPage
|
|
1310
1253
|
};
|
|
1311
|
-
//# sourceMappingURL=_id-
|
|
1254
|
+
//# sourceMappingURL=_id-yOfUu1Rs.mjs.map
|