@strapi/review-workflows 0.0.0-experimental.d23c1d5b0e45dd06ef09977f526c85468be05403 → 0.0.0-experimental.d3243594aea3e6fa0ef08580192bb0df29c9162d

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.
Files changed (69) hide show
  1. package/LICENSE +12 -17
  2. package/dist/_chunks/{Layout-facLKucY.mjs → Layout-BJOxxAeM.mjs} +15 -22
  3. package/dist/_chunks/Layout-BJOxxAeM.mjs.map +1 -0
  4. package/dist/_chunks/{Layout-dGg4FA1R.js → Layout-DnEAvmeU.js} +12 -21
  5. package/dist/_chunks/Layout-DnEAvmeU.js.map +1 -0
  6. package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-6LK95-rZ.mjs} +319 -412
  7. package/dist/_chunks/_id-6LK95-rZ.mjs.map +1 -0
  8. package/dist/_chunks/{_id-B6DgrtpA.js → _id-DSDzUpwX.js} +325 -420
  9. package/dist/_chunks/_id-DSDzUpwX.js.map +1 -0
  10. package/dist/_chunks/{index-BuKZWpJw.js → index-6FZL88pd.js} +21 -56
  11. package/dist/_chunks/index-6FZL88pd.js.map +1 -0
  12. package/dist/_chunks/{index-DX8AGcIP.js → index-DZSLya4b.js} +189 -227
  13. package/dist/_chunks/index-DZSLya4b.js.map +1 -0
  14. package/dist/_chunks/{index-QbWLXdZR.mjs → index-Df1alkCk.mjs} +22 -55
  15. package/dist/_chunks/index-Df1alkCk.mjs.map +1 -0
  16. package/dist/_chunks/{index-D7Y0ofdg.mjs → index-lJqpw8bs.mjs} +190 -226
  17. package/dist/_chunks/index-lJqpw8bs.mjs.map +1 -0
  18. package/dist/_chunks/{purchase-review-workflows-B-V0sA2I.mjs → purchase-review-workflows-BN-5Ube7.mjs} +8 -7
  19. package/dist/_chunks/purchase-review-workflows-BN-5Ube7.mjs.map +1 -0
  20. package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-DlCDg0fD.js} +7 -6
  21. package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +1 -0
  22. package/dist/_chunks/{router-CL62NScV.js → router-CZqe-02r.js} +3 -3
  23. package/dist/_chunks/{router-CL62NScV.js.map → router-CZqe-02r.js.map} +1 -1
  24. package/dist/_chunks/{router-ylD0eA48.mjs → router-DeSH-NeW.mjs} +3 -3
  25. package/dist/_chunks/{router-ylD0eA48.mjs.map → router-DeSH-NeW.mjs.map} +1 -1
  26. package/dist/admin/index.js +1 -1
  27. package/dist/admin/index.mjs +1 -1
  28. package/dist/admin/src/components/LimitsModal.d.ts +2 -4
  29. package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +1 -1
  30. package/dist/admin/src/routes/settings/hooks/useDragAndDrop.d.ts +4 -4
  31. package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  32. package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +3 -3
  33. package/dist/admin/src/services/admin.d.ts +2 -2
  34. package/dist/admin/src/services/api.d.ts +2 -3
  35. package/dist/admin/src/services/content-manager.d.ts +7 -7
  36. package/dist/admin/src/services/settings.d.ts +1734 -8
  37. package/dist/admin/src/utils/api.d.ts +4 -19
  38. package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
  39. package/dist/server/index.js +35 -61
  40. package/dist/server/index.js.map +1 -1
  41. package/dist/server/index.mjs +35 -61
  42. package/dist/server/index.mjs.map +1 -1
  43. package/dist/server/src/controllers/assignees.d.ts.map +1 -1
  44. package/dist/server/src/controllers/index.d.ts +0 -1
  45. package/dist/server/src/controllers/index.d.ts.map +1 -1
  46. package/dist/server/src/controllers/stages.d.ts.map +1 -1
  47. package/dist/server/src/controllers/workflows.d.ts +0 -7
  48. package/dist/server/src/controllers/workflows.d.ts.map +1 -1
  49. package/dist/server/src/index.d.ts +1 -2
  50. package/dist/server/src/index.d.ts.map +1 -1
  51. package/dist/server/src/routes/review-workflows.d.ts.map +1 -1
  52. package/dist/server/src/services/document-service-middleware.d.ts.map +1 -1
  53. package/dist/server/src/services/index.d.ts +1 -1
  54. package/dist/server/src/services/stages.d.ts +2 -7
  55. package/dist/server/src/services/stages.d.ts.map +1 -1
  56. package/dist/shared/contracts/review-workflows.d.ts +1 -14
  57. package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
  58. package/package.json +15 -16
  59. package/dist/_chunks/Layout-dGg4FA1R.js.map +0 -1
  60. package/dist/_chunks/Layout-facLKucY.mjs.map +0 -1
  61. package/dist/_chunks/_id-B6DgrtpA.js.map +0 -1
  62. package/dist/_chunks/_id-D4CXKOqG.mjs.map +0 -1
  63. package/dist/_chunks/index-BuKZWpJw.js.map +0 -1
  64. package/dist/_chunks/index-D7Y0ofdg.mjs.map +0 -1
  65. package/dist/_chunks/index-DX8AGcIP.js.map +0 -1
  66. package/dist/_chunks/index-QbWLXdZR.mjs.map +0 -1
  67. package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +0 -1
  68. package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +0 -1
  69. package/strapi-server.js +0 -3
@@ -2,23 +2,21 @@ 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, IconButton, MultiSelectOption, useComposedRefs, VisuallyHidden, Accordion, AccordionToggle, AccordionContent, Grid, GridItem, SingleSelect, SingleSelectOption, TextInput, MultiSelect, MultiSelectGroup, useCollator, Button } from "@strapi/design-system";
6
- import { PlusCircle, EyeStriked, More, Drag, Duplicate, Check } from "@strapi/icons";
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
- import { useDispatch } from "react-redux";
10
9
  import { useParams, useNavigate } from "react-router-dom";
11
10
  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-D7Y0ofdg.mjs";
13
- import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-facLKucY.mjs";
14
- import { MenuItem, Menu } from "@strapi/design-system/v2";
11
+ 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-lJqpw8bs.mjs";
12
+ import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-BJOxxAeM.mjs";
15
13
  import { getEmptyImage } from "react-dnd-html5-backend";
16
- import styled from "styled-components";
14
+ import { styled } from "styled-components";
17
15
  import { useDrop, useDrag } from "react-dnd";
18
16
  const adminApi = reviewWorkflowsApi.injectEndpoints({
19
17
  endpoints(builder) {
20
18
  return {
21
- getRoles: builder.query({
19
+ getAdminRoles: builder.query({
22
20
  query: () => ({
23
21
  url: `/admin/roles`,
24
22
  method: "GET"
@@ -30,7 +28,7 @@ const adminApi = reviewWorkflowsApi.injectEndpoints({
30
28
  };
31
29
  }
32
30
  });
33
- const { useGetRolesQuery } = adminApi;
31
+ const { useGetAdminRolesQuery } = adminApi;
34
32
  const useKeyboardDragAndDrop = (active, index, { onCancel, onDropItem, onGrabItem, onMoveItem }) => {
35
33
  const [isSelected, setIsSelected] = React.useState(false);
36
34
  const handleMove = (movement) => {
@@ -249,74 +247,35 @@ const AddStage = ({ children, ...props }) => {
249
247
  return /* @__PURE__ */ jsx(
250
248
  StyledButton,
251
249
  {
252
- as: "button",
250
+ tag: "button",
253
251
  background: "neutral0",
254
- border: "neutral150",
252
+ borderColor: "neutral150",
255
253
  paddingBottom: 3,
256
254
  paddingLeft: 4,
257
255
  paddingRight: 4,
258
256
  paddingTop: 3,
259
257
  shadow: "filterShadow",
260
258
  ...props,
261
- children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
262
- /* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true }),
263
- /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral500", children })
264
- ] })
259
+ children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
260
+ /* @__PURE__ */ jsx(PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
261
+ children
262
+ ] }) })
265
263
  }
266
264
  );
267
265
  };
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
266
  const StyledButton = styled(Box)`
277
267
  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
- }
268
+ color: ${({ theme }) => theme.colors.neutral500};
287
269
 
288
270
  &:hover {
289
- color: ${({ theme }) => theme.colors.primary600} !important;
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
- }
271
+ color: ${({ theme }) => theme.colors.primary600};
302
272
  }
303
273
 
304
274
  &:active {
305
- ${Typography} {
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
- }
275
+ color: ${({ theme }) => theme.colors.primary600};
317
276
  }
318
277
  `;
319
- const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
278
+ const Stages = ({ canDelete = true, canUpdate = true, isCreating }) => {
320
279
  const { formatMessage } = useIntl();
321
280
  const { trackUsage } = useTracking();
322
281
  const addFieldRow = useForm("Stages", (state) => state.addFieldRow);
@@ -331,35 +290,23 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
331
290
  left: "50%",
332
291
  position: "absolute",
333
292
  top: "0",
334
- width: 2,
335
- zIndex: 1
293
+ width: 2
336
294
  }
337
295
  ),
338
- /* @__PURE__ */ jsx(
339
- Flex,
340
- {
341
- direction: "column",
342
- alignItems: "stretch",
343
- gap: 6,
344
- zIndex: 2,
345
- position: "relative",
346
- as: "ol",
347
- children: stages.map((stage, index) => {
348
- return /* @__PURE__ */ jsx(Box, { as: "li", children: /* @__PURE__ */ jsx(
349
- Stage,
350
- {
351
- index,
352
- canDelete: stages.length > 1 && canDelete,
353
- canReorder: stages.length > 1,
354
- canUpdate,
355
- stagesCount: stages.length,
356
- isOpen: isCreating,
357
- ...stage
358
- }
359
- ) }, stage.__temp_key__);
360
- })
361
- }
362
- )
296
+ /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", tag: "ol", children: stages.map((stage, index) => {
297
+ return /* @__PURE__ */ jsx(Box, { tag: "li", children: /* @__PURE__ */ jsx(
298
+ Stage,
299
+ {
300
+ index,
301
+ canDelete: stages.length > 1 && canDelete,
302
+ canReorder: stages.length > 1,
303
+ canUpdate,
304
+ stagesCount: stages.length,
305
+ defaultOpen: isCreating,
306
+ ...stage
307
+ }
308
+ ) }, stage.__temp_key__);
309
+ }) })
363
310
  ] }),
364
311
  canUpdate && /* @__PURE__ */ jsx(
365
312
  AddStage,
@@ -385,16 +332,15 @@ const Stage = ({
385
332
  canDelete = false,
386
333
  canReorder = false,
387
334
  canUpdate = false,
388
- isOpen: isOpenDefault = false,
389
335
  stagesCount,
390
336
  name,
391
337
  permissions,
392
- color
338
+ color,
339
+ defaultOpen
393
340
  }) => {
394
341
  const [liveText, setLiveText] = React.useState();
395
342
  const { formatMessage } = useIntl();
396
343
  const { trackUsage } = useTracking();
397
- const [isOpen, setIsOpen] = React.useState(isOpenDefault);
398
344
  const stageErrors = useForm("Stages", (state) => state.errors.stages);
399
345
  const error = stageErrors?.[index];
400
346
  const addFieldRow = useForm("Stage", (state) => state.addFieldRow);
@@ -476,7 +422,8 @@ const Stage = ({
476
422
  const handleCloneClick = () => {
477
423
  addFieldRow("stages", { name, color, permissions });
478
424
  };
479
- return /* @__PURE__ */ jsxs(Box, { ref: (ref) => composedRef(ref), children: [
425
+ const id = React.useId();
426
+ return /* @__PURE__ */ jsxs(Box, { ref: composedRef, shadow: "tableShadow", children: [
480
427
  liveText && /* @__PURE__ */ jsx(VisuallyHidden, { "aria-live": "assertive", children: liveText }),
481
428
  isDragging ? /* @__PURE__ */ jsx(
482
429
  Box,
@@ -487,74 +434,61 @@ const Stage = ({
487
434
  borderWidth: "1px",
488
435
  display: "block",
489
436
  hasRadius: true,
490
- padding: 6,
491
- shadow: "tableShadow"
437
+ padding: 6
492
438
  }
493
- ) : /* @__PURE__ */ jsxs(
494
- Accordion,
439
+ ) : /* @__PURE__ */ jsx(
440
+ AccordionRoot,
495
441
  {
496
- size: "S",
497
- variant: "primary",
498
- onToggle: () => {
499
- setIsOpen(!isOpen);
500
- if (!isOpen) {
442
+ onValueChange: (value) => {
443
+ if (value) {
501
444
  trackUsage("willEditStage");
502
445
  }
503
446
  },
504
- expanded: isOpen,
505
- shadow: "tableShadow",
506
- error: Object.values(error ?? {})[0],
507
- hasErrorMessage: false,
508
- children: [
509
- /* @__PURE__ */ jsx(
510
- AccordionToggle,
511
- {
512
- title: name,
513
- togglePosition: "left",
514
- action: (canDelete || canUpdate) && /* @__PURE__ */ jsxs(Flex, { children: [
515
- /* @__PURE__ */ jsxs(Menu.Root, { children: [
516
- /* @__PURE__ */ jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
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
- ] }) })
447
+ defaultValue: defaultOpen ? id : void 0,
448
+ $error: Object.values(error ?? {}).length > 0,
449
+ children: /* @__PURE__ */ jsxs(Accordion.Item, { value: id, children: [
450
+ /* @__PURE__ */ jsxs(Accordion.Header, { children: [
451
+ /* @__PURE__ */ jsx(Accordion.Trigger, { children: name }),
452
+ /* @__PURE__ */ jsx(Accordion.Actions, { children: canDelete || canUpdate ? /* @__PURE__ */ jsxs(Fragment, { children: [
453
+ /* @__PURE__ */ jsxs(Menu.Root, { children: [
454
+ /* @__PURE__ */ jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
455
+ /* @__PURE__ */ jsx(More, { "aria-hidden": true, focusable: false }),
456
+ /* @__PURE__ */ jsx(VisuallyHidden, { tag: "span", children: formatMessage({
457
+ id: "[tbdb].components.DynamicZone.more-actions",
458
+ defaultMessage: "More actions"
459
+ }) })
533
460
  ] }),
534
- canUpdate && /* @__PURE__ */ jsx(
535
- DragIconButton,
536
- {
537
- background: "transparent",
538
- forwardedAs: "div",
539
- hasRadius: true,
540
- role: "button",
541
- noBorder: true,
542
- tabIndex: 0,
543
- "data-handler-id": handlerId,
544
- ref: dragRef,
545
- label: formatMessage({
546
- id: "Settings.review-workflows.stage.drag",
547
- defaultMessage: "Drag"
548
- }),
549
- onClick: (e) => e.stopPropagation(),
550
- onKeyDown: handleKeyDown,
551
- children: /* @__PURE__ */ jsx(Drag, {})
552
- }
553
- )
554
- ] })
555
- }
556
- ),
557
- /* @__PURE__ */ jsx(AccordionContent, { padding: 6, background: "neutral0", hasRadius: true, children: /* @__PURE__ */ jsx(Grid, { gap: 4, children: [
461
+ /* @__PURE__ */ jsx(Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxs(Menu.SubRoot, { children: [
462
+ canUpdate && /* @__PURE__ */ jsx(MenuItem, { onClick: handleCloneClick, children: formatMessage({
463
+ id: "Settings.review-workflows.stage.delete",
464
+ defaultMessage: "Duplicate stage"
465
+ }) }),
466
+ canDelete && /* @__PURE__ */ jsx(DeleteMenuItem, { onClick: () => removeFieldRow("stages", index), children: formatMessage({
467
+ id: "Settings.review-workflows.stage.delete",
468
+ defaultMessage: "Delete"
469
+ }) })
470
+ ] }) })
471
+ ] }),
472
+ canUpdate && /* @__PURE__ */ jsx(
473
+ IconButton,
474
+ {
475
+ background: "transparent",
476
+ hasRadius: true,
477
+ variant: "ghost",
478
+ "data-handler-id": handlerId,
479
+ ref: dragRef,
480
+ label: formatMessage({
481
+ id: "Settings.review-workflows.stage.drag",
482
+ defaultMessage: "Drag"
483
+ }),
484
+ onClick: (e) => e.stopPropagation(),
485
+ onKeyDown: handleKeyDown,
486
+ children: /* @__PURE__ */ jsx(Drag, {})
487
+ }
488
+ )
489
+ ] }) : null })
490
+ ] }),
491
+ /* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(Grid.Root, { gap: 4, padding: 6, children: [
558
492
  {
559
493
  disabled: !canUpdate,
560
494
  label: formatMessage({
@@ -592,12 +526,16 @@ const Stage = ({
592
526
  size: 6,
593
527
  type: "permissions"
594
528
  }
595
- ].map(({ size, ...field }) => /* @__PURE__ */ jsx(GridItem, { col: size, children: /* @__PURE__ */ jsx(InputRenderer, { ...field }) }, field.name)) }) })
596
- ]
529
+ ].map(({ size, ...field }) => /* @__PURE__ */ jsx(Grid.Item, { col: size, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(InputRenderer, { ...field }) }, field.name)) }) })
530
+ ] })
597
531
  }
598
532
  )
599
533
  ] });
600
534
  };
535
+ const AccordionRoot = styled(Accordion.Root)`
536
+ border: 1px solid
537
+ ${({ theme, $error }) => $error ? theme.colors.danger600 : theme.colors.neutral200};
538
+ `;
601
539
  const DeleteMenuItem = styled(MenuItem)`
602
540
  color: ${({ theme }) => theme.colors.danger600};
603
541
  `;
@@ -611,22 +549,6 @@ const ContextMenuTrigger = styled(Menu.Trigger)`
611
549
  font-size: 0;
612
550
  }
613
551
  `;
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
552
  const InputRenderer = (props) => {
631
553
  switch (props.type) {
632
554
  case "color":
@@ -652,54 +574,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
652
574
  color: hex
653
575
  }));
654
576
  const { themeColorName } = getStageColorByHex(value) ?? {};
655
- return /* @__PURE__ */ jsx(
656
- SingleSelect,
657
- {
658
- disabled,
659
- error,
660
- required,
661
- label,
662
- onChange: (v) => {
663
- onChange(name, v.toString());
664
- },
665
- value: value?.toUpperCase(),
666
- startIcon: /* @__PURE__ */ jsx(
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,
577
+ return /* @__PURE__ */ jsxs(Field.Root, { error, name, required, children: [
578
+ /* @__PURE__ */ jsx(Field.Label, { children: label }),
579
+ /* @__PURE__ */ jsx(
580
+ SingleSelect,
581
+ {
582
+ disabled,
583
+ onChange: (v) => {
584
+ onChange(name, v.toString());
585
+ },
586
+ value: value?.toUpperCase(),
587
+ startIcon: /* @__PURE__ */ jsx(
588
+ Flex,
682
589
  {
683
- value: value2,
684
- startIcon: /* @__PURE__ */ jsx(
685
- Flex,
686
- {
687
- as: "span",
688
- height: 2,
689
- background: color,
690
- borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
691
- hasRadius: true,
692
- shrink: 0,
693
- width: 2
694
- }
695
- ),
696
- children: label2
697
- },
698
- value2
699
- );
700
- })
701
- }
702
- );
590
+ tag: "span",
591
+ height: 2,
592
+ background: value,
593
+ borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
594
+ hasRadius: true,
595
+ shrink: 0,
596
+ width: 2
597
+ }
598
+ ),
599
+ children: colorOptions.map(({ value: value2, label: label2, color }) => {
600
+ const { themeColorName: themeColorName2 } = getStageColorByHex(color) || {};
601
+ return /* @__PURE__ */ jsx(
602
+ SingleSelectOption,
603
+ {
604
+ value: value2,
605
+ startIcon: /* @__PURE__ */ jsx(
606
+ Flex,
607
+ {
608
+ tag: "span",
609
+ height: 2,
610
+ background: color,
611
+ borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
612
+ hasRadius: true,
613
+ shrink: 0,
614
+ width: 2
615
+ }
616
+ ),
617
+ children: label2
618
+ },
619
+ value2
620
+ );
621
+ })
622
+ }
623
+ ),
624
+ /* @__PURE__ */ jsx(Field.Error, {})
625
+ ] });
703
626
  };
704
627
  const PermissionsField = ({ disabled, name, placeholder, required }) => {
705
628
  const { formatMessage } = useIntl();
@@ -708,57 +631,65 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
708
631
  const { value = [], error, onChange } = useField(name);
709
632
  const allStages = useForm("PermissionsField", (state) => state.values.stages);
710
633
  const onFormValueChange = useForm("PermissionsField", (state) => state.onChange);
711
- const { data: roles = [], isLoading } = useGetRolesQuery();
634
+ const rolesErrorCount = React.useRef(0);
635
+ const { data: roles = [], isLoading, error: getRolesError } = useGetAdminRolesQuery();
712
636
  const filteredRoles = roles?.filter((role) => role.code !== "strapi-super-admin") ?? [];
713
637
  React.useEffect(() => {
714
- if (!isLoading && roles.length === 0) {
638
+ if (!isLoading && getRolesError && "status" in getRolesError && getRolesError.status == 403 && rolesErrorCount.current === 0) {
639
+ rolesErrorCount.current = 1;
715
640
  toggleNotification({
716
641
  blockTransition: true,
717
642
  type: "danger",
718
643
  message: formatMessage({
719
644
  id: "review-workflows.stage.permissions.noPermissions.description",
720
- defaultMessage: "You don’t have the permission to see roles"
645
+ defaultMessage: "You don’t have the permission to see roles. Contact your administrator."
721
646
  })
722
647
  });
723
648
  }
724
- }, [formatMessage, isLoading, roles, toggleNotification]);
649
+ }, [formatMessage, isLoading, roles, toggleNotification, getRolesError]);
725
650
  if (!isLoading && filteredRoles.length === 0) {
726
- return /* @__PURE__ */ jsx(
727
- TextInput,
651
+ return /* @__PURE__ */ jsxs(
652
+ Field.Root,
728
653
  {
729
- disabled: true,
730
654
  name,
731
655
  hint: formatMessage({
732
656
  id: "Settings.review-workflows.stage.permissions.noPermissions.description",
733
657
  defaultMessage: "You don’t have the permission to see roles"
734
658
  }),
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
659
  required,
744
- startAction: /* @__PURE__ */ jsx(StyledIcon, {}),
745
- type: "text",
746
- value: ""
660
+ children: [
661
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
662
+ id: "Settings.review-workflows.stage.permissions.label",
663
+ defaultMessage: "Roles that can change this stage"
664
+ }) }),
665
+ /* @__PURE__ */ jsx(
666
+ TextInput,
667
+ {
668
+ disabled: true,
669
+ placeholder: formatMessage({
670
+ id: "components.NotAllowedInput.text",
671
+ defaultMessage: "No permissions to see this field"
672
+ }),
673
+ startAction: /* @__PURE__ */ jsx(EyeStriked, { fill: "neutral600" }),
674
+ type: "text",
675
+ value: ""
676
+ }
677
+ ),
678
+ /* @__PURE__ */ jsx(Field.Hint, {})
679
+ ]
747
680
  }
748
681
  );
749
682
  }
750
- return /* @__PURE__ */ jsxs(Fragment, { children: [
751
- /* @__PURE__ */ jsxs(Flex, { alignItems: "flex-end", gap: 3, children: [
752
- /* @__PURE__ */ jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsx(
683
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "flex-end", gap: 3, children: [
684
+ /* @__PURE__ */ jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxs(Field.Root, { error, name, required: true, children: [
685
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
686
+ id: "Settings.review-workflows.stage.permissions.label",
687
+ defaultMessage: "Roles that can change this stage"
688
+ }) }),
689
+ /* @__PURE__ */ jsx(
753
690
  MultiSelect,
754
691
  {
755
692
  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
693
  onChange: (values) => {
763
694
  const permissions = values.map((value2) => ({
764
695
  role: parseInt(value2, 10),
@@ -767,7 +698,6 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
767
698
  onChange(name, permissions);
768
699
  },
769
700
  placeholder,
770
- required: true,
771
701
  value: value.map((permission) => `${permission.role}`),
772
702
  withTags: true,
773
703
  children: /* @__PURE__ */ jsx(
@@ -784,58 +714,52 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
784
714
  }
785
715
  )
786
716
  }
787
- ) }),
788
- /* @__PURE__ */ jsx(
717
+ ),
718
+ /* @__PURE__ */ jsx(Field.Error, {})
719
+ ] }) }),
720
+ /* @__PURE__ */ jsxs(Dialog.Root, { open: isApplyAllConfirmationOpen, onOpenChange: setIsApplyAllConfirmationOpen, children: [
721
+ /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
789
722
  IconButton,
790
723
  {
791
724
  disabled,
792
- icon: /* @__PURE__ */ jsx(Duplicate, {}),
793
725
  label: formatMessage({
794
726
  id: "Settings.review-workflows.stage.permissions.apply.label",
795
727
  defaultMessage: "Apply to all stages"
796
728
  }),
797
729
  size: "L",
798
- variant: "secondary",
799
- onClick: () => setIsApplyAllConfirmationOpen(true)
730
+ children: /* @__PURE__ */ jsx(Duplicate, {})
731
+ }
732
+ ) }),
733
+ /* @__PURE__ */ jsx(
734
+ ConfirmDialog,
735
+ {
736
+ onConfirm: () => {
737
+ onFormValueChange(
738
+ "stages",
739
+ allStages.map((stage) => ({
740
+ ...stage,
741
+ permissions: value
742
+ }))
743
+ );
744
+ setIsApplyAllConfirmationOpen(false);
745
+ toggleNotification({
746
+ type: "success",
747
+ message: formatMessage({
748
+ id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success",
749
+ defaultMessage: "Applied roles to all other stages of the workflow"
750
+ })
751
+ });
752
+ },
753
+ variant: "default",
754
+ children: formatMessage({
755
+ id: "Settings.review-workflows.page.edit.confirm.stages.permissions.copy",
756
+ defaultMessage: "Roles that can change that stage will be applied to all the other stages."
757
+ })
800
758
  }
801
759
  )
802
- ] }),
803
- /* @__PURE__ */ jsx(
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
- ] });
760
+ ] })
761
+ ] }) });
833
762
  };
834
- const StyledIcon = styled(EyeStriked)`
835
- & > path {
836
- fill: ${({ theme }) => theme.colors.neutral600};
837
- }
838
- `;
839
763
  const NestedOption$1 = styled(MultiSelectOption)`
840
764
  padding-left: ${({ theme }) => theme.spaces[7]};
841
765
  `;
@@ -846,8 +770,8 @@ const PermissionWrapper = styled(Flex)`
846
770
  `;
847
771
  const WorkflowAttributes = ({ canUpdate = true }) => {
848
772
  const { formatMessage } = useIntl();
849
- return /* @__PURE__ */ jsxs(Grid, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
850
- /* @__PURE__ */ jsx(GridItem, { col: 6, children: /* @__PURE__ */ jsx(
773
+ return /* @__PURE__ */ jsxs(Grid.Root, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
774
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(
851
775
  InputRenderer$1,
852
776
  {
853
777
  disabled: !canUpdate,
@@ -860,7 +784,7 @@ const WorkflowAttributes = ({ canUpdate = true }) => {
860
784
  type: "string"
861
785
  }
862
786
  ) }),
863
- /* @__PURE__ */ jsx(GridItem, { col: 6, children: /* @__PURE__ */ jsx(ContentTypesSelector, { disabled: !canUpdate }) })
787
+ /* @__PURE__ */ jsx(Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(ContentTypesSelector, { disabled: !canUpdate }) })
864
788
  ] });
865
789
  };
866
790
  const ContentTypesSelector = ({ disabled }) => {
@@ -881,81 +805,82 @@ const ContentTypesSelector = ({ disabled }) => {
881
805
  label: contentType.info.displayName,
882
806
  value: contentType.uid
883
807
  }));
884
- return /* @__PURE__ */ jsx(
885
- MultiSelect,
886
- {
887
- customizeContent: (value2) => formatMessage(
888
- {
889
- id: "Settings.review-workflows.workflow.contentTypes.displayValue",
890
- defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
891
- },
892
- { count: value2?.length }
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,
808
+ return /* @__PURE__ */ jsxs(Field.Root, { error, name: "contentTypes", children: [
809
+ /* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
810
+ id: "Settings.review-workflows.workflow.contentTypes.label",
811
+ defaultMessage: "Associated to"
812
+ }) }),
813
+ /* @__PURE__ */ jsx(
814
+ MultiSelect,
815
+ {
816
+ customizeContent: (value2) => formatMessage(
930
817
  {
931
- label: opt.label,
932
- values: opt.children.map((child) => child.value.toString()),
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
- })
818
+ id: "Settings.review-workflows.workflow.contentTypes.displayValue",
819
+ defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
953
820
  },
954
- opt.label
955
- );
956
- })
957
- }
958
- );
821
+ { count: value2?.length }
822
+ ),
823
+ disabled: isDisabled,
824
+ onChange: (values) => {
825
+ onChange("contentTypes", values);
826
+ },
827
+ value,
828
+ placeholder: formatMessage({
829
+ id: "Settings.review-workflows.workflow.contentTypes.placeholder",
830
+ defaultMessage: "Select"
831
+ }),
832
+ children: [
833
+ ...collectionTypes.length > 0 ? [
834
+ {
835
+ label: formatMessage({
836
+ id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
837
+ defaultMessage: "Collection Types"
838
+ }),
839
+ children: collectionTypes
840
+ }
841
+ ] : [],
842
+ ...singleTypes.length > 0 ? [
843
+ {
844
+ label: formatMessage({
845
+ id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
846
+ defaultMessage: "Single Types"
847
+ }),
848
+ children: singleTypes
849
+ }
850
+ ] : []
851
+ ].map((opt) => {
852
+ return /* @__PURE__ */ jsx(
853
+ MultiSelectGroup,
854
+ {
855
+ label: opt.label,
856
+ values: opt.children.map((child) => child.value.toString()),
857
+ children: opt.children.map((child) => {
858
+ const { name: assignedWorkflowName } = workflows?.find(
859
+ (workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
860
+ ) ?? {};
861
+ return /* @__PURE__ */ jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsx(Typography, {
862
+ // @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
863
+ children: formatMessage(
864
+ {
865
+ id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
866
+ defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
867
+ },
868
+ {
869
+ label: child.label,
870
+ name: assignedWorkflowName,
871
+ em: (...children) => /* @__PURE__ */ jsx(Typography, { tag: "em", fontWeight: "bold", children }),
872
+ i: (...children) => /* @__PURE__ */ jsx(ContentTypeTakeNotice, { children })
873
+ }
874
+ )
875
+ }) }, child.value);
876
+ })
877
+ },
878
+ opt.label
879
+ );
880
+ })
881
+ }
882
+ )
883
+ ] });
959
884
  };
960
885
  const NestedOption = styled(MultiSelectOption)`
961
886
  padding-left: ${({ theme }) => theme.spaces[7]};
@@ -968,10 +893,10 @@ const WORKFLOW_SCHEMA = yup.object({
968
893
  name: yup.string().max(255, {
969
894
  id: "review-workflows.validation.name.max-length",
970
895
  defaultMessage: "Name can not be longer than 255 characters"
971
- }).required(),
896
+ }).required().nullable(),
972
897
  stages: yup.array().of(
973
898
  yup.object().shape({
974
- name: yup.string().required({
899
+ name: yup.string().nullable().required({
975
900
  id: "review-workflows.validation.stage.name",
976
901
  defaultMessage: "Name is required"
977
902
  }).max(255, {
@@ -988,7 +913,7 @@ const WORKFLOW_SCHEMA = yup.object({
988
913
  return stages.filter((stage) => stage.name === stageName).length === 1;
989
914
  }
990
915
  ),
991
- color: yup.string().required({
916
+ color: yup.string().nullable().required({
992
917
  id: "review-workflows.validation.stage.color",
993
918
  defaultMessage: "Color is required"
994
919
  }).matches(/^#(?:[0-9a-fA-F]{3}){1,2}$/i),
@@ -1014,7 +939,6 @@ const EditPage = () => {
1014
939
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
1015
940
  const navigate = useNavigate();
1016
941
  const { toggleNotification } = useNotification();
1017
- const dispatch = useDispatch();
1018
942
  const {
1019
943
  isLoading: isLoadingWorkflow,
1020
944
  meta,
@@ -1022,7 +946,7 @@ const EditPage = () => {
1022
946
  error,
1023
947
  update,
1024
948
  create
1025
- } = useReviewWorkflows({ id: isCreatingWorkflow ? void 0 : id });
949
+ } = useReviewWorkflows();
1026
950
  const permissions = useTypedSelector(
1027
951
  (state) => state.admin_app.permissions["settings"]?.["review-workflows"]
1028
952
  );
@@ -1065,36 +989,13 @@ const EditPage = () => {
1065
989
  });
1066
990
  if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1067
991
  helpers.setErrors(formatValidationErrors(res.error));
1068
- } else if ("data" in res) {
1069
- for (const uid of res.data.contentTypes) {
1070
- dispatch({
1071
- type: "contentManagerApi/invalidateTags",
1072
- payload: [
1073
- {
1074
- type: "ContentTypesConfiguration",
1075
- id: uid
1076
- }
1077
- ]
1078
- });
1079
- }
1080
992
  }
1081
993
  } else {
1082
994
  const res = await create(data);
1083
995
  if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1084
996
  helpers.setErrors(formatValidationErrors(res.error));
1085
997
  } else if ("data" in res) {
1086
- for (const uid of res.data.contentTypes) {
1087
- dispatch({
1088
- type: "contentManagerApi/invalidateTags",
1089
- payload: [
1090
- {
1091
- type: "ContentTypesConfiguration",
1092
- id: uid
1093
- }
1094
- ]
1095
- });
1096
- }
1097
- navigate(`../${res.data.id}`);
998
+ navigate(`../${res.data.id}`, { replace: true });
1098
999
  }
1099
1000
  }
1100
1001
  } catch (error2) {
@@ -1216,23 +1117,22 @@ const EditPage = () => {
1216
1117
  }
1217
1118
  ),
1218
1119
  /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", gap: 7, children: [
1219
- /* @__PURE__ */ jsx(WorkflowAttributes, { canUpdate }),
1120
+ /* @__PURE__ */ jsx(WorkflowAttributes, { canUpdate: canUpdate || canCreate }),
1220
1121
  /* @__PURE__ */ jsx(
1221
1122
  Stages,
1222
1123
  {
1223
1124
  canDelete,
1224
- canUpdate,
1125
+ canUpdate: canUpdate || canCreate,
1225
1126
  isCreating: isCreatingWorkflow
1226
1127
  }
1227
1128
  )
1228
1129
  ] }) }),
1229
1130
  /* @__PURE__ */ jsx(
1230
- ConfirmDialog,
1131
+ Dialog.Root,
1231
1132
  {
1232
- isOpen: Object.keys(savePrompts).length > 0,
1233
- onClose: handleConfirmClose,
1234
- onConfirm: handleConfirmDeleteDialog(values, { setErrors }),
1235
- children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, children: [
1133
+ open: Object.keys(savePrompts).length > 0,
1134
+ onOpenChange: handleConfirmClose,
1135
+ children: /* @__PURE__ */ jsx(ConfirmDialog, { onConfirm: handleConfirmDeleteDialog(values, { setErrors }), children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, children: [
1236
1136
  savePrompts.hasDeletedServerStages && /* @__PURE__ */ jsx(Typography, { textAlign: "center", variant: "omega", children: formatMessage({
1237
1137
  id: "review-workflows.page.delete.confirm.stages.body",
1238
1138
  defaultMessage: "All entries assigned to deleted stages will be moved to the previous stage."
@@ -1244,7 +1144,7 @@ const EditPage = () => {
1244
1144
  },
1245
1145
  {
1246
1146
  count: contentTypesFromOtherWorkflows?.filter(
1247
- (contentType) => currentWorkflow?.contentTypes?.includes(contentType)
1147
+ (contentType) => values.contentTypes.includes(contentType)
1248
1148
  ).length ?? 0
1249
1149
  }
1250
1150
  ) }),
@@ -1252,7 +1152,7 @@ const EditPage = () => {
1252
1152
  id: "review-workflows.page.delete.confirm.confirm",
1253
1153
  defaultMessage: "Are you sure you want to save?"
1254
1154
  }) })
1255
- ] })
1155
+ ] }) })
1256
1156
  }
1257
1157
  )
1258
1158
  ] })
@@ -1261,8 +1161,8 @@ const EditPage = () => {
1261
1161
  /* @__PURE__ */ jsxs(
1262
1162
  LimitsModal.Root,
1263
1163
  {
1264
- isOpen: showLimitModal === "workflow",
1265
- onClose: () => setShowLimitModal(null),
1164
+ open: showLimitModal === "workflow",
1165
+ onOpenChange: () => setShowLimitModal(null),
1266
1166
  children: [
1267
1167
  /* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
1268
1168
  id: "review-workflows.edit.page.workflows.limit.title",
@@ -1275,16 +1175,23 @@ const EditPage = () => {
1275
1175
  ]
1276
1176
  }
1277
1177
  ),
1278
- /* @__PURE__ */ jsxs(LimitsModal.Root, { isOpen: showLimitModal === "stage", onClose: () => setShowLimitModal(null), children: [
1279
- /* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
1280
- id: "review-workflows.edit.page.stages.limit.title",
1281
- defaultMessage: "You have reached the limit of stages for this workflow in your plan"
1282
- }) }),
1283
- /* @__PURE__ */ jsx(LimitsModal.Body, { children: formatMessage({
1284
- id: "review-workflows.edit.page.stages.limit.body",
1285
- defaultMessage: "Try deleting some stages or contact Sales to enable more stages."
1286
- }) })
1287
- ] })
1178
+ /* @__PURE__ */ jsxs(
1179
+ LimitsModal.Root,
1180
+ {
1181
+ open: showLimitModal === "stage",
1182
+ onOpenChange: () => setShowLimitModal(null),
1183
+ children: [
1184
+ /* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
1185
+ id: "review-workflows.edit.page.stages.limit.title",
1186
+ defaultMessage: "You have reached the limit of stages for this workflow in your plan"
1187
+ }) }),
1188
+ /* @__PURE__ */ jsx(LimitsModal.Body, { children: formatMessage({
1189
+ id: "review-workflows.edit.page.stages.limit.body",
1190
+ defaultMessage: "Try deleting some stages or contact Sales to enable more stages."
1191
+ }) })
1192
+ ]
1193
+ }
1194
+ )
1288
1195
  ] });
1289
1196
  };
1290
1197
  const addTmpKeysToStages = (data) => {
@@ -1308,4 +1215,4 @@ const ProtectedEditPage = () => {
1308
1215
  export {
1309
1216
  ProtectedEditPage
1310
1217
  };
1311
- //# sourceMappingURL=_id-D4CXKOqG.mjs.map
1218
+ //# sourceMappingURL=_id-6LK95-rZ.mjs.map