@strapi/review-workflows 5.0.0-beta.5 → 5.0.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Layout-dGg4FA1R.js → Layout-2ZuobDLm.js} +4 -4
- package/dist/_chunks/Layout-2ZuobDLm.js.map +1 -0
- package/dist/_chunks/{Layout-facLKucY.mjs → Layout-BlUjTO46.mjs} +5 -5
- package/dist/_chunks/Layout-BlUjTO46.mjs.map +1 -0
- package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-BuJ0Ud8T.mjs} +11 -51
- package/dist/_chunks/_id-BuJ0Ud8T.mjs.map +1 -0
- package/dist/_chunks/{_id-B6DgrtpA.js → _id-yjWLof5q.js} +15 -55
- package/dist/_chunks/_id-yjWLof5q.js.map +1 -0
- package/dist/_chunks/{index-BuKZWpJw.js → index-CQGgid_7.js} +14 -20
- package/dist/_chunks/index-CQGgid_7.js.map +1 -0
- package/dist/_chunks/{index-D7Y0ofdg.mjs → index-D91cCzpN.mjs} +6 -7
- package/dist/_chunks/index-D91cCzpN.mjs.map +1 -0
- package/dist/_chunks/{index-DX8AGcIP.js → index-qAnk2xH9.js} +7 -8
- package/dist/_chunks/index-qAnk2xH9.js.map +1 -0
- package/dist/_chunks/{index-QbWLXdZR.mjs → index-sU2Cg2WW.mjs} +13 -19
- package/dist/_chunks/index-sU2Cg2WW.mjs.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-BaOk5p_m.js} +4 -4
- package/dist/_chunks/purchase-review-workflows-BaOk5p_m.js.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-B-V0sA2I.mjs → purchase-review-workflows-DyffLpyz.mjs} +5 -5
- package/dist/_chunks/purchase-review-workflows-DyffLpyz.mjs.map +1 -0
- package/dist/_chunks/{router-ylD0eA48.mjs → router-DkLtLJRZ.mjs} +3 -3
- package/dist/_chunks/{router-ylD0eA48.mjs.map → router-DkLtLJRZ.mjs.map} +1 -1
- package/dist/_chunks/{router-CL62NScV.js → router-n4oxCWpr.js} +3 -3
- package/dist/_chunks/{router-CL62NScV.js.map → router-n4oxCWpr.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +1 -1
- package/dist/admin/src/services/content-manager.d.ts +1 -1
- package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
- package/package.json +9 -9
- package/dist/_chunks/Layout-dGg4FA1R.js.map +0 -1
- package/dist/_chunks/Layout-facLKucY.mjs.map +0 -1
- package/dist/_chunks/_id-B6DgrtpA.js.map +0 -1
- package/dist/_chunks/_id-D4CXKOqG.mjs.map +0 -1
- package/dist/_chunks/index-BuKZWpJw.js.map +0 -1
- package/dist/_chunks/index-D7Y0ofdg.mjs.map +0 -1
- package/dist/_chunks/index-DX8AGcIP.js.map +0 -1
- package/dist/_chunks/index-QbWLXdZR.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +0 -1
|
@@ -2,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-
|
|
5
|
+
const index = require("./index-qAnk2xH9.js");
|
|
6
6
|
const jsxRuntime = require("react/jsx-runtime");
|
|
7
7
|
const designSystem = require("@strapi/design-system");
|
|
8
8
|
const reactDnd = require("react-dnd");
|
|
@@ -165,7 +165,7 @@ const StageDragPreview = ({ name }) => {
|
|
|
165
165
|
hasRadius: true,
|
|
166
166
|
padding: 3,
|
|
167
167
|
shadow: "tableShadow",
|
|
168
|
-
width:
|
|
168
|
+
width: "30rem",
|
|
169
169
|
children: [
|
|
170
170
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
171
171
|
Toggle,
|
|
@@ -176,7 +176,7 @@ const StageDragPreview = ({ name }) => {
|
|
|
176
176
|
height: 6,
|
|
177
177
|
justifyContent: "center",
|
|
178
178
|
width: 6,
|
|
179
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(icons.
|
|
179
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, { width: "0.8rem" })
|
|
180
180
|
}
|
|
181
181
|
),
|
|
182
182
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: name })
|
|
@@ -257,4 +257,4 @@ exports.DragLayerRendered = DragLayerRendered;
|
|
|
257
257
|
exports.Header = Header;
|
|
258
258
|
exports.Root = Root;
|
|
259
259
|
exports.useReviewWorkflows = useReviewWorkflows;
|
|
260
|
-
//# sourceMappingURL=Layout-
|
|
260
|
+
//# sourceMappingURL=Layout-2ZuobDLm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout-2ZuobDLm.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 { id = '', skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n id,\n populate: 'stages',\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';\nimport styled from 'styled-components';\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 <Toggle\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" />\n </Toggle>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nconst Toggle = styled(Flex)`\n svg path {\n fill: ${({ theme }) => theme.colors.neutral600};\n }\n`;\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page } from '@strapi/admin/strapi-admin';\nimport { Box, ContentLayout, HeaderLayout } 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 <ContentLayout>{children}</ContentLayout>\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 <HeaderLayout\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","id","useDeleteWorkflowMutation","jsxs","Flex","jsx","CaretDown","Typography","styled","useDragLayer","Box","Page","ContentLayout","Fragment","HeaderLayout"],"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,KAAK,IAAI,OAAO,OAAO,GAAG,YAAgB,IAAA;AAElD,QAAM,EAAE,MAAM,WAAW,MAAU,IAAAC,MAAA;AAAA,IACjC;AAAA,MACE;AAAA,MACA,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,IACF;AAAA,EAAA;AAGFC,mBAAM,UAAU,MAAM;AACpB,QAAI,OAAO;AACU,yBAAA;AAAA,QACjB,MAAM;AAAA,QACN,SAAS,eAAe,KAAK;AAAA,MAAA,CAC9B;AAAA,IACH;AAAA,EACC,GAAA,CAAC,OAAO,gBAAgB,kBAAkB,CAAC;AAExC,QAAA,CAAC,cAAc,IAAIC,MAAAA;AACzB,QAAM,SAASD,iBAAM;AAAA,IACnB,OAAOE,UAAyC;AAC1C,UAAA;AACF,cAAM,MAAM,MAAM,eAAe,EAAE,MAAAA,MAAM,CAAA;AAEzC,YAAI,WAAW,KAAK;AACC,6BAAA;AAAA,YACjB,MAAM;AAAA,YACN,SAAS,eAAe,IAAI,KAAK;AAAA,UAAA,CAClC;AAEM,iBAAA;AAAA,QACT;AAEmB,2BAAA;AAAA,UACjB,MAAM;AAAA,UACN,SAAS,cAAc,EAAE,IAAI,mBAAmB,gBAAgB,oBAAoB;AAAA,QAAA,CACrF;AAEM,eAAA;AAAA,eACA,KAAK;AACO,2BAAA;AAAA,UACjB,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ACE,UAAA;AAAA,MACC,EAAE,IAAI,sBAAsB,gBAAgB,oBAAoB;AAAA,MAChE;AAAA,QACE,MAAM;AAAA,MACR;AAAA,IAAA,GAEJ;AAAA,IACAN,2BAAA;AAAA,MAACS,aAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { useNotification, useAPIErrorHandler, Page } 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-
|
|
4
|
+
import { c as useGetWorkflowsQuery, d as useCreateWorkflowMutation, e as useUpdateWorkflowMutation, f as useDeleteWorkflowMutation } from "./index-D91cCzpN.mjs";
|
|
5
5
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
6
6
|
import { Flex, Typography, ContentLayout, HeaderLayout, Box } from "@strapi/design-system";
|
|
7
7
|
import { useDragLayer } from "react-dnd";
|
|
8
|
-
import {
|
|
8
|
+
import { CaretDown } from "@strapi/icons";
|
|
9
9
|
import styled from "styled-components";
|
|
10
10
|
const DEFAULT_UNEXPECTED_ERROR_MSG = {
|
|
11
11
|
id: "notification.error",
|
|
@@ -143,7 +143,7 @@ const StageDragPreview = ({ name }) => {
|
|
|
143
143
|
hasRadius: true,
|
|
144
144
|
padding: 3,
|
|
145
145
|
shadow: "tableShadow",
|
|
146
|
-
width:
|
|
146
|
+
width: "30rem",
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ jsx(
|
|
149
149
|
Toggle,
|
|
@@ -154,7 +154,7 @@ const StageDragPreview = ({ name }) => {
|
|
|
154
154
|
height: 6,
|
|
155
155
|
justifyContent: "center",
|
|
156
156
|
width: 6,
|
|
157
|
-
children: /* @__PURE__ */ jsx(
|
|
157
|
+
children: /* @__PURE__ */ jsx(CaretDown, { width: "0.8rem" })
|
|
158
158
|
}
|
|
159
159
|
),
|
|
160
160
|
/* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: name })
|
|
@@ -237,4 +237,4 @@ export {
|
|
|
237
237
|
DragLayerRendered as a,
|
|
238
238
|
useReviewWorkflows as u
|
|
239
239
|
};
|
|
240
|
-
//# sourceMappingURL=Layout-
|
|
240
|
+
//# sourceMappingURL=Layout-BlUjTO46.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Layout-BlUjTO46.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 { id = '', skip = false, ...queryParams } = params;\n\n const { data, isLoading, error } = useGetWorkflowsQuery(\n {\n id,\n populate: 'stages',\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';\nimport styled from 'styled-components';\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 <Toggle\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CaretDown width=\"0.8rem\" />\n </Toggle>\n\n <Typography fontWeight=\"bold\">{name}</Typography>\n </Flex>\n );\n};\n\nconst Toggle = styled(Flex)`\n svg path {\n fill: ${({ theme }) => theme.colors.neutral600};\n }\n`;\n\nexport { StageDragPreview };\nexport type { StageDragPreviewType };\n","import * as React from 'react';\n\nimport { Page } from '@strapi/admin/strapi-admin';\nimport { Box, ContentLayout, HeaderLayout } 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 <ContentLayout>{children}</ContentLayout>\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 <HeaderLayout\n navigationAction={navigationAction}\n primaryAction={primaryAction}\n title={title}\n subtitle={subtitle}\n />\n </>\n );\n};\n\nexport { DragLayerRendered, Header, Root };\n"],"names":["data","id"],"mappings":";;;;;;;;;AAeA,MAAM,+BAA+B;AAAA,EACnC,IAAI;AAAA,EACJ,gBAAgB;AAClB;AAMA,MAAM,qBAAqB,CAAC,SAAiC,OAAO;AAC5D,QAAA,EAAE,uBAAuB;AACzB,QAAA,EAAE,kBAAkB;AAC1B,QAAM,EAAE,yBAAyB,eAAe,IAAI,mBAAmB;AAEvE,QAAM,EAAE,KAAK,IAAI,OAAO,OAA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;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;AAChE,6BACG,KAAK,MAAL,EACC,UAAC,oBAAA,eAAA,EAAe,UAAS,EAC3B,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;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AAEJ;"}
|
|
@@ -2,16 +2,15 @@ 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";
|
|
5
|
+
import { Box, Typography, Flex, MenuItem, Menu, IconButton, MultiSelectOption, useComposedRefs, VisuallyHidden, Accordion, AccordionToggle, AccordionContent, Grid, GridItem, SingleSelect, SingleSelectOption, TextInput, MultiSelect, MultiSelectGroup, useCollator, Button } from "@strapi/design-system";
|
|
6
6
|
import { PlusCircle, EyeStriked, More, Drag, Duplicate, Check } from "@strapi/icons";
|
|
7
7
|
import { generateNKeysBetween } from "fractional-indexing";
|
|
8
8
|
import { useIntl } from "react-intl";
|
|
9
9
|
import { useDispatch } from "react-redux";
|
|
10
10
|
import { useParams, useNavigate } from "react-router-dom";
|
|
11
11
|
import * as yup from "yup";
|
|
12
|
-
import { r as reviewWorkflowsApi, A as AVAILABLE_COLORS, g as getStageColorByHex, u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, b as CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal, i as isBaseQueryError } from "./index-
|
|
13
|
-
import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-
|
|
14
|
-
import { MenuItem, Menu } from "@strapi/design-system/v2";
|
|
12
|
+
import { r as reviewWorkflowsApi, A as AVAILABLE_COLORS, g as getStageColorByHex, u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, b as CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal, i as isBaseQueryError } from "./index-D91cCzpN.mjs";
|
|
13
|
+
import { D as DRAG_DROP_TYPES, u as useReviewWorkflows, a as DragLayerRendered, H as Header, R as Root } from "./Layout-BlUjTO46.mjs";
|
|
15
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
|
16
15
|
import styled from "styled-components";
|
|
17
16
|
import { useDrop, useDrag } from "react-dnd";
|
|
@@ -258,62 +257,23 @@ const AddStage = ({ children, ...props }) => {
|
|
|
258
257
|
paddingTop: 3,
|
|
259
258
|
shadow: "filterShadow",
|
|
260
259
|
...props,
|
|
261
|
-
children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
262
|
-
/* @__PURE__ */ jsx(
|
|
263
|
-
|
|
264
|
-
] })
|
|
260
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", textColor: "inherit", children: /* @__PURE__ */ jsxs(Flex, { as: "span", gap: 2, children: [
|
|
261
|
+
/* @__PURE__ */ jsx(PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
|
|
262
|
+
children
|
|
263
|
+
] }) })
|
|
265
264
|
}
|
|
266
265
|
);
|
|
267
266
|
};
|
|
268
|
-
const StyledAddIcon = styled(PlusCircle)`
|
|
269
|
-
> circle {
|
|
270
|
-
fill: ${({ theme }) => theme.colors.neutral150};
|
|
271
|
-
}
|
|
272
|
-
> path {
|
|
273
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
274
|
-
}
|
|
275
|
-
`;
|
|
276
267
|
const StyledButton = styled(Box)`
|
|
277
268
|
border-radius: 26px;
|
|
278
|
-
|
|
279
|
-
svg {
|
|
280
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
281
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
282
|
-
|
|
283
|
-
> path {
|
|
284
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
285
|
-
}
|
|
286
|
-
}
|
|
269
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
287
270
|
|
|
288
271
|
&:hover {
|
|
289
|
-
color: ${({ theme }) => theme.colors.primary600}
|
|
290
|
-
${Typography} {
|
|
291
|
-
color: ${({ theme }) => theme.colors.primary600} !important;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
${StyledAddIcon} {
|
|
295
|
-
> circle {
|
|
296
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
297
|
-
}
|
|
298
|
-
> path {
|
|
299
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
300
|
-
}
|
|
301
|
-
}
|
|
272
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
302
273
|
}
|
|
303
274
|
|
|
304
275
|
&:active {
|
|
305
|
-
${
|
|
306
|
-
color: ${({ theme }) => theme.colors.primary600};
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
${StyledAddIcon} {
|
|
310
|
-
> circle {
|
|
311
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
312
|
-
}
|
|
313
|
-
> path {
|
|
314
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
315
|
-
}
|
|
316
|
-
}
|
|
276
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
317
277
|
}
|
|
318
278
|
`;
|
|
319
279
|
const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
@@ -1308,4 +1268,4 @@ const ProtectedEditPage = () => {
|
|
|
1308
1268
|
export {
|
|
1309
1269
|
ProtectedEditPage
|
|
1310
1270
|
};
|
|
1311
|
-
//# sourceMappingURL=_id-
|
|
1271
|
+
//# sourceMappingURL=_id-BuJ0Ud8T.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_id-BuJ0Ud8T.mjs","sources":["../../admin/src/services/admin.ts","../../admin/src/routes/settings/hooks/useKeyboardDragAndDrop.ts","../../admin/src/routes/settings/hooks/useDragAndDrop.ts","../../admin/src/routes/settings/components/AddStage.tsx","../../admin/src/routes/settings/components/Stages.tsx","../../admin/src/routes/settings/components/WorkflowAttributes.tsx","../../admin/src/routes/settings/:id.tsx"],"sourcesContent":["import { SanitizedAdminUser } from '@strapi/admin/strapi-admin';\n\nimport { reviewWorkflowsApi } from './api';\n\ntype Roles = SanitizedAdminUser['roles'];\ntype RolesResponse = { data: Roles };\n\nconst adminApi = reviewWorkflowsApi.injectEndpoints({\n endpoints(builder) {\n return {\n getRoles: builder.query<Roles, void>({\n query: () => ({\n url: `/admin/roles`,\n method: 'GET',\n }),\n transformResponse: (res: RolesResponse) => {\n return res.data;\n },\n }),\n };\n },\n});\n\nconst { useGetRolesQuery } = adminApi;\n\nexport { useGetRolesQuery };\nexport type { SanitizedAdminUser, Roles };\n","import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown: React.KeyboardEventHandler<HTMLButtonElement> = (e) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n","import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<Element extends HTMLElement = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: (event: React.KeyboardEvent<HTMLButtonElement>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<Element>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n Element extends HTMLElement = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<Element> => {\n const objectRef = React.useRef<Element>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n }\n\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n }\n },\n });\n\n const getDragDirection = (monitor: DragSourceMonitor<TItem, void>) => {\n if (\n monitor &&\n monitor.isDragging() &&\n !monitor.didDrop() &&\n monitor.getInitialClientOffset() &&\n monitor.getClientOffset()\n ) {\n const deltaY = monitor.getInitialClientOffset()!.y - monitor.getClientOffset()!.y;\n\n if (deltaY > 0) return DIRECTIONS.UPWARD;\n\n if (deltaY < 0) return DIRECTIONS.DOWNWARD;\n\n return null;\n }\n\n return null;\n };\n\n const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({\n type,\n item() {\n if (onStart) {\n onStart();\n }\n\n /**\n * This will be attached and it helps define the preview sizes\n * when a component is flexy e.g. Relations\n */\n const { width } = objectRef.current?.getBoundingClientRect() ?? {};\n\n return { index, width, ...item };\n },\n end() {\n if (onEnd) {\n onEnd();\n }\n },\n canDrag: active,\n /**\n * This is useful when the item is in a virtualized list.\n * However, if we don't have an ID then we want the libraries\n * defaults to take care of this.\n */\n isDragging: item?.id\n ? (monitor) => {\n return item.id === monitor.getItem().id;\n }\n : undefined,\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n initialOffset: monitor.getInitialClientOffset(),\n currentOffset: monitor.getClientOffset(),\n direction: getDragDirection(monitor),\n }),\n });\n\n const handleKeyDown = useKeyboardDragAndDrop(active, index, {\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n });\n\n return [\n { handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },\n objectRef,\n dropRef,\n dragRef,\n dragPreviewRef,\n ];\n};\n\nexport {\n useDragAndDrop,\n UseDragAndDropReturn,\n UseDragAndDropOptions,\n DIRECTIONS,\n DROP_SENSITIVITY,\n};\n","import { Box, ButtonProps, Flex, Typography } from '@strapi/design-system';\nimport { PlusCircle } from '@strapi/icons';\nimport styled from 'styled-components';\n\nexport const AddStage = ({ children, ...props }: ButtonProps) => {\n return (\n <StyledButton\n as=\"button\"\n background=\"neutral0\"\n border=\"neutral150\"\n paddingBottom={3}\n paddingLeft={4}\n paddingRight={4}\n paddingTop={3}\n shadow=\"filterShadow\"\n {...props}\n >\n {/* @ts-expect-error – textColor can accept css properties in the next DS release */}\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor=\"inherit\">\n <Flex as=\"span\" gap={2}>\n <PlusCircle width=\"2.4rem\" height=\"2.4rem\" aria-hidden />\n {children}\n </Flex>\n </Typography>\n </StyledButton>\n );\n};\n\nconst StyledButton = styled(Box)`\n border-radius: 26px;\n color: ${({ theme }) => theme.colors.neutral500};\n\n &:hover {\n color: ${({ theme }) => theme.colors.primary600};\n }\n\n &:active {\n color: ${({ theme }) => theme.colors.primary600};\n }\n`;\n","import * as React from 'react';\n\nimport {\n useField,\n useForm,\n useTracking,\n ConfirmDialog,\n useNotification,\n InputRenderer as AdminInputRenderer,\n InputProps,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Flex,\n MultiSelectOption,\n Accordion,\n AccordionContent,\n AccordionToggle,\n Grid,\n GridItem,\n IconButton,\n MultiSelect,\n MultiSelectGroup,\n SingleSelect,\n SingleSelectOption,\n TextInput,\n VisuallyHidden,\n useComposedRefs,\n Menu,\n MenuItem,\n} from '@strapi/design-system';\nimport { Duplicate, Drag, More, EyeStriked } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport styled from 'styled-components';\n\nimport { Stage as IStage, StagePermission } from '../../../../../shared/contracts/review-workflows';\nimport { useGetRolesQuery } from '../../../services/admin';\nimport { AVAILABLE_COLORS, getStageColorByHex } from '../../../utils/colors';\nimport { DRAG_DROP_TYPES } from '../constants';\nimport { useDragAndDrop } from '../hooks/useDragAndDrop';\n\nimport { AddStage } from './AddStage';\n\ninterface WorkflowStage extends Pick<IStage, 'id' | 'name' | 'permissions' | 'color'> {\n __temp_key__: string;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Stages\n * -----------------------------------------------------------------------------------------------*/\ninterface StagesProps {\n canDelete?: boolean;\n canUpdate?: boolean;\n isCreating?: boolean;\n}\n\nconst Stages = ({ canDelete = true, canUpdate = true, isCreating = false }: StagesProps) => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const addFieldRow = useForm('Stages', (state) => state.addFieldRow);\n const { value: stages = [] } = useField<WorkflowStage[]>('stages');\n\n return (\n <Flex direction=\"column\" gap={6} width=\"100%\">\n <Box position=\"relative\" width=\"100%\">\n <Background\n background=\"neutral200\"\n height=\"100%\"\n left=\"50%\"\n position=\"absolute\"\n top=\"0\"\n width={2}\n zIndex={1}\n />\n\n <Flex\n direction=\"column\"\n alignItems=\"stretch\"\n gap={6}\n zIndex={2}\n position=\"relative\"\n as=\"ol\"\n >\n {stages.map((stage, index) => {\n return (\n <Box key={stage.__temp_key__} as=\"li\">\n <Stage\n index={index}\n canDelete={stages.length > 1 && canDelete}\n canReorder={stages.length > 1}\n canUpdate={canUpdate}\n stagesCount={stages.length}\n isOpen={isCreating}\n {...stage}\n />\n </Box>\n );\n })}\n </Flex>\n </Box>\n\n {canUpdate && (\n <AddStage\n type=\"button\"\n onClick={() => {\n addFieldRow('stages', { name: '' });\n trackUsage('willCreateStage');\n }}\n >\n {formatMessage({\n id: 'Settings.review-workflows.stage.add',\n defaultMessage: 'Add new stage',\n })}\n </AddStage>\n )}\n </Flex>\n );\n};\n\nconst Background = styled(Box)`\n transform: translateX(-50%);\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * Stage\n * -----------------------------------------------------------------------------------------------*/\ninterface StageProps extends WorkflowStage {\n canDelete?: boolean;\n canReorder?: boolean;\n canUpdate?: boolean;\n isOpen?: boolean;\n index: number;\n stagesCount: number;\n}\n\nconst Stage = ({\n index,\n canDelete = false,\n canReorder = false,\n canUpdate = false,\n isOpen: isOpenDefault = false,\n stagesCount,\n name,\n permissions,\n color,\n}: StageProps) => {\n const [liveText, setLiveText] = React.useState<string>();\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const [isOpen, setIsOpen] = React.useState(isOpenDefault);\n const stageErrors = useForm('Stages', (state) => state.errors.stages as object[]);\n const error = stageErrors?.[index];\n const addFieldRow = useForm('Stage', (state) => state.addFieldRow);\n const moveFieldRow = useForm('Stage', (state) => state.moveFieldRow);\n const removeFieldRow = useForm('Stage', (state) => state.removeFieldRow);\n\n const getItemPos = (index: number) => `${index + 1} of ${stagesCount}`;\n\n const handleGrabStage = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.grab-item',\n defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`,\n },\n {\n item: name,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleDropStage = (index: number) => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.drop-item',\n defaultMessage: `{item}, dropped. Final position in list: {position}.`,\n },\n {\n item: name,\n position: getItemPos(index),\n }\n )\n );\n };\n\n const handleCancelDragStage = () => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.cancel-item',\n defaultMessage: '{item}, dropped. Re-order cancelled.',\n },\n {\n item: name,\n }\n )\n );\n };\n\n const handleMoveStage = (newIndex: number, oldIndex: number) => {\n setLiveText(\n formatMessage(\n {\n id: 'dnd.reorder',\n defaultMessage: '{item}, moved. New position in list: {position}.',\n },\n {\n item: name,\n position: getItemPos(newIndex),\n }\n )\n );\n\n moveFieldRow('stages', oldIndex, newIndex);\n };\n\n const [{ handlerId, isDragging, handleKeyDown }, stageRef, dropRef, dragRef, dragPreviewRef] =\n useDragAndDrop(canReorder, {\n index,\n item: {\n index,\n name,\n },\n onGrabItem: handleGrabStage,\n onDropItem: handleDropStage,\n onMoveItem: handleMoveStage,\n onCancel: handleCancelDragStage,\n type: DRAG_DROP_TYPES.STAGE,\n });\n\n const composedRef = useComposedRefs(stageRef, dropRef);\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef, index]);\n\n const handleCloneClick = () => {\n addFieldRow('stages', { name, color, permissions });\n };\n\n return (\n <Box ref={(ref) => composedRef(ref!)}>\n {liveText && <VisuallyHidden aria-live=\"assertive\">{liveText}</VisuallyHidden>}\n\n {isDragging ? (\n <Box\n background=\"primary100\"\n borderStyle=\"dashed\"\n borderColor=\"primary600\"\n borderWidth=\"1px\"\n display=\"block\"\n hasRadius\n padding={6}\n shadow=\"tableShadow\"\n />\n ) : (\n <Accordion\n size=\"S\"\n variant=\"primary\"\n onToggle={() => {\n setIsOpen(!isOpen);\n\n if (!isOpen) {\n trackUsage('willEditStage');\n }\n }}\n expanded={isOpen}\n shadow=\"tableShadow\"\n error={Object.values(error ?? {})[0]}\n hasErrorMessage={false}\n >\n <AccordionToggle\n title={name}\n togglePosition=\"left\"\n action={\n (canDelete || canUpdate) && (\n <Flex>\n <Menu.Root>\n <ContextMenuTrigger size=\"S\" endIcon={null} paddingLeft={2} paddingRight={2}>\n <More aria-hidden focusable={false} />\n <VisuallyHidden as=\"span\">\n {formatMessage({\n id: '[tbdb].components.DynamicZone.more-actions',\n defaultMessage: 'More actions',\n })}\n </VisuallyHidden>\n </ContextMenuTrigger>\n {/* z-index needs to be as big as the one defined for the wrapper in Stages, otherwise the menu\n * disappears behind the accordion\n */}\n <Menu.Content popoverPlacement=\"bottom-end\" zIndex={2}>\n <Menu.SubRoot>\n {canUpdate && (\n <MenuItem onClick={handleCloneClick}>\n {formatMessage({\n id: 'Settings.review-workflows.stage.delete',\n defaultMessage: 'Duplicate stage',\n })}\n </MenuItem>\n )}\n\n {canDelete && (\n <DeleteMenuItem onClick={() => removeFieldRow('stages', index)}>\n {formatMessage({\n id: 'Settings.review-workflows.stage.delete',\n defaultMessage: 'Delete',\n })}\n </DeleteMenuItem>\n )}\n </Menu.SubRoot>\n </Menu.Content>\n </Menu.Root>\n\n {canUpdate && (\n <DragIconButton\n background=\"transparent\"\n // @ts-expect-error – `forwardedAs` can be a string.\n forwardedAs=\"div\"\n hasRadius\n role=\"button\"\n noBorder\n tabIndex={0}\n data-handler-id={handlerId}\n ref={dragRef}\n label={formatMessage({\n id: 'Settings.review-workflows.stage.drag',\n defaultMessage: 'Drag',\n })}\n onClick={(e) => e.stopPropagation()}\n onKeyDown={handleKeyDown}\n >\n <Drag />\n </DragIconButton>\n )}\n </Flex>\n )\n }\n />\n <AccordionContent padding={6} background=\"neutral0\" hasRadius>\n <Grid gap={4}>\n {[\n {\n disabled: !canUpdate,\n label: formatMessage({\n id: 'Settings.review-workflows.stage.name.label',\n defaultMessage: 'Stage name',\n }),\n name: `stages.${index}.name`,\n required: true,\n size: 6,\n type: 'string' as const,\n },\n {\n disabled: !canUpdate,\n label: formatMessage({\n id: 'content-manager.reviewWorkflows.stage.color',\n defaultMessage: 'Color',\n }),\n name: `stages.${index}.color`,\n required: true,\n size: 6,\n type: 'color' as const,\n },\n {\n disabled: !canUpdate,\n label: formatMessage({\n id: 'Settings.review-workflows.stage.permissions.label',\n defaultMessage: 'Roles that can change this stage',\n }),\n name: `stages.${index}.permissions`,\n placeholder: formatMessage({\n id: 'Settings.review-workflows.stage.permissions.placeholder',\n defaultMessage: 'Select a role',\n }),\n required: true,\n size: 6,\n type: 'permissions' as const,\n },\n ].map(({ size, ...field }) => (\n <GridItem key={field.name} col={size}>\n <InputRenderer {...field} />\n </GridItem>\n ))}\n </Grid>\n </AccordionContent>\n </Accordion>\n )}\n </Box>\n );\n};\n\nconst DeleteMenuItem = styled(MenuItem)`\n color: ${({ theme }) => theme.colors.danger600};\n`;\n\n// Removing the font-size from the child-span aligns the\n// more icon vertically\nconst ContextMenuTrigger = styled(Menu.Trigger)`\n :hover,\n :focus {\n background-color: ${({ theme }) => theme.colors.neutral100};\n }\n\n > span {\n font-size: 0;\n }\n`;\n\n// As soon as either `as` or `forwardedAs` is set, the component\n// resets some styles and e.g. the `hasBorder` prop no longer works,\n// which is why this bit of CSS has been added manually ¯\\_(ツ)_/¯\nconst DragIconButton = styled(IconButton)`\n align-items: center;\n border-radius: ${({ theme }) => theme.borderRadius};\n display: flex;\n justify-content: center;\n\n &:hover,\n &:focus {\n background-color: ${({ theme }) => theme.colors.neutral100};\n }\n\n svg {\n height: auto;\n width: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * InputRenderer\n * -----------------------------------------------------------------------------------------------*/\n\ntype InputRendererProps = InputProps | ColorSelectorProps | PermissionsFieldProps;\n\nconst InputRenderer = (props: InputRendererProps) => {\n switch (props.type) {\n case 'color':\n return <ColorSelector {...props} />;\n case 'permissions':\n return <PermissionsField {...props} />;\n default:\n return <AdminInputRenderer {...props} />;\n }\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ColorSelector\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ColorSelectorProps\n extends Omit<Extract<InputProps, { type: 'enumeration' }>, 'type' | 'options'> {\n type: 'color';\n}\n\nconst ColorSelector = ({ disabled, label, name, required }: ColorSelectorProps) => {\n const { formatMessage } = useIntl();\n const { value, error, onChange } = useField<string>(name);\n\n const colorOptions = AVAILABLE_COLORS.map(({ hex, name }) => ({\n value: hex,\n label: formatMessage(\n {\n id: 'Settings.review-workflows.stage.color.name',\n defaultMessage: '{name}',\n },\n { name }\n ),\n color: hex,\n }));\n\n const { themeColorName } = getStageColorByHex(value) ?? {};\n\n return (\n <SingleSelect\n disabled={disabled}\n error={error}\n required={required}\n // @ts-expect-error – ReactNode is fine for the `label` prop.\n label={label}\n onChange={(v) => {\n onChange(name, v.toString());\n }}\n value={value?.toUpperCase()}\n startIcon={\n <Flex\n as=\"span\"\n height={2}\n background={value}\n // @ts-expect-error - transparent doesn't exist in theme.colors\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : 'transparent'}\n hasRadius\n shrink={0}\n width={2}\n />\n }\n >\n {colorOptions.map(({ value, label, color }) => {\n const { themeColorName } = getStageColorByHex(color) || {};\n\n return (\n <SingleSelectOption\n value={value}\n key={value}\n startIcon={\n <Flex\n as=\"span\"\n height={2}\n background={color}\n // @ts-expect-error - transparent doesn't exist in theme.colors\n borderColor={themeColorName === 'neutral0' ? 'neutral150' : 'transparent'}\n hasRadius\n shrink={0}\n width={2}\n />\n }\n >\n {label}\n </SingleSelectOption>\n );\n })}\n </SingleSelect>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PermissionsField\n * -----------------------------------------------------------------------------------------------*/\ninterface PermissionsFieldProps\n extends Omit<Extract<InputProps, { type: 'enumeration' }>, 'type' | 'options'> {\n type: 'permissions';\n}\n\nconst PermissionsField = ({ disabled, name, placeholder, required }: PermissionsFieldProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const [isApplyAllConfirmationOpen, setIsApplyAllConfirmationOpen] = React.useState(false);\n const { value = [], error, onChange } = useField<StagePermission[]>(name);\n const allStages = useForm<WorkflowStage[]>('PermissionsField', (state) => state.values.stages);\n const onFormValueChange = useForm('PermissionsField', (state) => state.onChange);\n\n const { data: roles = [], isLoading } = useGetRolesQuery();\n\n // Super admins always have permissions to do everything and therefore\n // there is no point for this role to show up in the role combobox\n const filteredRoles = roles?.filter((role) => role.code !== 'strapi-super-admin') ?? [];\n\n React.useEffect(() => {\n if (!isLoading && roles.length === 0) {\n toggleNotification({\n blockTransition: true,\n type: 'danger',\n message: formatMessage({\n id: 'review-workflows.stage.permissions.noPermissions.description',\n defaultMessage: 'You don’t have the permission to see roles',\n }),\n });\n }\n }, [formatMessage, isLoading, roles, toggleNotification]);\n\n if (!isLoading && filteredRoles.length === 0) {\n return (\n <TextInput\n disabled\n name={name}\n hint={formatMessage({\n id: 'Settings.review-workflows.stage.permissions.noPermissions.description',\n defaultMessage: 'You don’t have the permission to see roles',\n })}\n label={formatMessage({\n id: 'Settings.review-workflows.stage.permissions.label',\n defaultMessage: 'Roles that can change this stage',\n })}\n placeholder={formatMessage({\n id: 'components.NotAllowedInput.text',\n defaultMessage: 'No permissions to see this field',\n })}\n required={required}\n startAction={<StyledIcon />}\n type=\"text\"\n value=\"\"\n />\n );\n }\n\n return (\n <>\n <Flex alignItems=\"flex-end\" gap={3}>\n <PermissionWrapper grow={1}>\n <MultiSelect\n disabled={disabled}\n error={error}\n id={name}\n label={formatMessage({\n id: 'Settings.review-workflows.stage.permissions.label',\n defaultMessage: 'Roles that can change this stage',\n })}\n onChange={(values) => {\n // Because the select components expects strings for values, but\n // the yup schema validates we are sending full permission objects to the API,\n // we must coerce the string value back to an object\n const permissions = values.map((value) => ({\n role: parseInt(value, 10),\n action: 'admin::review-workflows.stage.transition',\n }));\n\n onChange(name, permissions);\n }}\n placeholder={placeholder}\n required\n // The Select component expects strings for values\n value={value.map((permission) => `${permission.role}`)}\n withTags\n >\n <MultiSelectGroup\n label={formatMessage({\n id: 'Settings.review-workflows.stage.permissions.allRoles.label',\n defaultMessage: 'All roles',\n })}\n values={filteredRoles.map((r) => `${r.id}`)}\n >\n {filteredRoles.map((role) => {\n return (\n <NestedOption key={role.id} value={`${role.id}`}>\n {role.name}\n </NestedOption>\n );\n })}\n </MultiSelectGroup>\n </MultiSelect>\n </PermissionWrapper>\n\n <IconButton\n disabled={disabled}\n icon={<Duplicate />}\n label={formatMessage({\n id: 'Settings.review-workflows.stage.permissions.apply.label',\n defaultMessage: 'Apply to all stages',\n })}\n size=\"L\"\n variant=\"secondary\"\n onClick={() => setIsApplyAllConfirmationOpen(true)}\n />\n </Flex>\n <ConfirmDialog\n isOpen={isApplyAllConfirmationOpen}\n onClose={() => setIsApplyAllConfirmationOpen(false)}\n onConfirm={() => {\n onFormValueChange(\n 'stages',\n allStages.map((stage) => ({\n ...stage,\n permissions: value,\n }))\n );\n\n setIsApplyAllConfirmationOpen(false);\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy.success',\n defaultMessage: 'Applied roles to all other stages of the workflow',\n }),\n });\n }}\n variant=\"default\"\n >\n {formatMessage({\n id: 'Settings.review-workflows.page.edit.confirm.stages.permissions.copy',\n defaultMessage:\n 'Roles that can change that stage will be applied to all the other stages.',\n })}\n </ConfirmDialog>\n </>\n );\n};\n\nconst StyledIcon = styled(EyeStriked)`\n & > path {\n fill: ${({ theme }) => theme.colors.neutral600};\n }\n`;\n\nconst NestedOption = styled(MultiSelectOption)`\n padding-left: ${({ theme }) => theme.spaces[7]};\n`;\n\n// Grow the size of the permission Select\nconst PermissionWrapper = styled(Flex)`\n > * {\n flex-grow: 1;\n }\n`;\n\nexport { Stages };\nexport type { StagesProps, WorkflowStage };\n","import { InputRenderer, useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Grid,\n GridItem,\n MultiSelect,\n MultiSelectGroup,\n MultiSelectOption,\n Typography,\n useCollator,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport styled from 'styled-components';\n\nimport { useGetContentTypesQuery } from '../../../services/content-manager';\nimport { useReviewWorkflows } from '../hooks/useReviewWorkflows';\n\n/* -------------------------------------------------------------------------------------------------\n * WorkflowAttributes\n * -----------------------------------------------------------------------------------------------*/\ninterface WorkflowAttributesProps {\n canUpdate?: boolean;\n}\n\nconst WorkflowAttributes = ({ canUpdate = true }: WorkflowAttributesProps) => {\n const { formatMessage } = useIntl();\n\n return (\n <Grid background=\"neutral0\" hasRadius gap={4} padding={6} shadow=\"tableShadow\">\n <GridItem col={6}>\n <InputRenderer\n disabled={!canUpdate}\n label={formatMessage({\n id: 'Settings.review-workflows.workflow.name.label',\n defaultMessage: 'Workflow Name',\n })}\n name=\"name\"\n required\n type=\"string\"\n />\n </GridItem>\n <GridItem col={6}>\n <ContentTypesSelector disabled={!canUpdate} />\n </GridItem>\n </Grid>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ContentTypesSelector\n * -----------------------------------------------------------------------------------------------*/\ninterface ContentTypesSelectorProps {\n disabled?: boolean;\n}\n\nconst ContentTypesSelector = ({ disabled }: ContentTypesSelectorProps) => {\n const { formatMessage, locale } = useIntl();\n const { data: contentTypes, isLoading } = useGetContentTypesQuery();\n const { workflows } = useReviewWorkflows();\n const currentWorkflow = useForm('ContentTypesSelector', (state) => state.values);\n\n const { error, value, onChange } = useField('contentTypes');\n\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n\n const isDisabled =\n disabled ||\n isLoading ||\n !contentTypes ||\n (contentTypes.collectionType.length === 0 && contentTypes.singleType.length === 0);\n\n const collectionTypes = (contentTypes?.collectionType ?? [])\n .toSorted((a, b) => formatter.compare(a.info.displayName, b.info.displayName))\n .map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n const singleTypes = (contentTypes?.singleType ?? []).map((contentType) => ({\n label: contentType.info.displayName,\n value: contentType.uid,\n }));\n\n return (\n <MultiSelect\n customizeContent={(value) =>\n formatMessage(\n {\n id: 'Settings.review-workflows.workflow.contentTypes.displayValue',\n defaultMessage:\n '{count} {count, plural, one {content type} other {content types}} selected',\n },\n { count: value?.length }\n )\n }\n disabled={isDisabled}\n error={error}\n label={formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.label',\n defaultMessage: 'Associated to',\n })}\n onChange={(values) => {\n onChange('contentTypes', values);\n }}\n value={value}\n placeholder={formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.placeholder',\n defaultMessage: 'Select',\n })}\n >\n {[\n ...(collectionTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.collectionTypes.label',\n defaultMessage: 'Collection Types',\n }),\n children: collectionTypes,\n },\n ]\n : []),\n\n ...(singleTypes.length > 0\n ? [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.workflow.contentTypes.singleTypes.label',\n defaultMessage: 'Single Types',\n }),\n children: singleTypes,\n },\n ]\n : []),\n ].map((opt) => {\n return (\n <MultiSelectGroup\n key={opt.label}\n label={opt.label}\n values={opt.children.map((child) => child.value.toString())}\n >\n {opt.children.map((child) => {\n const { name: assignedWorkflowName } =\n workflows?.find(\n (workflow) =>\n ((currentWorkflow && workflow.id !== currentWorkflow.id) || !currentWorkflow) &&\n workflow.contentTypes.includes(child.value)\n ) ?? {};\n\n return (\n <NestedOption key={child.value} value={child.value}>\n <Typography>\n {\n // @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\n formatMessage(\n {\n id: 'Settings.review-workflows.workflow.contentTypes.assigned.notice',\n defaultMessage:\n '{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}',\n },\n {\n label: child.label,\n name: assignedWorkflowName,\n em: (...children) => (\n <Typography as=\"em\" fontWeight=\"bold\">\n {children}\n </Typography>\n ),\n i: (...children) => (\n <ContentTypeTakeNotice>{children}</ContentTypeTakeNotice>\n ),\n }\n )\n }\n </Typography>\n </NestedOption>\n );\n })}\n </MultiSelectGroup>\n );\n })}\n </MultiSelect>\n );\n};\n\nconst NestedOption = styled(MultiSelectOption)`\n padding-left: ${({ theme }) => theme.spaces[7]};\n`;\n\nconst ContentTypeTakeNotice = styled(Typography)`\n font-style: italic;\n`;\n\nexport { WorkflowAttributes };\nexport type { WorkflowAttributesProps };\n","import * as React from 'react';\n\nimport {\n ConfirmDialog,\n BackButton,\n useNotification,\n useAPIErrorHandler,\n useRBAC,\n Form,\n Page,\n FormProps,\n FormHelpers,\n} from '@strapi/admin/strapi-admin';\nimport { useLicenseLimits } from '@strapi/admin/strapi-admin/ee';\nimport { Button, Flex, Typography } from '@strapi/design-system';\nimport { Check } from '@strapi/icons';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport { useIntl } from 'react-intl';\nimport { useDispatch } from 'react-redux';\nimport { useNavigate, useParams } from 'react-router-dom';\nimport * as yup from 'yup';\n\nimport { LimitsModal } from '../../components/LimitsModal';\nimport {\n CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME,\n CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME,\n} from '../../constants';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { isBaseQueryError } from '../../utils/api';\n\nimport * as Layout from './components/Layout';\nimport { Stages, WorkflowStage } from './components/Stages';\nimport { WorkflowAttributes } from './components/WorkflowAttributes';\nimport { useReviewWorkflows } from './hooks/useReviewWorkflows';\n\nimport type { Stage, Workflow } from '../../../../shared/contracts/review-workflows';\n\n/* -------------------------------------------------------------------------------------------------\n * EditPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst WORKFLOW_SCHEMA = yup.object({\n contentTypes: yup.array().of(yup.string()),\n name: yup\n .string()\n .max(255, {\n id: 'review-workflows.validation.name.max-length',\n defaultMessage: 'Name can not be longer than 255 characters',\n })\n .required(),\n stages: yup\n .array()\n .of(\n yup.object().shape({\n name: yup\n .string()\n .required({\n id: 'review-workflows.validation.stage.name',\n defaultMessage: 'Name is required',\n })\n .max(255, {\n id: 'review-workflows.validation.stage.max-length',\n defaultMessage: 'Name can not be longer than 255 characters',\n })\n .test(\n 'unique-name',\n {\n id: 'review-workflows.validation.stage.duplicate',\n defaultMessage: 'Stage name must be unique',\n },\n (stageName, context) => {\n // @ts-expect-error it does exist.\n const { stages } = context.from[1].value;\n\n return stages.filter((stage: Stage) => stage.name === stageName).length === 1;\n }\n ),\n color: yup\n .string()\n .required({\n id: 'review-workflows.validation.stage.color',\n defaultMessage: 'Color is required',\n })\n .matches(/^#(?:[0-9a-fA-F]{3}){1,2}$/i),\n\n permissions: yup\n .array(\n yup.object({\n role: yup\n .number()\n .strict()\n .typeError({\n id: 'review-workflows.validation.stage.permissions.role.number',\n defaultMessage: 'Role must be of type number',\n })\n .required(),\n action: yup.string().required({\n id: 'review-workflows.validation.stage.permissions.action.required',\n defaultMessage: 'Action is a required argument',\n }),\n })\n )\n .strict(),\n })\n )\n .min(1),\n});\n\nconst EditPage = () => {\n const { id = '' } = useParams<{ id: string }>();\n const isCreatingWorkflow = id === 'create';\n const { formatMessage } = useIntl();\n const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();\n const navigate = useNavigate();\n const { toggleNotification } = useNotification();\n const dispatch = useDispatch();\n const {\n isLoading: isLoadingWorkflow,\n meta,\n workflows,\n error,\n update,\n create,\n } = useReviewWorkflows({ id: isCreatingWorkflow ? undefined : id });\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions['settings']?.['review-workflows']\n );\n const {\n allowedActions: { canDelete, canUpdate, canCreate },\n } = useRBAC(permissions);\n const [savePrompts, setSavePrompts] = React.useState<{\n hasDeletedServerStages?: boolean;\n hasReassignedContentTypes?: boolean;\n }>({});\n const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();\n const [showLimitModal, setShowLimitModal] = React.useState<'workflow' | 'stage' | null>(null);\n\n const currentWorkflow = workflows?.find((workflow) => workflow.id === parseInt(id, 10));\n const contentTypesFromOtherWorkflows = workflows\n ?.filter((workflow) => workflow.id !== parseInt(id, 10))\n .flatMap((workflow) => workflow.contentTypes);\n\n const limits = getFeature<string>('review-workflows');\n const numberOfWorkflows = limits?.[CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME];\n const stagesPerWorkflow = limits?.[CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME];\n\n interface FormValues {\n name: string;\n stages: WorkflowStage[];\n contentTypes: string[];\n }\n\n const submitForm = async (data: FormValues, helpers: Pick<FormHelpers, 'setErrors'>) => {\n try {\n if (!isCreatingWorkflow) {\n const res = await update(id, {\n ...data,\n // compare permissions of stages and only submit them if at least one has\n // changed; this enables partial updates e.g. for users who don't have\n // permissions to see roles\n stages: data.stages.map((stage) => {\n let hasUpdatedPermissions = true;\n const serverStage = currentWorkflow?.stages?.find(\n (serverStage) => serverStage.id === stage?.id\n );\n if (serverStage) {\n hasUpdatedPermissions =\n serverStage.permissions?.length !== stage.permissions?.length ||\n !serverStage.permissions?.every(\n (serverPermission) =>\n !!stage.permissions?.find(\n (permission) => permission.role === serverPermission.role\n )\n );\n }\n return {\n ...stage,\n permissions: hasUpdatedPermissions ? stage.permissions : undefined,\n } satisfies Stage;\n }),\n });\n\n if ('error' in res && isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else if ('data' in res) {\n for (const uid of res.data.contentTypes) {\n // Invalidates the content-manager's API cache for the document layout so we can see RW enabled.\n dispatch({\n type: 'contentManagerApi/invalidateTags',\n payload: [\n {\n type: 'ContentTypesConfiguration',\n id: uid,\n },\n ],\n });\n }\n }\n } else {\n const res = await create(data);\n\n if ('error' in res && isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else if ('data' in res) {\n for (const uid of res.data.contentTypes) {\n // Invalidates the content-manager's API cache for the document layout so we can see RW enabled.\n dispatch({\n type: 'contentManagerApi/invalidateTags',\n payload: [\n {\n type: 'ContentTypesConfiguration',\n id: uid,\n },\n ],\n });\n }\n\n navigate(`../${res.data.id}`);\n }\n }\n } catch (error) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred',\n }),\n });\n }\n setSavePrompts({});\n };\n\n const handleConfirmDeleteDialog =\n (data: FormValues, helpers: Pick<FormHelpers, 'setErrors'>) => async () => {\n await submitForm(data, helpers);\n };\n\n const handleConfirmClose = () => {\n setSavePrompts({});\n };\n\n const handleSubmit: FormProps<FormValues>['onSubmit'] = async (data, helpers) => {\n const isContentTypeReassignment = data.contentTypes.some((contentType) =>\n contentTypesFromOtherWorkflows?.includes(contentType)\n );\n const hasDeletedServerStages =\n !isCreatingWorkflow &&\n !currentWorkflow?.stages.every((stage) =>\n data.stages.some((newStage) => newStage.id === stage.id)\n );\n\n if (meta && numberOfWorkflows && meta?.workflowCount > parseInt(numberOfWorkflows, 10)) {\n /**\n * If the current license has a limit, check if the total count of workflows\n * exceeds that limit and display the limits modal instead of sending the\n * update, because it would throw an API error.\n */\n setShowLimitModal('workflow');\n\n /**\n * If the current license has a limit, check if the total count of stages\n * exceeds that limit and display the limits modal instead of sending the\n * update, because it would throw an API error.\n */\n } else if (\n data.stages &&\n stagesPerWorkflow &&\n data.stages.length > parseInt(stagesPerWorkflow, 10)\n ) {\n setShowLimitModal('stage');\n } else if (hasDeletedServerStages || isContentTypeReassignment) {\n if (hasDeletedServerStages) {\n setSavePrompts((prev) => ({ ...prev, hasDeletedServerStages: true }));\n }\n\n if (isContentTypeReassignment) {\n setSavePrompts((prev) => ({ ...prev, hasReassignedContentTypes: true }));\n }\n } else {\n await submitForm(data, helpers);\n }\n };\n\n /**\n * If the current license has a limit:\n * check if the total count of workflows or stages exceeds that limit and display\n * the limits modal on page load. It can be closed by the user, but the\n * API will throw an error in case they try to create a new workflow or update the\n * stages.\n *\n * If the current license does not have a limit (e.g. offline license):\n * do nothing (for now). In case they are trying to create the 201st workflow/ stage\n * the API will throw an error.\n *\n */\n React.useEffect(() => {\n if (!isLoadingWorkflow && !isLicenseLoading) {\n if (meta && numberOfWorkflows && meta?.workflowCount > parseInt(numberOfWorkflows, 10)) {\n setShowLimitModal('workflow');\n } else if (\n currentWorkflow &&\n currentWorkflow.stages &&\n stagesPerWorkflow &&\n currentWorkflow.stages.length > parseInt(stagesPerWorkflow, 10)\n ) {\n setShowLimitModal('stage');\n }\n }\n }, [\n currentWorkflow,\n isLicenseLoading,\n isLoadingWorkflow,\n limits,\n meta,\n numberOfWorkflows,\n stagesPerWorkflow,\n ]);\n\n const initialValues: FormValues = React.useMemo(() => {\n if (isCreatingWorkflow || !currentWorkflow) {\n return {\n name: '',\n stages: [],\n contentTypes: [],\n };\n } else {\n return {\n name: currentWorkflow.name,\n stages: addTmpKeysToStages(currentWorkflow.stages),\n contentTypes: currentWorkflow.contentTypes,\n };\n }\n }, [currentWorkflow, isCreatingWorkflow]);\n\n if (isLoadingWorkflow) {\n return <Page.Loading />;\n }\n\n if (error) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Layout.DragLayerRendered />\n\n <Form\n method={isCreatingWorkflow ? 'POST' : 'PUT'}\n initialValues={initialValues}\n validationSchema={WORKFLOW_SCHEMA}\n onSubmit={handleSubmit}\n >\n {({ modified, isSubmitting, values, setErrors }) => (\n <>\n <Layout.Header\n navigationAction={<BackButton />}\n primaryAction={\n canUpdate || canCreate ? (\n <Button\n startIcon={<Check />}\n type=\"submit\"\n size=\"M\"\n disabled={!modified || isSubmitting || values.stages.length === 0}\n // if the confirm dialog is open the loading state is on\n // the confirm button already\n loading={!Boolean(Object.keys(savePrompts).length > 0) && isSubmitting}\n >\n {formatMessage({\n id: 'global.save',\n defaultMessage: 'Save',\n })}\n </Button>\n ) : null\n }\n subtitle={formatMessage(\n {\n id: 'review-workflows.page.subtitle',\n defaultMessage: '{count, plural, one {# stage} other {# stages}}',\n },\n { count: currentWorkflow?.stages?.length ?? 0 }\n )}\n title={\n currentWorkflow?.name ||\n formatMessage({\n id: 'Settings.review-workflows.create.page.title',\n defaultMessage: 'Create Review Workflow',\n })\n }\n />\n <Layout.Root>\n <Flex alignItems=\"stretch\" direction=\"column\" gap={7}>\n <WorkflowAttributes canUpdate={canUpdate} />\n <Stages\n canDelete={canDelete}\n canUpdate={canUpdate}\n isCreating={isCreatingWorkflow}\n />\n </Flex>\n </Layout.Root>\n <ConfirmDialog\n isOpen={Object.keys(savePrompts).length > 0}\n onClose={handleConfirmClose}\n onConfirm={handleConfirmDeleteDialog(values, { setErrors })}\n >\n <Flex direction=\"column\" gap={5}>\n {savePrompts.hasDeletedServerStages && (\n <Typography textAlign=\"center\" variant=\"omega\">\n {formatMessage({\n id: 'review-workflows.page.delete.confirm.stages.body',\n defaultMessage:\n 'All entries assigned to deleted stages will be moved to the previous stage.',\n })}\n </Typography>\n )}\n\n {savePrompts.hasReassignedContentTypes && (\n <Typography textAlign=\"center\" variant=\"omega\">\n {formatMessage(\n {\n id: 'review-workflows.page.delete.confirm.contentType.body',\n defaultMessage:\n '{count} {count, plural, one {content-type} other {content-types}} {count, plural, one {is} other {are}} already mapped to {count, plural, one {another workflow} other {other workflows}}. If you save changes, {count, plural, one {this} other {these}} {count, plural, one {content-type} other {{count} content-types}} will no more be mapped to the {count, plural, one {another workflow} other {other workflows}} and all corresponding information will be removed.',\n },\n {\n count:\n contentTypesFromOtherWorkflows?.filter((contentType) =>\n currentWorkflow?.contentTypes?.includes(contentType)\n ).length ?? 0,\n }\n )}\n </Typography>\n )}\n\n <Typography textAlign=\"center\" variant=\"omega\">\n {formatMessage({\n id: 'review-workflows.page.delete.confirm.confirm',\n defaultMessage: 'Are you sure you want to save?',\n })}\n </Typography>\n </Flex>\n </ConfirmDialog>\n </>\n )}\n </Form>\n\n <LimitsModal.Root\n isOpen={showLimitModal === 'workflow'}\n onClose={() => setShowLimitModal(null)}\n >\n <LimitsModal.Title>\n {formatMessage({\n id: 'review-workflows.edit.page.workflows.limit.title',\n defaultMessage: 'You’ve reached the limit of workflows in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'review-workflows.edit.page.workflows.limit.body',\n defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n\n <LimitsModal.Root isOpen={showLimitModal === 'stage'} onClose={() => setShowLimitModal(null)}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'review-workflows.edit.page.stages.limit.title',\n defaultMessage: 'You have reached the limit of stages for this workflow in your plan',\n })}\n </LimitsModal.Title>\n\n <LimitsModal.Body>\n {formatMessage({\n id: 'review-workflows.edit.page.stages.limit.body',\n defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n </>\n );\n};\n\nconst addTmpKeysToStages = (data: Workflow['stages']) => {\n const keys = generateNKeysBetween(undefined, undefined, data.length);\n\n return data.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedEditPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedEditPage = () => {\n const permissions = useTypedSelector((state) => {\n const {\n create = [],\n update = [],\n read = [],\n } = state.admin_app.permissions.settings?.['review-workflows'] ?? {};\n\n return [...create, ...update, ...read];\n });\n\n return (\n <Page.Protect permissions={permissions}>\n <EditPage />\n </Page.Protect>\n );\n};\n\nexport { ProtectedEditPage };\n"],"names":["item","index","AdminInputRenderer","name","value","label","themeColorName","NestedOption","InputRenderer","serverStage","error","Layout.DragLayerRendered","Layout.Header","Layout.Root"],"mappings":";;;;;;;;;;;;;;;;AAOA,MAAM,WAAW,mBAAmB,gBAAgB;AAAA,EAClD,UAAU,SAAS;AACV,WAAA;AAAA,MACL,UAAU,QAAQ,MAAmB;AAAA,QACnC,OAAO,OAAO;AAAA,UACZ,KAAK;AAAA,UACL,QAAQ;AAAA,QAAA;AAAA,QAEV,mBAAmB,CAAC,QAAuB;AACzC,iBAAO,IAAI;AAAA,QACb;AAAA,MAAA,CACD;AAAA,IAAA;AAAA,EAEL;AACF,CAAC;AAED,MAAM,EAAE,iBAAqB,IAAA;ACRhB,MAAA,yBAAyB,CACpC,QACA,OACA,EAAE,UAAU,YAAY,YAAY,iBACjC;AACH,QAAM,CAAC,YAAY,aAAa,IAAI,MAAM,SAAS,KAAK;AAElD,QAAA,aAAa,CAAC,aAA4B;AAC9C,QAAI,CAAC,YAAY;AACf;AAAA,IACF;AACI,QAAA,OAAO,UAAU,YAAY,YAAY;AAC3C,UAAI,aAAa,MAAM;AACT,mBAAA,QAAQ,GAAc,KAAK;AAAA,MA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AAA,GACH;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ;AAEA,MAAM,qBAAqB,CAAC,SAA6B;AACvD,QAAM,OAAO,qBAAqB,QAAW,QAAW,KAAK,MAAM;AAEnE,SAAO,KAAK,IAAI,CAAC,OAAO,WAAW;AAAA,IACjC,GAAG;AAAA,IACH,cAAc,KAAK,KAAK;AAAA,EACxB,EAAA;AACJ;AAMA,MAAM,oBAAoB,MAAM;AACxB,QAAA,cAAc,iBAAiB,CAAC,UAAU;AACxC,UAAA;AAAA,MACJ,SAAS,CAAC;AAAA,MACV,SAAS,CAAC;AAAA,MACV,OAAO,CAAC;AAAA,IAAA,IACN,MAAM,UAAU,YAAY,WAAW,kBAAkB,KAAK;AAElE,WAAO,CAAC,GAAG,QAAQ,GAAG,QAAQ,GAAG,IAAI;AAAA,EAAA,CACtC;AAED,6BACG,KAAK,SAAL,EAAa,aACZ,UAAA,oBAAC,YAAS,EACZ,CAAA;AAEJ;"}
|
|
@@ -11,9 +11,8 @@ const reactIntl = require("react-intl");
|
|
|
11
11
|
const reactRedux = require("react-redux");
|
|
12
12
|
const reactRouterDom = require("react-router-dom");
|
|
13
13
|
const yup = require("yup");
|
|
14
|
-
const index = require("./index-
|
|
15
|
-
const Layout = require("./Layout-
|
|
16
|
-
const v2 = require("@strapi/design-system/v2");
|
|
14
|
+
const index = require("./index-qAnk2xH9.js");
|
|
15
|
+
const Layout = require("./Layout-2ZuobDLm.js");
|
|
17
16
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
|
18
17
|
const styled = require("styled-components");
|
|
19
18
|
const reactDnd = require("react-dnd");
|
|
@@ -282,62 +281,23 @@ const AddStage = ({ children, ...props }) => {
|
|
|
282
281
|
paddingTop: 3,
|
|
283
282
|
shadow: "filterShadow",
|
|
284
283
|
...props,
|
|
285
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
286
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
287
|
-
|
|
288
|
-
] })
|
|
284
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "inherit", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { as: "span", gap: 2, children: [
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
|
|
286
|
+
children
|
|
287
|
+
] }) })
|
|
289
288
|
}
|
|
290
289
|
);
|
|
291
290
|
};
|
|
292
|
-
const StyledAddIcon = styled__default.default(icons.PlusCircle)`
|
|
293
|
-
> circle {
|
|
294
|
-
fill: ${({ theme }) => theme.colors.neutral150};
|
|
295
|
-
}
|
|
296
|
-
> path {
|
|
297
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
298
|
-
}
|
|
299
|
-
`;
|
|
300
291
|
const StyledButton = styled__default.default(designSystem.Box)`
|
|
301
292
|
border-radius: 26px;
|
|
302
|
-
|
|
303
|
-
svg {
|
|
304
|
-
height: ${({ theme }) => theme.spaces[6]};
|
|
305
|
-
width: ${({ theme }) => theme.spaces[6]};
|
|
306
|
-
|
|
307
|
-
> path {
|
|
308
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
|
309
|
-
}
|
|
310
|
-
}
|
|
293
|
+
color: ${({ theme }) => theme.colors.neutral500};
|
|
311
294
|
|
|
312
295
|
&:hover {
|
|
313
|
-
color: ${({ theme }) => theme.colors.primary600}
|
|
314
|
-
${designSystem.Typography} {
|
|
315
|
-
color: ${({ theme }) => theme.colors.primary600} !important;
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
${StyledAddIcon} {
|
|
319
|
-
> circle {
|
|
320
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
321
|
-
}
|
|
322
|
-
> path {
|
|
323
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
324
|
-
}
|
|
325
|
-
}
|
|
296
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
326
297
|
}
|
|
327
298
|
|
|
328
299
|
&:active {
|
|
329
|
-
${
|
|
330
|
-
color: ${({ theme }) => theme.colors.primary600};
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
${StyledAddIcon} {
|
|
334
|
-
> circle {
|
|
335
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
|
336
|
-
}
|
|
337
|
-
> path {
|
|
338
|
-
fill: ${({ theme }) => theme.colors.neutral100};
|
|
339
|
-
}
|
|
340
|
-
}
|
|
300
|
+
color: ${({ theme }) => theme.colors.primary600};
|
|
341
301
|
}
|
|
342
302
|
`;
|
|
343
303
|
const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
|
|
@@ -536,7 +496,7 @@ const Stage = ({
|
|
|
536
496
|
title: name,
|
|
537
497
|
togglePosition: "left",
|
|
538
498
|
action: (canDelete || canUpdate) && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
539
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
499
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
540
500
|
/* @__PURE__ */ jsxRuntime.jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
|
|
541
501
|
/* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
|
|
542
502
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { as: "span", children: formatMessage({
|
|
@@ -544,8 +504,8 @@ const Stage = ({
|
|
|
544
504
|
defaultMessage: "More actions"
|
|
545
505
|
}) })
|
|
546
506
|
] }),
|
|
547
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
548
|
-
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(
|
|
507
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.SubRoot, { children: [
|
|
508
|
+
canUpdate && /* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: handleCloneClick, children: formatMessage({
|
|
549
509
|
id: "Settings.review-workflows.stage.delete",
|
|
550
510
|
defaultMessage: "Duplicate stage"
|
|
551
511
|
}) }),
|
|
@@ -622,10 +582,10 @@ const Stage = ({
|
|
|
622
582
|
)
|
|
623
583
|
] });
|
|
624
584
|
};
|
|
625
|
-
const DeleteMenuItem = styled__default.default(
|
|
585
|
+
const DeleteMenuItem = styled__default.default(designSystem.MenuItem)`
|
|
626
586
|
color: ${({ theme }) => theme.colors.danger600};
|
|
627
587
|
`;
|
|
628
|
-
const ContextMenuTrigger = styled__default.default(
|
|
588
|
+
const ContextMenuTrigger = styled__default.default(designSystem.Menu.Trigger)`
|
|
629
589
|
:hover,
|
|
630
590
|
:focus {
|
|
631
591
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
@@ -1330,4 +1290,4 @@ const ProtectedEditPage = () => {
|
|
|
1330
1290
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
|
|
1331
1291
|
};
|
|
1332
1292
|
exports.ProtectedEditPage = ProtectedEditPage;
|
|
1333
|
-
//# sourceMappingURL=_id-
|
|
1293
|
+
//# sourceMappingURL=_id-yjWLof5q.js.map
|