@strapi/review-workflows 5.0.0-beta.5 → 5.0.0-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{Layout-dGg4FA1R.js → Layout-60gjGInX.js} +8 -10
- package/dist/_chunks/Layout-60gjGInX.js.map +1 -0
- package/dist/_chunks/{Layout-facLKucY.mjs → Layout-CJYuYwXO.mjs} +10 -10
- package/dist/_chunks/Layout-CJYuYwXO.mjs.map +1 -0
- package/dist/_chunks/{_id-B6DgrtpA.js → _id-BO7wNLt1.js} +210 -242
- package/dist/_chunks/_id-BO7wNLt1.js.map +1 -0
- package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-UJ-8gken.mjs} +198 -228
- package/dist/_chunks/_id-UJ-8gken.mjs.map +1 -0
- package/dist/_chunks/{index-DX8AGcIP.js → index-CfiZnfhM.js} +83 -69
- package/dist/_chunks/index-CfiZnfhM.js.map +1 -0
- package/dist/_chunks/{index-QbWLXdZR.mjs → index-DhEhUlv9.mjs} +15 -21
- package/dist/_chunks/index-DhEhUlv9.mjs.map +1 -0
- package/dist/_chunks/{index-D7Y0ofdg.mjs → index-DmQNXb0P.mjs} +83 -67
- package/dist/_chunks/index-DmQNXb0P.mjs.map +1 -0
- package/dist/_chunks/{index-BuKZWpJw.js → index-DnXnsrOM.js} +16 -24
- package/dist/_chunks/index-DnXnsrOM.js.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-B-V0sA2I.mjs → purchase-review-workflows-BN-5Ube7.mjs} +8 -7
- package/dist/_chunks/purchase-review-workflows-BN-5Ube7.mjs.map +1 -0
- package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-DlCDg0fD.js} +7 -6
- package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +1 -0
- package/dist/_chunks/{router-CL62NScV.js → router-BiQI7EcM.js} +3 -3
- package/dist/_chunks/{router-CL62NScV.js.map → router-BiQI7EcM.js.map} +1 -1
- package/dist/_chunks/{router-ylD0eA48.mjs → router-DFD0S0ey.mjs} +3 -3
- package/dist/_chunks/{router-ylD0eA48.mjs.map → router-DFD0S0ey.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +1 -1
- package/dist/admin/src/routes/settings/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +3 -3
- package/dist/admin/src/services/content-manager.d.ts +1 -1
- package/dist/admin/src/utils/api.d.ts +8 -9
- package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
- package/package.json +11 -12
- package/dist/_chunks/Layout-dGg4FA1R.js.map +0 -1
- package/dist/_chunks/Layout-facLKucY.mjs.map +0 -1
- package/dist/_chunks/_id-B6DgrtpA.js.map +0 -1
- package/dist/_chunks/_id-D4CXKOqG.mjs.map +0 -1
- package/dist/_chunks/index-BuKZWpJw.js.map +0 -1
- package/dist/_chunks/index-D7Y0ofdg.mjs.map +0 -1
- package/dist/_chunks/index-DX8AGcIP.js.map +0 -1
- package/dist/_chunks/index-QbWLXdZR.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +0 -1
- package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DnXnsrOM.js","sources":["../../admin/src/routes/settings/index.tsx"],"sourcesContent":["/* eslint-disable check-file/no-index */\n/* eslint-disable check-file/filename-naming-convention */\nimport * as React from 'react';\n\nimport { Page, useTracking, ConfirmDialog, useRBAC, Table } from '@strapi/admin/strapi-admin';\nimport { useLicenseLimits } from '@strapi/admin/strapi-admin/ee';\nimport { Flex, IconButton, TFooter, Typography, Link, LinkButton } from '@strapi/design-system';\nimport { Pencil, Plus, Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink, useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { LimitsModal } from '../../components/LimitsModal';\nimport { CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME } from '../../constants';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { ContentType, useGetContentTypesQuery } from '../../services/content-manager';\n\nimport * as Layout from './components/Layout';\nimport { useReviewWorkflows } from './hooks/useReviewWorkflows';\n\nexport const ReviewWorkflowsListView = () => {\n const { formatMessage } = useIntl();\n const navigate = useNavigate();\n const { trackUsage } = useTracking();\n const [workflowToDelete, setWorkflowToDelete] = React.useState<string | null>(null);\n const [showLimitModal, setShowLimitModal] = React.useState<boolean>(false);\n const { data, isLoading: isLoadingModels } = useGetContentTypesQuery();\n const { meta, workflows, isLoading, delete: deleteAction } = useReviewWorkflows();\n const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions.settings?.['review-workflows']\n );\n const {\n allowedActions: { canCreate, canRead, canUpdate, canDelete },\n } = useRBAC(permissions);\n\n const limits = getFeature('review-workflows');\n const numberOfWorkflows = limits?.[CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME] as string;\n\n const handleDeleteWorkflow = (workflowId: string) => {\n setWorkflowToDelete(workflowId);\n };\n\n const toggleConfirmDeleteDialog = () => {\n setWorkflowToDelete(null);\n };\n\n const handleConfirmDeleteDialog = async () => {\n if (!workflowToDelete) return;\n\n await deleteAction(workflowToDelete);\n\n setWorkflowToDelete(null);\n };\n\n const handleCreateClick = (\n event: React.MouseEvent<HTMLButtonElement> & React.MouseEvent<HTMLAnchorElement>\n ) => {\n event.preventDefault();\n /**\n * If the current license has a workflow limit:\n * check if the total count of workflows exceeds that limit. If so,\n * prevent the navigation and show the limits overlay.\n *\n * If the current license does not have a limit (e.g. offline license):\n * allow the user to navigate to the create-view. In case they exceed the\n * current hard-limit of 200 they will see an error thrown by the API.\n */\n\n if (numberOfWorkflows && meta && meta?.workflowCount >= parseInt(numberOfWorkflows, 10)) {\n event.preventDefault();\n setShowLimitModal(true);\n } else {\n navigate('create');\n trackUsage('willCreateWorkflow');\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 (!isLoading && !isLicenseLoading) {\n if (numberOfWorkflows && meta && meta?.workflowCount > parseInt(numberOfWorkflows, 10)) {\n setShowLimitModal(true);\n }\n }\n }, [isLicenseLoading, isLoading, meta, meta?.workflowCount, numberOfWorkflows]);\n\n const headers = [\n {\n label: formatMessage({\n id: 'Settings.review-workflows.list.page.list.column.name.title',\n defaultMessage: 'Name',\n }),\n name: 'name',\n },\n {\n label: formatMessage({\n id: 'Settings.review-workflows.list.page.list.column.stages.title',\n defaultMessage: 'Stages',\n }),\n name: 'stages',\n },\n {\n label: formatMessage({\n id: 'Settings.review-workflows.list.page.list.column.contentTypes.title',\n defaultMessage: 'Content Types',\n }),\n name: 'content-types',\n },\n ];\n\n if (isLoading || isLoadingModels) {\n return <Page.Loading />;\n }\n\n const contentTypes = Object.values(data ?? {}).reduce<ContentType[]>((acc, curr) => {\n acc.push(...curr);\n return acc;\n }, []);\n\n return (\n <>\n <Layout.Header\n primaryAction={\n canCreate ? (\n <LinkButton\n startIcon={<Plus />}\n size=\"S\"\n tag={NavLink}\n to=\"create\"\n onClick={handleCreateClick}\n >\n {formatMessage({\n id: 'Settings.review-workflows.list.page.create',\n defaultMessage: 'Create new workflow',\n })}\n </LinkButton>\n ) : null\n }\n subtitle={formatMessage({\n id: 'Settings.review-workflows.list.page.subtitle',\n defaultMessage: 'Manage your content review process',\n })}\n title={formatMessage({\n id: 'Settings.review-workflows.list.page.title',\n defaultMessage: 'Review Workflows',\n })}\n />\n\n <Layout.Root>\n <Table.Root\n isLoading={isLoading}\n rows={workflows}\n footer={\n canCreate ? (\n <TFooter icon={<Plus />} onClick={handleCreateClick}>\n {formatMessage({\n id: 'Settings.review-workflows.list.page.create',\n defaultMessage: 'Create new workflow',\n })}\n </TFooter>\n ) : null\n }\n headers={headers}\n >\n <Table.Content>\n <Table.Head>\n {headers.map((head) => (\n <Table.HeaderCell key={head.name} {...head} />\n ))}\n </Table.Head>\n\n <Table.Body>\n {workflows.map((workflow) => (\n <Table.Row\n onClick={() => {\n navigate(`${workflow.id}`);\n }}\n key={workflow.id}\n >\n <Table.Cell width=\"25rem\">\n <Typography textColor=\"neutral800\" fontWeight=\"bold\" ellipsis>\n {workflow.name}\n </Typography>\n </Table.Cell>\n <Table.Cell>\n <Typography textColor=\"neutral800\">{workflow.stages.length}</Typography>\n </Table.Cell>\n <Table.Cell>\n <Typography textColor=\"neutral800\">\n {workflow.contentTypes\n .map((uid: string) => {\n const contentType = contentTypes.find(\n (contentType) => contentType.uid === uid\n );\n\n return contentType?.info.displayName ?? '';\n })\n .join(', ')}\n </Typography>\n </Table.Cell>\n <Table.Cell>\n <Flex alignItems=\"center\" justifyContent=\"end\">\n {canRead || canUpdate ? (\n <ActionLink\n to={`${workflow.id}`}\n aria-label={formatMessage(\n {\n id: 'Settings.review-workflows.list.page.list.column.actions.edit.label',\n defaultMessage: 'Edit {name}',\n },\n { name: workflow.name }\n )}\n >\n <Pencil />\n </ActionLink>\n ) : null}\n {workflows.length > 1 && canDelete ? (\n <IconButton\n aria-label={formatMessage(\n {\n id: 'Settings.review-workflows.list.page.list.column.actions.delete.label',\n defaultMessage: 'Delete {name}',\n },\n { name: 'Default workflow' }\n )}\n icon={<Trash />}\n borderWidth={0}\n onClick={(e) => {\n e.stopPropagation();\n handleDeleteWorkflow(String(workflow.id));\n }}\n />\n ) : null}\n </Flex>\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Content>\n </Table.Root>\n\n <ConfirmDialog\n isOpen={!!workflowToDelete}\n onClose={toggleConfirmDeleteDialog}\n onConfirm={handleConfirmDeleteDialog}\n >\n {formatMessage({\n id: 'Settings.review-workflows.list.page.delete.confirm.body',\n defaultMessage:\n 'If you remove this worfklow, all stage-related information will be removed for this content-type. Are you sure you want to remove it?',\n })}\n </ConfirmDialog>\n\n <LimitsModal.Root isOpen={showLimitModal} onClose={() => setShowLimitModal(false)}>\n <LimitsModal.Title>\n {formatMessage({\n id: 'Settings.review-workflows.list.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: 'Settings.review-workflows.list.page.workflows.limit.body',\n defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.',\n })}\n </LimitsModal.Body>\n </LimitsModal.Root>\n </Layout.Root>\n </>\n );\n};\n\nconst ActionLink = styled(Link)`\n align-items: center;\n display: flex;\n justify-content: center;\n padding: ${({ theme }) => `${theme.spaces[2]}}`};\n & > span {\n line-height: 1rem;\n font-size: 1rem;\n }\n\n & svg > path {\n fill: ${({ theme }) => theme.colors.neutral500};\n }\n\n &:hover,\n &:focus {\n svg > path {\n fill: ${({ theme }) => theme.colors.neutral800};\n }\n }\n`;\n\nconst ProtectedListPage = () => {\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions.settings?.['review-workflows']?.main\n );\n\n return (\n <Page.Protect permissions={permissions}>\n <ReviewWorkflowsListView />\n </Page.Protect>\n );\n};\n\nexport { ProtectedListPage };\n"],"names":["useIntl","useNavigate","useTracking","React","useGetContentTypesQuery","useReviewWorkflows","useLicenseLimits","useTypedSelector","useRBAC","CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME","jsx","Page","jsxs","Fragment","Layout.Header","LinkButton","Plus","NavLink","Layout.Root","Table","TFooter","Typography","contentType","Flex","Pencil","IconButton","Trash","ConfirmDialog","LimitsModal","styled","Link"],"mappings":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;;;"}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { LinkButton } from "@strapi/design-system
|
|
4
|
-
import {
|
|
2
|
+
import { Layouts } from "@strapi/admin/strapi-admin";
|
|
3
|
+
import { Main, Box, EmptyStateLayout, LinkButton } from "@strapi/design-system";
|
|
4
|
+
import { ExternalLink } from "@strapi/icons";
|
|
5
|
+
import { EmptyPermissions } from "@strapi/icons/symbols";
|
|
5
6
|
import { useIntl } from "react-intl";
|
|
6
7
|
const PurchaseReviewWorkflows = () => {
|
|
7
8
|
const { formatMessage } = useIntl();
|
|
8
|
-
return /* @__PURE__ */ jsx(
|
|
9
|
+
return /* @__PURE__ */ jsx(Layouts.Root, { children: /* @__PURE__ */ jsxs(Main, { children: [
|
|
9
10
|
/* @__PURE__ */ jsx(
|
|
10
|
-
|
|
11
|
+
Layouts.Header,
|
|
11
12
|
{
|
|
12
13
|
title: formatMessage({
|
|
13
14
|
id: "Settings.review-workflows.list.page.title",
|
|
@@ -22,7 +23,7 @@ const PurchaseReviewWorkflows = () => {
|
|
|
22
23
|
/* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children: /* @__PURE__ */ jsx(
|
|
23
24
|
EmptyStateLayout,
|
|
24
25
|
{
|
|
25
|
-
icon: /* @__PURE__ */ jsx(EmptyPermissions, { width: "
|
|
26
|
+
icon: /* @__PURE__ */ jsx(EmptyPermissions, { width: "16rem" }),
|
|
26
27
|
content: formatMessage({
|
|
27
28
|
id: "Settings.review-workflows.not-available",
|
|
28
29
|
defaultMessage: "Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows."
|
|
@@ -48,4 +49,4 @@ const PurchaseReviewWorkflows = () => {
|
|
|
48
49
|
export {
|
|
49
50
|
PurchaseReviewWorkflows
|
|
50
51
|
};
|
|
51
|
-
//# sourceMappingURL=purchase-review-workflows-
|
|
52
|
+
//# sourceMappingURL=purchase-review-workflows-BN-5Ube7.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchase-review-workflows-BN-5Ube7.mjs","sources":["../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Layouts } from '@strapi/admin/strapi-admin';\nimport { Box, Main, EmptyStateLayout, LinkButton } from '@strapi/design-system';\nimport { ExternalLink } from '@strapi/icons';\nimport { EmptyPermissions } from '@strapi/icons/symbols';\nimport { useIntl } from 'react-intl';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Layouts.Root>\n <Main>\n <Layouts.Header\n title={formatMessage({\n id: 'Settings.review-workflows.list.page.title',\n defaultMessage: 'Review Workflows',\n })}\n subtitle={formatMessage({\n id: 'Settings.review-workflows.list.page.subtitle',\n defaultMessage: 'Manage your content review process',\n })}\n />\n <Box paddingLeft={10} paddingRight={10}>\n <EmptyStateLayout\n icon={<EmptyPermissions width=\"16rem\" />}\n content={formatMessage({\n id: 'Settings.review-workflows.not-available',\n defaultMessage:\n 'Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows.',\n })}\n action={\n <LinkButton\n variant=\"default\"\n endIcon={<ExternalLink />}\n href=\"https://strp.cc/3tdNfJq\"\n isExternal\n target=\"_blank\"\n >\n {formatMessage({\n id: 'global.learn-more',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n }\n />\n </Box>\n </Main>\n </Layouts.Root>\n );\n};\n\nexport { PurchaseReviewWorkflows };\n"],"names":[],"mappings":";;;;;;AAMA,MAAM,0BAA0B,MAAM;AAC9B,QAAA,EAAE,kBAAkB;AAE1B,SACG,oBAAA,QAAQ,MAAR,EACC,+BAAC,MACC,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC,QAAQ;AAAA,MAAR;AAAA,QACC,OAAO,cAAc;AAAA,UACnB,IAAI;AAAA,UACJ,gBAAgB;AAAA,QAAA,CACjB;AAAA,QACD,UAAU,cAAc;AAAA,UACtB,IAAI;AAAA,UACJ,gBAAgB;AAAA,QAAA,CACjB;AAAA,MAAA;AAAA,IACH;AAAA,IACC,oBAAA,KAAA,EAAI,aAAa,IAAI,cAAc,IAClC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAM,oBAAC,kBAAiB,EAAA,OAAM,QAAQ,CAAA;AAAA,QACtC,SAAS,cAAc;AAAA,UACrB,IAAI;AAAA,UACJ,gBACE;AAAA,QAAA,CACH;AAAA,QACD,QACE;AAAA,UAAC;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,6BAAU,cAAa,EAAA;AAAA,YACvB,MAAK;AAAA,YACL,YAAU;AAAA,YACV,QAAO;AAAA,YAEN,UAAc,cAAA;AAAA,cACb,IAAI;AAAA,cACJ,gBAAgB;AAAA,YAAA,CACjB;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;"}
|
package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-DlCDg0fD.js}
RENAMED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
4
5
|
const designSystem = require("@strapi/design-system");
|
|
5
|
-
const v2 = require("@strapi/design-system/v2");
|
|
6
6
|
const icons = require("@strapi/icons");
|
|
7
|
+
const symbols = require("@strapi/icons/symbols");
|
|
7
8
|
const reactIntl = require("react-intl");
|
|
8
9
|
const PurchaseReviewWorkflows = () => {
|
|
9
10
|
const { formatMessage } = reactIntl.useIntl();
|
|
10
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
|
|
11
12
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12
|
-
|
|
13
|
+
strapiAdmin.Layouts.Header,
|
|
13
14
|
{
|
|
14
15
|
title: formatMessage({
|
|
15
16
|
id: "Settings.review-workflows.list.page.title",
|
|
@@ -24,13 +25,13 @@ const PurchaseReviewWorkflows = () => {
|
|
|
24
25
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
25
26
|
designSystem.EmptyStateLayout,
|
|
26
27
|
{
|
|
27
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
28
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyPermissions, { width: "16rem" }),
|
|
28
29
|
content: formatMessage({
|
|
29
30
|
id: "Settings.review-workflows.not-available",
|
|
30
31
|
defaultMessage: "Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows."
|
|
31
32
|
}),
|
|
32
33
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
-
|
|
34
|
+
designSystem.LinkButton,
|
|
34
35
|
{
|
|
35
36
|
variant: "default",
|
|
36
37
|
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {}),
|
|
@@ -48,4 +49,4 @@ const PurchaseReviewWorkflows = () => {
|
|
|
48
49
|
] }) });
|
|
49
50
|
};
|
|
50
51
|
exports.PurchaseReviewWorkflows = PurchaseReviewWorkflows;
|
|
51
|
-
//# sourceMappingURL=purchase-review-workflows-
|
|
52
|
+
//# sourceMappingURL=purchase-review-workflows-DlCDg0fD.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purchase-review-workflows-DlCDg0fD.js","sources":["../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Layouts } from '@strapi/admin/strapi-admin';\nimport { Box, Main, EmptyStateLayout, LinkButton } from '@strapi/design-system';\nimport { ExternalLink } from '@strapi/icons';\nimport { EmptyPermissions } from '@strapi/icons/symbols';\nimport { useIntl } from 'react-intl';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Layouts.Root>\n <Main>\n <Layouts.Header\n title={formatMessage({\n id: 'Settings.review-workflows.list.page.title',\n defaultMessage: 'Review Workflows',\n })}\n subtitle={formatMessage({\n id: 'Settings.review-workflows.list.page.subtitle',\n defaultMessage: 'Manage your content review process',\n })}\n />\n <Box paddingLeft={10} paddingRight={10}>\n <EmptyStateLayout\n icon={<EmptyPermissions width=\"16rem\" />}\n content={formatMessage({\n id: 'Settings.review-workflows.not-available',\n defaultMessage:\n 'Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows.',\n })}\n action={\n <LinkButton\n variant=\"default\"\n endIcon={<ExternalLink />}\n href=\"https://strp.cc/3tdNfJq\"\n isExternal\n target=\"_blank\"\n >\n {formatMessage({\n id: 'global.learn-more',\n defaultMessage: 'Learn more',\n })}\n </LinkButton>\n }\n />\n </Box>\n </Main>\n </Layouts.Root>\n );\n};\n\nexport { PurchaseReviewWorkflows };\n"],"names":["useIntl","jsx","Layouts","Main","Box","EmptyStateLayout","EmptyPermissions","LinkButton","ExternalLink"],"mappings":";;;;;;;;AAMA,MAAM,0BAA0B,MAAM;AAC9B,QAAA,EAAE,kBAAkBA,UAAAA;AAE1B,SACGC,2BAAA,IAAAC,YAAA,QAAQ,MAAR,EACC,0CAACC,aAAAA,MACC,EAAA,UAAA;AAAA,IAAAF,2BAAA;AAAA,MAACC,YAAAA,QAAQ;AAAA,MAAR;AAAA,QACC,OAAO,cAAc;AAAA,UACnB,IAAI;AAAA,UACJ,gBAAgB;AAAA,QAAA,CACjB;AAAA,QACD,UAAU,cAAc;AAAA,UACtB,IAAI;AAAA,UACJ,gBAAgB;AAAA,QAAA,CACjB;AAAA,MAAA;AAAA,IACH;AAAA,IACCD,2BAAA,IAAAG,aAAA,KAAA,EAAI,aAAa,IAAI,cAAc,IAClC,UAAAH,2BAAA;AAAA,MAACI,aAAA;AAAA,MAAA;AAAA,QACC,MAAMJ,2BAAAA,IAACK,QAAAA,kBAAiB,EAAA,OAAM,QAAQ,CAAA;AAAA,QACtC,SAAS,cAAc;AAAA,UACrB,IAAI;AAAA,UACJ,gBACE;AAAA,QAAA,CACH;AAAA,QACD,QACEL,2BAAA;AAAA,UAACM,aAAA;AAAA,UAAA;AAAA,YACC,SAAQ;AAAA,YACR,wCAAUC,MAAa,cAAA,EAAA;AAAA,YACvB,MAAK;AAAA,YACL,YAAU;AAAA,YACV,QAAO;AAAA,YAEN,UAAc,cAAA;AAAA,cACb,IAAI;AAAA,cACJ,gBAAgB;AAAA,YAAA,CACjB;AAAA,UAAA;AAAA,QACH;AAAA,MAAA;AAAA,IAAA,GAGN;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAEJ;;"}
|
|
@@ -4,10 +4,10 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
6
|
const ProtectedListPage = React.lazy(
|
|
7
|
-
() => Promise.resolve().then(() => require("./index-
|
|
7
|
+
() => Promise.resolve().then(() => require("./index-DnXnsrOM.js")).then((mod) => ({ default: mod.ProtectedListPage }))
|
|
8
8
|
);
|
|
9
9
|
const ProtectedEditPage = React.lazy(
|
|
10
|
-
() => Promise.resolve().then(() => require("./_id-
|
|
10
|
+
() => Promise.resolve().then(() => require("./_id-BO7wNLt1.js")).then((mod) => ({ default: mod.ProtectedEditPage }))
|
|
11
11
|
);
|
|
12
12
|
const routes = [
|
|
13
13
|
{
|
|
@@ -21,4 +21,4 @@ const routes = [
|
|
|
21
21
|
];
|
|
22
22
|
const Router = () => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: routes.map((route) => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { ...route }, route.path)) });
|
|
23
23
|
exports.Router = Router;
|
|
24
|
-
//# sourceMappingURL=router-
|
|
24
|
+
//# sourceMappingURL=router-BiQI7EcM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-
|
|
1
|
+
{"version":3,"file":"router-BiQI7EcM.js","sources":["../../admin/src/router.tsx"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport { lazy } from 'react';\n\nimport { Routes, Route, PathRouteProps } from 'react-router-dom';\n\nconst ProtectedListPage = lazy(() =>\n import('./routes/settings').then((mod) => ({ default: mod.ProtectedListPage }))\n);\nconst ProtectedEditPage = lazy(() =>\n import('./routes/settings/:id').then((mod) => ({ default: mod.ProtectedEditPage }))\n);\n\nconst routes: PathRouteProps[] = [\n {\n path: '/',\n Component: ProtectedListPage,\n },\n {\n path: ':id',\n Component: ProtectedEditPage,\n },\n];\n\nconst Router = () => (\n <Routes>\n {routes.map((route) => (\n <Route key={route.path} {...route} />\n ))}\n </Routes>\n);\n\nexport { Router };\n"],"names":["lazy","jsx","Routes","Route"],"mappings":";;;;;AAKA,MAAM,oBAAoBA,MAAA;AAAA,EAAK,MAC7B,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,qBAAmB,GAAE,KAAK,CAAC,SAAS,EAAE,SAAS,IAAI,kBAAA,EAAoB;AAChF;AACA,MAAM,oBAAoBA,MAAA;AAAA,EAAK,MAC7B,QAAO,QAAA,EAAA,KAAA,MAAA,QAAA,mBAAuB,GAAE,KAAK,CAAC,SAAS,EAAE,SAAS,IAAI,kBAAA,EAAoB;AACpF;AAEA,MAAM,SAA2B;AAAA,EAC/B;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AACF;AAEA,MAAM,SAAS,MACZC,2BAAAA,IAAAC,eAAAA,QAAA,EACE,iBAAO,IAAI,CAAC,UACXD,2BAAA,IAACE,wBAAwB,GAAG,MAAA,GAAhB,MAAM,IAAiB,CACpC,EACH,CAAA;;"}
|
|
@@ -2,10 +2,10 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { lazy } from "react";
|
|
3
3
|
import { Routes, Route } from "react-router-dom";
|
|
4
4
|
const ProtectedListPage = lazy(
|
|
5
|
-
() => import("./index-
|
|
5
|
+
() => import("./index-DhEhUlv9.mjs").then((mod) => ({ default: mod.ProtectedListPage }))
|
|
6
6
|
);
|
|
7
7
|
const ProtectedEditPage = lazy(
|
|
8
|
-
() => import("./_id-
|
|
8
|
+
() => import("./_id-UJ-8gken.mjs").then((mod) => ({ default: mod.ProtectedEditPage }))
|
|
9
9
|
);
|
|
10
10
|
const routes = [
|
|
11
11
|
{
|
|
@@ -21,4 +21,4 @@ const Router = () => /* @__PURE__ */ jsx(Routes, { children: routes.map((route)
|
|
|
21
21
|
export {
|
|
22
22
|
Router
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=router-
|
|
24
|
+
//# sourceMappingURL=router-DFD0S0ey.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"router-
|
|
1
|
+
{"version":3,"file":"router-DFD0S0ey.mjs","sources":["../../admin/src/router.tsx"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport { lazy } from 'react';\n\nimport { Routes, Route, PathRouteProps } from 'react-router-dom';\n\nconst ProtectedListPage = lazy(() =>\n import('./routes/settings').then((mod) => ({ default: mod.ProtectedListPage }))\n);\nconst ProtectedEditPage = lazy(() =>\n import('./routes/settings/:id').then((mod) => ({ default: mod.ProtectedEditPage }))\n);\n\nconst routes: PathRouteProps[] = [\n {\n path: '/',\n Component: ProtectedListPage,\n },\n {\n path: ':id',\n Component: ProtectedEditPage,\n },\n];\n\nconst Router = () => (\n <Routes>\n {routes.map((route) => (\n <Route key={route.path} {...route} />\n ))}\n </Routes>\n);\n\nexport { Router };\n"],"names":[],"mappings":";;;AAKA,MAAM,oBAAoB;AAAA,EAAK,MAC7B,OAAO,sBAAmB,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,IAAI,kBAAA,EAAoB;AAChF;AACA,MAAM,oBAAoB;AAAA,EAAK,MAC7B,OAAO,oBAAuB,EAAE,KAAK,CAAC,SAAS,EAAE,SAAS,IAAI,kBAAA,EAAoB;AACpF;AAEA,MAAM,SAA2B;AAAA,EAC/B;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,WAAW;AAAA,EACb;AACF;AAEA,MAAM,SAAS,MACZ,oBAAA,QAAA,EACE,iBAAO,IAAI,CAAC,UACX,oBAAC,SAAwB,GAAG,MAAA,GAAhB,MAAM,IAAiB,CACpC,EACH,CAAA;"}
|
package/dist/admin/index.js
CHANGED
package/dist/admin/index.mjs
CHANGED
|
@@ -23,15 +23,15 @@ interface UseDragAndDropOptions<TIndex extends number | Array<number> = number,
|
|
|
23
23
|
dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];
|
|
24
24
|
}
|
|
25
25
|
type Identifier = ReturnType<HandlerManager['getHandlerId']>;
|
|
26
|
-
type UseDragAndDropReturn<
|
|
26
|
+
type UseDragAndDropReturn<E extends Element = HTMLElement> = [
|
|
27
27
|
props: {
|
|
28
28
|
handlerId: Identifier;
|
|
29
29
|
isDragging: boolean;
|
|
30
|
-
handleKeyDown: (event: React.KeyboardEvent<
|
|
30
|
+
handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;
|
|
31
31
|
isOverDropTarget: boolean;
|
|
32
32
|
direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;
|
|
33
33
|
},
|
|
34
|
-
objectRef: React.RefObject<
|
|
34
|
+
objectRef: React.RefObject<E>,
|
|
35
35
|
dropRef: ConnectDropTarget,
|
|
36
36
|
dragRef: ConnectDragSource,
|
|
37
37
|
dragPreviewRef: ConnectDragPreview
|
|
@@ -47,5 +47,5 @@ declare const useDragAndDrop: <TIndex extends number | number[], TItem extends {
|
|
|
47
47
|
} = {
|
|
48
48
|
[key: string]: unknown;
|
|
49
49
|
index: TIndex;
|
|
50
|
-
},
|
|
50
|
+
}, E extends Element = HTMLElement>(active: boolean, { type, index, item, onStart, onEnd, onGrabItem, onDropItem, onCancel, onMoveItem, dropSensitivity, }: UseDragAndDropOptions<TIndex, TItem>) => UseDragAndDropReturn<E>;
|
|
51
51
|
export { useDragAndDrop, UseDragAndDropReturn, UseDragAndDropOptions, DIRECTIONS, DROP_SENSITIVITY, };
|
|
@@ -11,4 +11,4 @@ export type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number
|
|
|
11
11
|
*
|
|
12
12
|
* @internal - You should use `useDragAndDrop` instead.
|
|
13
13
|
*/
|
|
14
|
-
export declare const useKeyboardDragAndDrop: <TIndex extends number | number[] = number>(active: boolean, index: TIndex, { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>) => React.
|
|
14
|
+
export declare const useKeyboardDragAndDrop: <TIndex extends number | number[] = number>(active: boolean, index: TIndex, { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>) => <E extends Element>(e: React.KeyboardEvent<E>) => void;
|
|
@@ -9,17 +9,17 @@ declare const useReviewWorkflows: (params?: UseReviewWorkflowsArgs) => {
|
|
|
9
9
|
} | undefined;
|
|
10
10
|
workflows: import("../../../../../shared/contracts/review-workflows").Workflow[];
|
|
11
11
|
isLoading: boolean;
|
|
12
|
-
error: import("../../../utils/api").BaseQueryError |
|
|
12
|
+
error: import("../../../utils/api").BaseQueryError | undefined;
|
|
13
13
|
create: (data: Create.Request['body']['data']) => Promise<{
|
|
14
14
|
data: import("../../../../../shared/contracts/review-workflows").Workflow;
|
|
15
15
|
} | {
|
|
16
|
-
error: import("../../../utils/api").BaseQueryError
|
|
16
|
+
error: import("../../../utils/api").BaseQueryError;
|
|
17
17
|
}>;
|
|
18
18
|
delete: (id: string) => Promise<import("../../../../../shared/contracts/review-workflows").Workflow | undefined>;
|
|
19
19
|
update: (id: string, data: Update.Request['body']['data']) => Promise<{
|
|
20
20
|
data: import("../../../../../shared/contracts/review-workflows").Workflow;
|
|
21
21
|
} | {
|
|
22
|
-
error: import("../../../utils/api").BaseQueryError
|
|
22
|
+
error: import("../../../utils/api").BaseQueryError;
|
|
23
23
|
}>;
|
|
24
24
|
};
|
|
25
25
|
export { useReviewWorkflows };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GetStages, UpdateStage, UpdateAssignee } from '../../../shared/contracts/review-workflows';
|
|
2
|
-
import type { Contracts } from '@strapi/
|
|
2
|
+
import type { Contracts } from '@strapi/content-manager/_internal/shared';
|
|
3
3
|
type ContentType = Contracts.ContentTypes.ContentType;
|
|
4
4
|
interface ContentTypes {
|
|
5
5
|
collectionType: ContentType[];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { SerializedError } from '@reduxjs/toolkit';
|
|
2
2
|
import { BaseQueryFn } from '@reduxjs/toolkit/query';
|
|
3
|
-
import { ApiError } from '@strapi/admin/strapi-admin';
|
|
4
|
-
import { type AxiosRequestConfig } from 'axios';
|
|
3
|
+
import { type ApiError, type FetchOptions } from '@strapi/admin/strapi-admin';
|
|
5
4
|
export interface QueryArguments {
|
|
6
5
|
url: string;
|
|
7
|
-
method?:
|
|
8
|
-
data?:
|
|
9
|
-
config?:
|
|
6
|
+
method?: string;
|
|
7
|
+
data?: unknown;
|
|
8
|
+
config?: FetchOptions;
|
|
10
9
|
}
|
|
11
10
|
export interface UnknownApiError {
|
|
12
11
|
name: 'UnknownError';
|
|
@@ -14,9 +13,9 @@ export interface UnknownApiError {
|
|
|
14
13
|
details?: unknown;
|
|
15
14
|
status?: number;
|
|
16
15
|
}
|
|
17
|
-
export type BaseQueryError = ApiError | UnknownApiError;
|
|
18
|
-
declare const
|
|
19
|
-
declare const isBaseQueryError: (error: BaseQueryError
|
|
16
|
+
export type BaseQueryError = ApiError | UnknownApiError | SerializedError;
|
|
17
|
+
declare const fetchBaseQuery: () => BaseQueryFn<string | QueryArguments, unknown, BaseQueryError>;
|
|
18
|
+
declare const isBaseQueryError: (error: BaseQueryError) => error is UnknownApiError | ApiError;
|
|
20
19
|
interface Query {
|
|
21
20
|
plugins?: Record<string, unknown>;
|
|
22
21
|
_q?: string;
|
|
@@ -35,4 +34,4 @@ type TransformedQuery<TQuery extends Query> = Omit<TQuery, 'plugins'> & {
|
|
|
35
34
|
* ie. plugins[18n][locale]=en becomes locale=en
|
|
36
35
|
*/
|
|
37
36
|
declare const buildValidParams: <TQuery extends Query>(query: TQuery) => TransformedQuery<TQuery>;
|
|
38
|
-
export {
|
|
37
|
+
export { fetchBaseQuery, isBaseQueryError, buildValidParams };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ListFieldLayout, ListLayout } from '@strapi/
|
|
1
|
+
import type { ListFieldLayout, ListLayout } from '@strapi/content-manager/strapi-admin';
|
|
2
2
|
interface AddColumnToTableHookArgs {
|
|
3
3
|
layout: ListLayout;
|
|
4
4
|
displayedHeaders: ListFieldLayout[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/review-workflows",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.7",
|
|
4
4
|
"description": "Review workflows for your content",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -53,10 +53,9 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@reduxjs/toolkit": "1.9.7",
|
|
56
|
-
"@strapi/design-system": "
|
|
57
|
-
"@strapi/icons": "
|
|
56
|
+
"@strapi/design-system": "2.0.0-beta.3",
|
|
57
|
+
"@strapi/icons": "2.0.0-beta.3",
|
|
58
58
|
"@strapi/utils": "5.0.0-beta.1",
|
|
59
|
-
"axios": "1.6.8",
|
|
60
59
|
"fractional-indexing": "3.2.0",
|
|
61
60
|
"react-dnd": "16.0.1",
|
|
62
61
|
"react-dnd-html5-backend": "16.0.1",
|
|
@@ -66,25 +65,25 @@
|
|
|
66
65
|
"yup": "0.32.9"
|
|
67
66
|
},
|
|
68
67
|
"devDependencies": {
|
|
69
|
-
"@strapi/admin": "5.0.0-beta.
|
|
68
|
+
"@strapi/admin": "5.0.0-beta.7",
|
|
69
|
+
"@strapi/content-manager": "5.0.0-beta.7",
|
|
70
70
|
"@strapi/pack-up": "5.0.0",
|
|
71
|
-
"@strapi/
|
|
72
|
-
"@strapi/
|
|
73
|
-
"@strapi/utils": "5.0.0-beta.4",
|
|
71
|
+
"@strapi/types": "5.0.0-beta.7",
|
|
72
|
+
"@strapi/utils": "5.0.0-beta.6",
|
|
74
73
|
"@testing-library/react": "14.0.0",
|
|
75
74
|
"msw": "1.3.0",
|
|
76
75
|
"react": "^18.2.0",
|
|
77
76
|
"react-dom": "^18.2.0",
|
|
78
77
|
"react-router-dom": "6.22.3",
|
|
79
|
-
"styled-components": "
|
|
78
|
+
"styled-components": "6.1.8"
|
|
80
79
|
},
|
|
81
80
|
"peerDependencies": {
|
|
82
81
|
"@strapi/admin": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
83
|
-
"@strapi/
|
|
82
|
+
"@strapi/content-manager": "^5.0.0 || ^5.0.0-beta || ^5.0.0-alpha || ^5.0.0-rc",
|
|
84
83
|
"react": "^17.0.0 || ^18.0.0",
|
|
85
84
|
"react-dom": "^17.0.0 || ^18.0.0",
|
|
86
85
|
"react-router-dom": "^6.0.0",
|
|
87
|
-
"styled-components": "^
|
|
86
|
+
"styled-components": "^6.0.0"
|
|
88
87
|
},
|
|
89
88
|
"engines": {
|
|
90
89
|
"node": ">=18.0.0 <=20.x.x",
|
|
@@ -97,5 +96,5 @@
|
|
|
97
96
|
"displayName": "Review Workflows",
|
|
98
97
|
"required": true
|
|
99
98
|
},
|
|
100
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "a86c75effabb5eb8aa36a2e9563f2878ddfbb4c1"
|
|
101
100
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout-dGg4FA1R.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 { CarretDown } 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={`${300 / 16}rem`}\n >\n <Toggle\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CarretDown width={`${8 / 16}rem`} />\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","CarretDown","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;AAA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AAAJ,2BAAA;AAAA,IAACK,aAAA;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,0CAACA,aAAI,KAAA,EAAA,OAAO,SAAS,eAAe,eAAe,WAAW,GAC5D,UAAA;AAAA,QAACL,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;AAChE,wCACGM,YAAAA,KAAK,MAAL,EACC,UAACN,+BAAAO,aAAAA,eAAA,EAAe,UAAS,EAC3B,CAAA;AAEJ;AAUA,MAAM,SAAgC,CAAC,EAAE,OAAO,UAAU,kBAAkB,oBAAoB;AACxF,QAAA,EAAE,kBAAkBlB,UAAAA;AAC1B,SAEIS,2BAAA,KAAAU,qBAAA,EAAA,UAAA;AAAA,IAACR,2BAAAA,IAAAM,YAAA,KAAK,OAAL,EACE,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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Layout-facLKucY.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 { CarretDown } 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={`${300 / 16}rem`}\n >\n <Toggle\n alignItems=\"center\"\n background=\"neutral200\"\n borderRadius=\"50%\"\n height={6}\n justifyContent=\"center\"\n width={6}\n >\n <CarretDown width={`${8 / 16}rem`} />\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,OAAO,GAAG,YAAgB,IAAA;AAElD,QAAM,EAAE,MAAM,WAAW,MAAU,IAAA;AAAA,IACjC;AAAA,MACE;AAAA,MACA,UAAU;AAAA,MACV,GAAG;AAAA,IACL;AAAA,IACA;AAAA,MACE;AAAA,IACF;AAAA,EAAA;AAGF,QAAM,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,IAAI;AACzB,QAAM,SAAS,MAAM;AAAA,IACnB,OAAOA,UAAyC;AAC1C,UAAA;AACF,cAAM,MAAM,MAAM,eAAe,EAAE,MAAAA,MAAM,CAAA;AAEzC,YAAI,WAAW,KAAK;AACC,6BAAA;AAAA,YACjB,MAAM;AAAA,YACN,SAAS,eAA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