@strapi/review-workflows 0.0.0-experimental.9df68962083938acba06546a7901c68a63266aec → 0.0.0-experimental.a13c58eec89ab119f0e381fb79c0252979e9c125

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 (81) hide show
  1. package/LICENSE +12 -17
  2. package/dist/_chunks/{Layout-D292CXD6.mjs → Layout-BIIxkAtf.mjs} +9 -10
  3. package/dist/_chunks/Layout-BIIxkAtf.mjs.map +1 -0
  4. package/dist/_chunks/{Layout-BWzD-Tfe.js → Layout-BWNbQOes.js} +9 -10
  5. package/dist/_chunks/Layout-BWNbQOes.js.map +1 -0
  6. package/dist/_chunks/{en-xcewH2pC.js → en-CYgjfSep.js} +5 -2
  7. package/dist/_chunks/en-CYgjfSep.js.map +1 -0
  8. package/dist/_chunks/{en-D9ZrQAV6.mjs → en-D9dxziEb.mjs} +5 -2
  9. package/dist/_chunks/en-D9dxziEb.mjs.map +1 -0
  10. package/dist/_chunks/{_id-CoX9yljN.js → id-CaHzMdxL.js} +103 -80
  11. package/dist/_chunks/id-CaHzMdxL.js.map +1 -0
  12. package/dist/_chunks/{_id-DqEUzU_u.mjs → id-CtcCl3zh.mjs} +103 -80
  13. package/dist/_chunks/id-CtcCl3zh.mjs.map +1 -0
  14. package/dist/_chunks/{index-D-KMrml_.js → index-BX5MyocW.js} +79 -68
  15. package/dist/_chunks/index-BX5MyocW.js.map +1 -0
  16. package/dist/_chunks/{index-udedGkii.mjs → index-ByTEmYbc.mjs} +80 -69
  17. package/dist/_chunks/index-ByTEmYbc.mjs.map +1 -0
  18. package/dist/_chunks/{index-2nkLt-AE.mjs → index-CGmh3cED.mjs} +11 -31
  19. package/dist/_chunks/index-CGmh3cED.mjs.map +1 -0
  20. package/dist/_chunks/{index-CDMcvtW9.js → index-DKLk-Z5E.js} +9 -29
  21. package/dist/_chunks/index-DKLk-Z5E.js.map +1 -0
  22. package/dist/_chunks/{router-C19H1Rju.js → router-Bt6JHY-e.js} +3 -3
  23. package/dist/_chunks/router-Bt6JHY-e.js.map +1 -0
  24. package/dist/_chunks/{router-bmjk-Tpf.mjs → router-Cr3nulh9.mjs} +3 -3
  25. package/dist/_chunks/router-Cr3nulh9.mjs.map +1 -0
  26. package/dist/admin/index.js +1 -1
  27. package/dist/admin/index.mjs +1 -1
  28. package/dist/admin/src/services/admin.d.ts +1 -1
  29. package/dist/admin/src/services/api.d.ts +1 -1
  30. package/dist/admin/src/services/content-manager.d.ts +4 -4
  31. package/dist/admin/src/services/settings.d.ts +1739 -9
  32. package/dist/server/index.js +165 -84
  33. package/dist/server/index.js.map +1 -1
  34. package/dist/server/index.mjs +165 -84
  35. package/dist/server/index.mjs.map +1 -1
  36. package/dist/server/src/bootstrap.d.ts.map +1 -1
  37. package/dist/server/src/constants/workflows.d.ts +1 -0
  38. package/dist/server/src/constants/workflows.d.ts.map +1 -1
  39. package/dist/server/src/content-types/index.d.ts +6 -0
  40. package/dist/server/src/content-types/index.d.ts.map +1 -1
  41. package/dist/server/src/content-types/workflow/index.d.ts +6 -0
  42. package/dist/server/src/content-types/workflow/index.d.ts.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 +16 -4
  50. package/dist/server/src/index.d.ts.map +1 -1
  51. package/dist/server/src/register.d.ts.map +1 -1
  52. package/dist/server/src/routes/review-workflows.d.ts.map +1 -1
  53. package/dist/server/src/services/document-service-middleware.d.ts +1 -0
  54. package/dist/server/src/services/document-service-middleware.d.ts.map +1 -1
  55. package/dist/server/src/services/index.d.ts +4 -3
  56. package/dist/server/src/services/index.d.ts.map +1 -1
  57. package/dist/server/src/services/metrics/index.d.ts +4 -4
  58. package/dist/server/src/services/metrics/index.d.ts.map +1 -1
  59. package/dist/server/src/services/metrics/weekly-metrics.d.ts.map +1 -1
  60. package/dist/server/src/services/stages.d.ts +2 -7
  61. package/dist/server/src/services/stages.d.ts.map +1 -1
  62. package/dist/server/src/services/workflows.d.ts.map +1 -1
  63. package/dist/server/src/validation/review-workflows.d.ts +4 -0
  64. package/dist/server/src/validation/review-workflows.d.ts.map +1 -1
  65. package/dist/shared/contracts/review-workflows.d.ts +9 -17
  66. package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
  67. package/package.json +10 -10
  68. package/dist/_chunks/Layout-BWzD-Tfe.js.map +0 -1
  69. package/dist/_chunks/Layout-D292CXD6.mjs.map +0 -1
  70. package/dist/_chunks/_id-CoX9yljN.js.map +0 -1
  71. package/dist/_chunks/_id-DqEUzU_u.mjs.map +0 -1
  72. package/dist/_chunks/en-D9ZrQAV6.mjs.map +0 -1
  73. package/dist/_chunks/en-xcewH2pC.js.map +0 -1
  74. package/dist/_chunks/index-2nkLt-AE.mjs.map +0 -1
  75. package/dist/_chunks/index-CDMcvtW9.js.map +0 -1
  76. package/dist/_chunks/index-D-KMrml_.js.map +0 -1
  77. package/dist/_chunks/index-udedGkii.mjs.map +0 -1
  78. package/dist/_chunks/router-C19H1Rju.js.map +0 -1
  79. package/dist/_chunks/router-bmjk-Tpf.mjs.map +0 -1
  80. package/strapi-server.js +0 -3
  81. /package/dist/admin/src/routes/settings/{:id.d.ts → id.d.ts} +0 -0
package/LICENSE CHANGED
@@ -1,22 +1,17 @@
1
1
  Copyright (c) 2015-present Strapi Solutions SAS
2
2
 
3
- Portions of the Strapi software are licensed as follows:
3
+ * All software that resides within this directory and its subdirectories, is licensed under the license defined below.
4
4
 
5
- * All software that resides under an "ee/" directory (the “EE Software”), if that directory exists, is licensed under the license defined in "ee/LICENSE".
5
+ Enterprise License
6
6
 
7
- * All software outside of the above-mentioned directories or restrictions above is available under the "MIT Expat" license as set forth below.
7
+ If you or the company you represent has entered into a written agreement referencing the Enterprise Edition of the Strapi source code available at
8
+ https://github.com/strapi/strapi, then such agreement applies to your use of the Enterprise Edition of the Strapi Software. If you or the company you
9
+ represent is using the Enterprise Edition of the Strapi Software in connection with a subscription to our cloud offering, then the agreement you have
10
+ agreed to with respect to our cloud offering and the licenses included in such agreement apply to your use of the Enterprise Edition of the Strapi Software.
11
+ Otherwise, the Strapi Enterprise Software License Agreement (found here https://strapi.io/enterprise-terms) applies to your use of the Enterprise Edition of the Strapi Software.
8
12
 
9
- MIT Expat License
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in all
19
- copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- SOFTWARE.
13
+ BY ACCESSING OR USING THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE, YOU ARE AGREEING TO BE BOUND BY THE RELEVANT REFERENCED AGREEMENT.
14
+ IF YOU ARE NOT AUTHORIZED TO ACCEPT THESE TERMS ON BEHALF OF THE COMPANY YOU REPRESENT OR IF YOU DO NOT AGREE TO ALL OF THE RELEVANT TERMS AND CONDITIONS REFERENCED AND YOU
15
+ HAVE NOT OTHERWISE EXECUTED A WRITTEN AGREEMENT WITH STRAPI, YOU ARE NOT AUTHORIZED TO ACCESS OR USE OR ALLOW ANY USER TO ACCESS OR USE ANY PART OF
16
+ THE ENTERPRISE EDITION OF THE STRAPI SOFTWARE. YOUR ACCESS RIGHTS ARE CONDITIONAL ON YOUR CONSENT TO THE RELEVANT REFERENCED TERMS TO THE EXCLUSION OF ALL OTHER TERMS;
17
+ IF THE RELEVANT REFERENCED TERMS ARE CONSIDERED AN OFFER BY YOU, ACCEPTANCE IS EXPRESSLY LIMITED TO THE RELEVANT REFERENCED TERMS.
@@ -1,7 +1,7 @@
1
1
  import * as React from "react";
2
2
  import { useNotification, useAPIErrorHandler, Page, Layouts } from "@strapi/admin/strapi-admin";
3
3
  import { useIntl } from "react-intl";
4
- import { c as useGetWorkflowsQuery, d as useCreateWorkflowMutation, e as useUpdateWorkflowMutation, f as useDeleteWorkflowMutation } from "./index-udedGkii.mjs";
4
+ import { c as useGetWorkflowsQuery, d as useCreateWorkflowMutation, e as useUpdateWorkflowMutation, f as useDeleteWorkflowMutation } from "./index-ByTEmYbc.mjs";
5
5
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
6
6
  import { Flex, Typography, Box } from "@strapi/design-system";
7
7
  import { useDragLayer } from "react-dnd";
@@ -14,11 +14,10 @@ const useReviewWorkflows = (params = {}) => {
14
14
  const { toggleNotification } = useNotification();
15
15
  const { formatMessage } = useIntl();
16
16
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
17
- const { id = "", skip = false, ...queryParams } = params;
17
+ const { skip = false, ...queryParams } = params;
18
18
  const { data, isLoading, error } = useGetWorkflowsQuery(
19
19
  {
20
- id,
21
- populate: "stages",
20
+ populate: ["stages", "stageRequiredToPublish"],
22
21
  ...queryParams
23
22
  },
24
23
  {
@@ -62,9 +61,9 @@ const useReviewWorkflows = (params = {}) => {
62
61
  );
63
62
  const [updateWorkflow] = useUpdateWorkflowMutation();
64
63
  const update = React.useCallback(
65
- async (id2, data2) => {
64
+ async (id, data2) => {
66
65
  try {
67
- const res = await updateWorkflow({ id: id2, data: data2 });
66
+ const res = await updateWorkflow({ id, data: data2 });
68
67
  if ("error" in res) {
69
68
  toggleNotification({
70
69
  type: "danger",
@@ -89,9 +88,9 @@ const useReviewWorkflows = (params = {}) => {
89
88
  );
90
89
  const [deleteWorkflow] = useDeleteWorkflowMutation();
91
90
  const deleteAction = React.useCallback(
92
- async (id2) => {
91
+ async (id) => {
93
92
  try {
94
- const res = await deleteWorkflow({ id: id2 });
93
+ const res = await deleteWorkflow({ id });
95
94
  if ("error" in res) {
96
95
  toggleNotification({
97
96
  type: "danger",
@@ -214,7 +213,7 @@ const Header = ({ title, subtitle, navigationAction, primaryAction }) => {
214
213
  }
215
214
  ) }),
216
215
  /* @__PURE__ */ jsx(
217
- Layouts.Header,
216
+ Layouts.BaseHeader,
218
217
  {
219
218
  navigationAction,
220
219
  primaryAction,
@@ -231,4 +230,4 @@ export {
231
230
  DragLayerRendered as a,
232
231
  useReviewWorkflows as u
233
232
  };
234
- //# sourceMappingURL=Layout-D292CXD6.mjs.map
233
+ //# sourceMappingURL=Layout-BIIxkAtf.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout-BIIxkAtf.mjs","sources":["../../admin/src/routes/settings/hooks/useReviewWorkflows.ts","../../admin/src/routes/settings/constants.ts","../../admin/src/routes/settings/components/StageDragPreview.tsx","../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport {\n GetWorkflowsParams,\n useCreateWorkflowMutation,\n useDeleteWorkflowMutation,\n useGetWorkflowsQuery,\n useUpdateWorkflowMutation,\n} from '../../../services/settings';\n\nimport type { Create, Update } from '../../../../../shared/contracts/review-workflows';\n\nconst DEFAULT_UNEXPECTED_ERROR_MSG = {\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n} satisfies MessageDescriptor;\n\ntype UseReviewWorkflowsArgs = GetWorkflowsParams & {\n skip?: boolean;\n};\n\nconst useReviewWorkflows = (params: UseReviewWorkflowsArgs = {}) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n populate: ['stages', 'stageRequiredToPublish'],\n ...queryParams,\n },\n {\n skip,\n }\n );\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const [createWorkflow] = useCreateWorkflowMutation();\n const create = React.useCallback(\n async (data: Create.Request['body']['data']) => {\n try {\n const res = await createWorkflow({ data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.created', defaultMessage: 'Created workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [createWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const [updateWorkflow] = useUpdateWorkflowMutation();\n const update = React.useCallback(\n async (id: string, data: Update.Request['body']['data']) => {\n try {\n const res = await updateWorkflow({ id, data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.updated', defaultMessage: 'Updated workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [formatAPIError, formatMessage, toggleNotification, updateWorkflow]\n );\n\n const [deleteWorkflow] = useDeleteWorkflowMutation();\n const deleteAction = React.useCallback(\n async (id: string) => {\n try {\n const res = await deleteWorkflow({ id });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.deleted', defaultMessage: 'Deleted workflow' }),\n });\n\n return res.data;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [deleteWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const { workflows = [], meta } = data ?? {};\n\n return {\n // meta contains e.g. the total of all workflows. we can not use\n // the pagination object here, because the list is not paginated.\n meta,\n workflows,\n isLoading,\n error,\n create,\n delete: deleteAction,\n update,\n };\n};\n\nexport { useReviewWorkflows };\n","export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n","import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLay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,YAAY,QAAQ,WAAW;AAAA,MAC/B,aAAa,QAAQ,gBAAgB;AAAA,IAAA;AAAA,EACvC;AAGF,MAAI,CAAC,cAAc,aAAa,gBAAgB,OAAO;AAC9C,WAAA;AAAA,EACT;AAGE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,MAAM;AAAA,MACN,UAAS;AAAA,MACT,eAAc;AAAA,MACd,KAAK;AAAA,MACL,QAAQ;AAAA,MACR,OAAM;AAAA,MAEN,+BAAC,KAAI,EAAA,OAAO,SAAS,eAAe,eAAe,WAAW,GAC5D,UAAA;AAAA,QAAC,oBAAA,kBAAA,EAAiB,MAAM,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO,MAAM;AAAA,QAAE;AAAA,MAAA,GAC9E;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,OAA0C,CAAC,EAAE,eAAe;AAE9D,SAAA,oBAAC,KAAK,MAAL,EACC,8BAAC,QAAQ,SAAR,EAAiB,SAAS,CAAA,EAC7B,CAAA;AAEJ;AAUA,MAAM,SAAgC,CAAC,EAAE,OAAO,UAAU,kBAAkB,oBAAoB;AACxF,QAAA,EAAE,kBAAkB;AAC1B,SAEI,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAC,oBAAA,KAAK,OAAL,EACE,UAAA;AAAA,MACC,EAAE,IAAI,sBAAsB,gBAAgB,oBAAoB;AAAA,MAChE;AAAA,QACE,MAAM;AAAA,MACR;AAAA,IAAA,GAEJ;AAAA,IACA;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
@@ -2,7 +2,7 @@
2
2
  const React = require("react");
3
3
  const strapiAdmin = require("@strapi/admin/strapi-admin");
4
4
  const reactIntl = require("react-intl");
5
- const index = require("./index-D-KMrml_.js");
5
+ const index = require("./index-BX5MyocW.js");
6
6
  const jsxRuntime = require("react/jsx-runtime");
7
7
  const designSystem = require("@strapi/design-system");
8
8
  const reactDnd = require("react-dnd");
@@ -34,11 +34,10 @@ const useReviewWorkflows = (params = {}) => {
34
34
  const { toggleNotification } = strapiAdmin.useNotification();
35
35
  const { formatMessage } = reactIntl.useIntl();
36
36
  const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
37
- const { id = "", skip = false, ...queryParams } = params;
37
+ const { skip = false, ...queryParams } = params;
38
38
  const { data, isLoading, error } = index.useGetWorkflowsQuery(
39
39
  {
40
- id,
41
- populate: "stages",
40
+ populate: ["stages", "stageRequiredToPublish"],
42
41
  ...queryParams
43
42
  },
44
43
  {
@@ -82,9 +81,9 @@ const useReviewWorkflows = (params = {}) => {
82
81
  );
83
82
  const [updateWorkflow] = index.useUpdateWorkflowMutation();
84
83
  const update = React__namespace.useCallback(
85
- async (id2, data2) => {
84
+ async (id, data2) => {
86
85
  try {
87
- const res = await updateWorkflow({ id: id2, data: data2 });
86
+ const res = await updateWorkflow({ id, data: data2 });
88
87
  if ("error" in res) {
89
88
  toggleNotification({
90
89
  type: "danger",
@@ -109,9 +108,9 @@ const useReviewWorkflows = (params = {}) => {
109
108
  );
110
109
  const [deleteWorkflow] = index.useDeleteWorkflowMutation();
111
110
  const deleteAction = React__namespace.useCallback(
112
- async (id2) => {
111
+ async (id) => {
113
112
  try {
114
- const res = await deleteWorkflow({ id: id2 });
113
+ const res = await deleteWorkflow({ id });
115
114
  if ("error" in res) {
116
115
  toggleNotification({
117
116
  type: "danger",
@@ -234,7 +233,7 @@ const Header = ({ title, subtitle, navigationAction, primaryAction }) => {
234
233
  }
235
234
  ) }),
236
235
  /* @__PURE__ */ jsxRuntime.jsx(
237
- strapiAdmin.Layouts.Header,
236
+ strapiAdmin.Layouts.BaseHeader,
238
237
  {
239
238
  navigationAction,
240
239
  primaryAction,
@@ -249,4 +248,4 @@ exports.DragLayerRendered = DragLayerRendered;
249
248
  exports.Header = Header;
250
249
  exports.Root = Root;
251
250
  exports.useReviewWorkflows = useReviewWorkflows;
252
- //# sourceMappingURL=Layout-BWzD-Tfe.js.map
251
+ //# sourceMappingURL=Layout-BWNbQOes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Layout-BWNbQOes.js","sources":["../../admin/src/routes/settings/hooks/useReviewWorkflows.ts","../../admin/src/routes/settings/constants.ts","../../admin/src/routes/settings/components/StageDragPreview.tsx","../../admin/src/routes/settings/components/Layout.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport {\n GetWorkflowsParams,\n useCreateWorkflowMutation,\n useDeleteWorkflowMutation,\n useGetWorkflowsQuery,\n useUpdateWorkflowMutation,\n} from '../../../services/settings';\n\nimport type { Create, Update } from '../../../../../shared/contracts/review-workflows';\n\nconst DEFAULT_UNEXPECTED_ERROR_MSG = {\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n} satisfies MessageDescriptor;\n\ntype UseReviewWorkflowsArgs = GetWorkflowsParams & {\n skip?: boolean;\n};\n\nconst useReviewWorkflows = (params: UseReviewWorkflowsArgs = {}) => {\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n populate: ['stages', 'stageRequiredToPublish'],\n ...queryParams,\n },\n {\n skip,\n }\n );\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const [createWorkflow] = useCreateWorkflowMutation();\n const create = React.useCallback(\n async (data: Create.Request['body']['data']) => {\n try {\n const res = await createWorkflow({ data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.created', defaultMessage: 'Created workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [createWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const [updateWorkflow] = useUpdateWorkflowMutation();\n const update = React.useCallback(\n async (id: string, data: Update.Request['body']['data']) => {\n try {\n const res = await updateWorkflow({ id, data });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return res;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.updated', defaultMessage: 'Updated workflow' }),\n });\n\n return res;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [formatAPIError, formatMessage, toggleNotification, updateWorkflow]\n );\n\n const [deleteWorkflow] = useDeleteWorkflowMutation();\n const deleteAction = React.useCallback(\n async (id: string) => {\n try {\n const res = await deleteWorkflow({ id });\n\n if ('error' in res) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'actions.deleted', defaultMessage: 'Deleted workflow' }),\n });\n\n return res.data;\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage(DEFAULT_UNEXPECTED_ERROR_MSG),\n });\n\n throw err;\n }\n },\n [deleteWorkflow, formatAPIError, formatMessage, toggleNotification]\n );\n\n const { workflows = [], meta } = data ?? {};\n\n return {\n // meta contains e.g. the total of all workflows. we can not use\n // the pagination object here, because the list is not paginated.\n meta,\n workflows,\n isLoading,\n error,\n create,\n delete: deleteAction,\n update,\n };\n};\n\nexport { useReviewWorkflows };\n","export type DragDropTypes = 'stage';\n\nexport const DRAG_DROP_TYPES: Record<Uppercase<DragDropTypes>, DragDropTypes> = {\n STAGE: 'stage',\n};\n","import { Flex, Typography } from '@strapi/design-system';\nimport { CaretDown } from '@strapi/icons';\n\ninterface StageDragPreviewType {\n name: string | null;\n}\n\nconst StageDragPreview = ({ name }: StageDragPreviewType) => {\n return (\n <Flex\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n gap={3}\n hasRadius\n padding={3}\n shadow=\"tableShadow\"\n width=\"30rem\"\n >\n <Flex\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" fill=\"neutral600\" />\n </Flex>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box } from '@strapi/design-system';\nimport { XYCoord, useDragLayer } from 'react-dnd';\nimport { useIntl } from 'react-intl';\n\nimport { DRAG_DROP_TYPES } from '../constants';\n\nimport { StageDragPreview } from './StageDragPreview';\n\nfunction getStyle(\n initialOffset: XYCoord | null,\n currentOffset: XYCoord | null,\n mouseOffset: XYCoord | null\n) {\n if (!initialOffset || !currentOffset || !mouseOffset) {\n return { display: 'none' };\n }\n\n const { x, y } = mouseOffset;\n\n return {\n transform: `translate(${x}px, ${y}px)`,\n };\n}\n\nconst DragLayerRendered = () => {\n const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(\n (monitor) => ({\n item: monitor.getItem(),\n itemType: monitor.getItemType(),\n initialOffset: monitor.getInitialSourceClientOffset(),\n currentOffset: monitor.getSourceClientOffset(),\n isDragging: monitor.isDragging(),\n mouseOffset: monitor.getClientOffset(),\n })\n );\n\n if (!isDragging || itemType !== DRAG_DROP_TYPES.STAGE) {\n return null;\n }\n\n return (\n <Box\n height=\"100%\"\n left={0}\n position=\"fixed\"\n pointerEvents=\"none\"\n top={0}\n zIndex={100}\n width=\"100%\"\n >\n <Box style={getStyle(initialOffset, currentOffset, mouseOffset)}>\n <StageDragPreview name={typeof item.item === 'string' ? item.item : null} />;\n </Box>\n </Box>\n );\n};\n\nconst Root: React.FC<React.PropsWithChildren> = ({ children }) => {\n return (\n <Page.Main>\n <Layouts.Content>{children}</Layouts.Content>\n </Page.Main>\n );\n};\n\ninterface HeaderProps {\n title: string;\n navigationAction?: React.ReactNode;\n primaryAction?: React.ReactNode;\n secondaryAction?: React.ReactNode;\n subtitle?: React.ReactNode;\n}\n\nconst Header: React.FC<HeaderProps> = ({ title, subtitle, navigationAction, primaryAction }) => {\n const { formatMessage } = useIntl();\n return (\n <>\n <Page.Title>\n {formatMessage(\n { id: 'Settings.PageTitle', defaultMessage: 'Settings - {name}' },\n {\n name: title,\n }\n )}\n </Page.Title>\n <Layouts.BaseHeader\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["useNotification","useIntl","useAPIErrorHandler","useGetWorkflowsQuery","React","useCreateWorkflowMutation","data","useUpdateWorkflowMutation","useDeleteWorkflowMutation","jsxs","Flex","jsx","CaretDown","Typography","useDragLayer","Box","Page","Layouts","Fragment"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAM,+BAA+B;AAAA,EACnC,IAAI;AAAA,EACJ,gBAAgB;AAClB;AAMA,MAAM,qBAAqB,CAAC,SAAiC,OAAO;AAC5D,QAAA,EAAE,uBAAuBA,YAAAA;AACzB,QAAA,EAAE,kBAAkBC,UAAAA;AAC1B,QAAM,EAAE,yBAAyB,eAAe,IAAIC,YAAmB,mBAAA;AAEvE,QAAM,EAAE,OAAO,OAAO,GAAG,gBAAgB;AAEzC,QAAM,EAAE,MAAM,WAAW,MAAU,IAAAC,MAAA;AAAA,IACjC;AAAA,MACE,UAAU,CAAC,UAAU,wBAAwB;AAAA,MAC7C,GAA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AAM;AAAA,MAEN,0CAACA,aAAI,KAAA,EAAA,OAAO,SAAS,eAAe,eAAe,WAAW,GAC5D,UAAA;AAAA,QAACJ,2BAAAA,IAAA,kBAAA,EAAiB,MAAM,OAAO,KAAK,SAAS,WAAW,KAAK,OAAO,MAAM;AAAA,QAAE;AAAA,MAAA,GAC9E;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,OAA0C,CAAC,EAAE,eAAe;AAE9D,SAAAA,+BAACK,YAAAA,KAAK,MAAL,EACC,yCAACC,YAAQ,QAAA,SAAR,EAAiB,SAAS,CAAA,EAC7B,CAAA;AAEJ;AAUA,MAAM,SAAgC,CAAC,EAAE,OAAO,UAAU,kBAAkB,oBAAoB;AACxF,QAAA,EAAE,kBAAkBhB,UAAAA;AAC1B,SAEIQ,2BAAA,KAAAS,qBAAA,EAAA,UAAA;AAAA,IAACP,2BAAAA,IAAAK,YAAA,KAAK,OAAL,EACE,UAAA;AAAA,MACC,EAAE,IAAI,sBAAsB,gBAAgB,oBAAoB;AAAA,MAChE;AAAA,QACE,MAAM;AAAA,MACR;AAAA,IAAA,GAEJ;AAAA,IACAL,2BAAA;AAAA,MAACM,YAAAA,QAAQ;AAAA,MAAR;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;;;;;;"}
@@ -6,7 +6,10 @@ const en = {
6
6
  "settings.page.isLoading": "Workflow is loading",
7
7
  "settings.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the previous stage. Are you sure you want to save?",
8
8
  "settings.stage.name.label": "Stage name",
9
- "settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows."
9
+ "settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows.",
10
+ "settings.review-workflows.workflow.stageRequiredToPublish.label": "Required stage for publishing",
11
+ "settings.review-workflows.workflow.stageRequiredToPublish.any": "Any stage",
12
+ "settings.review-workflows.workflow.stageRequiredToPublish.hint": "Prevents entries from being published if they are not at the required stage."
10
13
  };
11
14
  exports.default = en;
12
- //# sourceMappingURL=en-xcewH2pC.js.map
15
+ //# sourceMappingURL=en-CYgjfSep.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-CYgjfSep.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
@@ -4,9 +4,12 @@ const en = {
4
4
  "settings.page.isLoading": "Workflow is loading",
5
5
  "settings.page.delete.confirm.body": "All entries assigned to deleted stages will be moved to the previous stage. Are you sure you want to save?",
6
6
  "settings.stage.name.label": "Stage name",
7
- "settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows."
7
+ "settings.not-available": "Review Workflows is only available as part of the Enterprise Edition. Upgrade to create and manage workflows.",
8
+ "settings.review-workflows.workflow.stageRequiredToPublish.label": "Required stage for publishing",
9
+ "settings.review-workflows.workflow.stageRequiredToPublish.any": "Any stage",
10
+ "settings.review-workflows.workflow.stageRequiredToPublish.hint": "Prevents entries from being published if they are not at the required stage."
8
11
  };
9
12
  export {
10
13
  en as default
11
14
  };
12
- //# sourceMappingURL=en-D9ZrQAV6.mjs.map
15
+ //# sourceMappingURL=en-D9dxziEb.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-D9dxziEb.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
@@ -8,11 +8,10 @@ const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const fractionalIndexing = require("fractional-indexing");
10
10
  const reactIntl = require("react-intl");
11
- const reactRedux = require("react-redux");
12
11
  const reactRouterDom = require("react-router-dom");
13
12
  const yup = require("yup");
14
- const index = require("./index-D-KMrml_.js");
15
- const Layout = require("./Layout-BWzD-Tfe.js");
13
+ const index = require("./index-BX5MyocW.js");
14
+ const Layout = require("./Layout-BWNbQOes.js");
16
15
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
17
16
  const styledComponents = require("styled-components");
18
17
  const reactDnd = require("react-dnd");
@@ -313,35 +312,23 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating }) => {
313
312
  left: "50%",
314
313
  position: "absolute",
315
314
  top: "0",
316
- width: 2,
317
- zIndex: 1
315
+ width: 2
318
316
  }
319
317
  ),
320
- /* @__PURE__ */ jsxRuntime.jsx(
321
- designSystem.Flex,
322
- {
323
- direction: "column",
324
- alignItems: "stretch",
325
- gap: 6,
326
- zIndex: 2,
327
- position: "relative",
328
- tag: "ol",
329
- children: stages.map((stage, index2) => {
330
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
331
- Stage,
332
- {
333
- index: index2,
334
- canDelete: stages.length > 1 && canDelete,
335
- canReorder: stages.length > 1,
336
- canUpdate,
337
- stagesCount: stages.length,
338
- defaultOpen: isCreating,
339
- ...stage
340
- }
341
- ) }, stage.__temp_key__);
342
- })
343
- }
344
- )
318
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", tag: "ol", children: stages.map((stage, index2) => {
319
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
320
+ Stage,
321
+ {
322
+ index: index2,
323
+ canDelete: stages.length > 1 && canDelete,
324
+ canReorder: stages.length > 1,
325
+ canUpdate,
326
+ stagesCount: stages.length,
327
+ defaultOpen: !stage.id,
328
+ ...stage
329
+ }
330
+ ) }, stage.__temp_key__);
331
+ }) })
345
332
  ] }),
346
333
  canUpdate && /* @__PURE__ */ jsxRuntime.jsx(
347
334
  AddStage,
@@ -509,7 +496,7 @@ const Stage = ({
509
496
  {
510
497
  background: "transparent",
511
498
  hasRadius: true,
512
- borderWidth: 0,
499
+ variant: "ghost",
513
500
  "data-handler-id": handlerId,
514
501
  ref: dragRef,
515
502
  label: formatMessage({
@@ -561,7 +548,7 @@ const Stage = ({
561
548
  size: 6,
562
549
  type: "permissions"
563
550
  }
564
- ].map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, children: /* @__PURE__ */ jsxRuntime.jsx(InputRenderer, { ...field }) }, field.name)) }) })
551
+ ].map(({ size, ...field }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(InputRenderer, { ...field }) }, field.name)) }) })
565
552
  ] })
566
553
  }
567
554
  )
@@ -666,20 +653,22 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
666
653
  const { value = [], error, onChange } = strapiAdmin.useField(name);
667
654
  const allStages = strapiAdmin.useForm("PermissionsField", (state) => state.values.stages);
668
655
  const onFormValueChange = strapiAdmin.useForm("PermissionsField", (state) => state.onChange);
669
- const { data: roles = [], isLoading } = useGetAdminRolesQuery();
656
+ const rolesErrorCount = React__namespace.useRef(0);
657
+ const { data: roles = [], isLoading, error: getRolesError } = useGetAdminRolesQuery();
670
658
  const filteredRoles = roles?.filter((role) => role.code !== "strapi-super-admin") ?? [];
671
659
  React__namespace.useEffect(() => {
672
- if (!isLoading && roles.length === 0) {
660
+ if (!isLoading && getRolesError && "status" in getRolesError && getRolesError.status == 403 && rolesErrorCount.current === 0) {
661
+ rolesErrorCount.current = 1;
673
662
  toggleNotification({
674
663
  blockTransition: true,
675
664
  type: "danger",
676
665
  message: formatMessage({
677
666
  id: "review-workflows.stage.permissions.noPermissions.description",
678
- defaultMessage: "You don’t have the permission to see roles"
667
+ defaultMessage: "You don’t have the permission to see roles. Contact your administrator."
679
668
  })
680
669
  });
681
670
  }
682
- }, [formatMessage, isLoading, roles, toggleNotification]);
671
+ }, [formatMessage, isLoading, roles, toggleNotification, getRolesError]);
683
672
  if (!isLoading && filteredRoles.length === 0) {
684
673
  return /* @__PURE__ */ jsxRuntime.jsxs(
685
674
  designSystem.Field.Root,
@@ -760,7 +749,6 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
760
749
  defaultMessage: "Apply to all stages"
761
750
  }),
762
751
  size: "L",
763
- variant: "secondary",
764
752
  children: /* @__PURE__ */ jsxRuntime.jsx(icons.Duplicate, {})
765
753
  }
766
754
  ) }),
@@ -805,7 +793,7 @@ const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
805
793
  const WorkflowAttributes = ({ canUpdate = true }) => {
806
794
  const { formatMessage } = reactIntl.useIntl();
807
795
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Grid.Root, { background: "neutral0", hasRadius: true, gap: 4, padding: 6, shadow: "tableShadow", children: [
808
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
796
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(
809
797
  strapiAdmin.InputRenderer,
810
798
  {
811
799
  disabled: !canUpdate,
@@ -818,7 +806,8 @@ const WorkflowAttributes = ({ canUpdate = true }) => {
818
806
  type: "string"
819
807
  }
820
808
  ) }),
821
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, children: /* @__PURE__ */ jsxRuntime.jsx(ContentTypesSelector, { disabled: !canUpdate }) })
809
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(ContentTypesSelector, { disabled: !canUpdate }) }),
810
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 6, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(StageSelector, { disabled: !canUpdate }) })
822
811
  ] });
823
812
  };
824
813
  const ContentTypesSelector = ({ disabled }) => {
@@ -922,15 +911,63 @@ const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
922
911
  const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
923
912
  font-style: italic;
924
913
  `;
914
+ const StageSelector = ({ disabled }) => {
915
+ const { value: stages = [] } = strapiAdmin.useField("stages");
916
+ const { formatMessage } = reactIntl.useIntl();
917
+ const { error, value, onChange } = strapiAdmin.useField("stageRequiredToPublish");
918
+ const validStages = stages.filter((stage) => stage.name);
919
+ return /* @__PURE__ */ jsxRuntime.jsxs(
920
+ designSystem.Field.Root,
921
+ {
922
+ error,
923
+ name: "stageRequiredToPublish",
924
+ hint: formatMessage({
925
+ id: "settings.review-workflows.workflow.stageRequiredToPublish.hint",
926
+ defaultMessage: "Prevents entries from being published if they are not at the required stage."
927
+ }),
928
+ children: [
929
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
930
+ id: "settings.review-workflows.workflow.stageRequiredToPublish.label",
931
+ defaultMessage: "Required stage for publishing"
932
+ }) }),
933
+ /* @__PURE__ */ jsxRuntime.jsxs(
934
+ designSystem.SingleSelect,
935
+ {
936
+ disabled,
937
+ onChange: (value2) => {
938
+ onChange("stageRequiredToPublish", value2);
939
+ },
940
+ value,
941
+ children: [
942
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "", children: formatMessage({
943
+ id: "settings.review-workflows.workflow.stageRequiredToPublish.any",
944
+ defaultMessage: "Any stage"
945
+ }) }),
946
+ validStages.map((stage, i) => /* @__PURE__ */ jsxRuntime.jsx(
947
+ designSystem.SingleSelectOption,
948
+ {
949
+ value: stage.id?.toString() || stage.__temp_key__,
950
+ children: stage.name
951
+ },
952
+ `requiredToPublishStage-${stage.id || stage.__temp_key__}`
953
+ ))
954
+ ]
955
+ }
956
+ ),
957
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
958
+ ]
959
+ }
960
+ );
961
+ };
925
962
  const WORKFLOW_SCHEMA = yup__namespace.object({
926
963
  contentTypes: yup__namespace.array().of(yup__namespace.string()),
927
964
  name: yup__namespace.string().max(255, {
928
965
  id: "review-workflows.validation.name.max-length",
929
966
  defaultMessage: "Name can not be longer than 255 characters"
930
- }).required(),
967
+ }).required().nullable(),
931
968
  stages: yup__namespace.array().of(
932
969
  yup__namespace.object().shape({
933
- name: yup__namespace.string().required({
970
+ name: yup__namespace.string().nullable().required({
934
971
  id: "review-workflows.validation.stage.name",
935
972
  defaultMessage: "Name is required"
936
973
  }).max(255, {
@@ -947,7 +984,7 @@ const WORKFLOW_SCHEMA = yup__namespace.object({
947
984
  return stages.filter((stage) => stage.name === stageName).length === 1;
948
985
  }
949
986
  ),
950
- color: yup__namespace.string().required({
987
+ color: yup__namespace.string().nullable().required({
951
988
  id: "review-workflows.validation.stage.color",
952
989
  defaultMessage: "Color is required"
953
990
  }).matches(/^#(?:[0-9a-fA-F]{3}){1,2}$/i),
@@ -964,7 +1001,8 @@ const WORKFLOW_SCHEMA = yup__namespace.object({
964
1001
  })
965
1002
  ).strict()
966
1003
  })
967
- ).min(1)
1004
+ ).min(1),
1005
+ stageRequiredToPublish: yup__namespace.string().nullable()
968
1006
  });
969
1007
  const EditPage = () => {
970
1008
  const { id = "" } = reactRouterDom.useParams();
@@ -973,7 +1011,6 @@ const EditPage = () => {
973
1011
  const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
974
1012
  const navigate = reactRouterDom.useNavigate();
975
1013
  const { toggleNotification } = strapiAdmin.useNotification();
976
- const dispatch = reactRedux.useDispatch();
977
1014
  const {
978
1015
  isLoading: isLoadingWorkflow,
979
1016
  meta,
@@ -981,7 +1018,7 @@ const EditPage = () => {
981
1018
  error,
982
1019
  update,
983
1020
  create
984
- } = Layout.useReviewWorkflows({ id: isCreatingWorkflow ? void 0 : id });
1021
+ } = Layout.useReviewWorkflows();
985
1022
  const permissions = index.useTypedSelector(
986
1023
  (state) => state.admin_app.permissions["settings"]?.["review-workflows"]
987
1024
  );
@@ -998,13 +1035,17 @@ const EditPage = () => {
998
1035
  const stagesPerWorkflow = limits?.[index.CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME];
999
1036
  const submitForm = async (data, helpers) => {
1000
1037
  try {
1038
+ const { stageRequiredToPublish, ...rest } = data;
1039
+ const stageRequiredToPublishName = stageRequiredToPublish === "" ? null : rest.stages.find(
1040
+ (stage) => stage.id === Number(stageRequiredToPublish) || stage.__temp_key__ === stageRequiredToPublish
1041
+ )?.name;
1001
1042
  if (!isCreatingWorkflow) {
1002
1043
  const res = await update(id, {
1003
- ...data,
1044
+ ...rest,
1004
1045
  // compare permissions of stages and only submit them if at least one has
1005
1046
  // changed; this enables partial updates e.g. for users who don't have
1006
1047
  // permissions to see roles
1007
- stages: data.stages.map((stage) => {
1048
+ stages: rest.stages.map((stage) => {
1008
1049
  let hasUpdatedPermissions = true;
1009
1050
  const serverStage = currentWorkflow?.stages?.find(
1010
1051
  (serverStage2) => serverStage2.id === stage?.id
@@ -1020,40 +1061,21 @@ const EditPage = () => {
1020
1061
  ...stage,
1021
1062
  permissions: hasUpdatedPermissions ? stage.permissions : void 0
1022
1063
  };
1023
- })
1064
+ }),
1065
+ stageRequiredToPublishName
1024
1066
  });
1025
1067
  if ("error" in res && index.isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1026
1068
  helpers.setErrors(formatValidationErrors(res.error));
1027
- } else if ("data" in res) {
1028
- for (const uid of res.data.contentTypes) {
1029
- dispatch({
1030
- type: "contentManagerApi/invalidateTags",
1031
- payload: [
1032
- {
1033
- type: "ContentTypesConfiguration",
1034
- id: uid
1035
- }
1036
- ]
1037
- });
1038
- }
1039
1069
  }
1040
1070
  } else {
1041
- const res = await create(data);
1071
+ const res = await create({
1072
+ ...rest,
1073
+ stageRequiredToPublishName
1074
+ });
1042
1075
  if ("error" in res && index.isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1043
1076
  helpers.setErrors(formatValidationErrors(res.error));
1044
1077
  } else if ("data" in res) {
1045
- for (const uid of res.data.contentTypes) {
1046
- dispatch({
1047
- type: "contentManagerApi/invalidateTags",
1048
- payload: [
1049
- {
1050
- type: "ContentTypesConfiguration",
1051
- id: uid
1052
- }
1053
- ]
1054
- });
1055
- }
1056
- navigate(`../${res.data.id}`);
1078
+ navigate(`../${res.data.id}`, { replace: true });
1057
1079
  }
1058
1080
  }
1059
1081
  } catch (error2) {
@@ -1117,13 +1139,15 @@ const EditPage = () => {
1117
1139
  return {
1118
1140
  name: "",
1119
1141
  stages: [],
1120
- contentTypes: []
1142
+ contentTypes: [],
1143
+ stageRequiredToPublish: ""
1121
1144
  };
1122
1145
  } else {
1123
1146
  return {
1124
1147
  name: currentWorkflow.name,
1125
1148
  stages: addTmpKeysToStages(currentWorkflow.stages),
1126
- contentTypes: currentWorkflow.contentTypes
1149
+ contentTypes: currentWorkflow.contentTypes,
1150
+ stageRequiredToPublish: currentWorkflow.stageRequiredToPublish?.id.toString() ?? ""
1127
1151
  };
1128
1152
  }
1129
1153
  }, [currentWorkflow, isCreatingWorkflow]);
@@ -1152,7 +1176,6 @@ const EditPage = () => {
1152
1176
  {
1153
1177
  startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.Check, {}),
1154
1178
  type: "submit",
1155
- size: "M",
1156
1179
  disabled: !modified || isSubmitting || values.stages.length === 0,
1157
1180
  loading: !Boolean(Object.keys(savePrompts).length > 0) && isSubmitting,
1158
1181
  children: formatMessage({
@@ -1175,12 +1198,12 @@ const EditPage = () => {
1175
1198
  }
1176
1199
  ),
1177
1200
  /* @__PURE__ */ jsxRuntime.jsx(Layout.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "stretch", direction: "column", gap: 7, children: [
1178
- /* @__PURE__ */ jsxRuntime.jsx(WorkflowAttributes, { canUpdate }),
1201
+ /* @__PURE__ */ jsxRuntime.jsx(WorkflowAttributes, { canUpdate: canUpdate || canCreate }),
1179
1202
  /* @__PURE__ */ jsxRuntime.jsx(
1180
1203
  Stages,
1181
1204
  {
1182
1205
  canDelete,
1183
- canUpdate,
1206
+ canUpdate: canUpdate || canCreate,
1184
1207
  isCreating: isCreatingWorkflow
1185
1208
  }
1186
1209
  )
@@ -1202,7 +1225,7 @@ const EditPage = () => {
1202
1225
  },
1203
1226
  {
1204
1227
  count: contentTypesFromOtherWorkflows?.filter(
1205
- (contentType) => currentWorkflow?.contentTypes?.includes(contentType)
1228
+ (contentType) => values.contentTypes.includes(contentType)
1206
1229
  ).length ?? 0
1207
1230
  }
1208
1231
  ) }),
@@ -1271,4 +1294,4 @@ const ProtectedEditPage = () => {
1271
1294
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
1272
1295
  };
1273
1296
  exports.ProtectedEditPage = ProtectedEditPage;
1274
- //# sourceMappingURL=_id-CoX9yljN.js.map
1297
+ //# sourceMappingURL=id-CaHzMdxL.js.map