@strapi/review-workflows 0.0.0-experimental.826f263c58b6886b849d3f03b81f7a530bc51c91 → 0.0.0-experimental.82afe56cecefd0078d534e25909834ecf5fdd404

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/LICENSE +12 -17
  2. package/dist/_chunks/{Layout-BMqtFafC.js → Layout-C3IORH2n.js} +10 -12
  3. package/dist/_chunks/Layout-C3IORH2n.js.map +1 -0
  4. package/dist/_chunks/{Layout-lg3hbwGL.mjs → Layout-DNKR5bym.mjs} +9 -10
  5. package/dist/_chunks/Layout-DNKR5bym.mjs.map +1 -0
  6. package/dist/_chunks/{en-xcewH2pC.js → en-CYgjfSep.js} +5 -2
  7. package/dist/_chunks/en-CYgjfSep.js.map +1 -0
  8. package/dist/_chunks/{en-D9ZrQAV6.mjs → en-D9dxziEb.mjs} +5 -2
  9. package/dist/_chunks/en-D9dxziEb.mjs.map +1 -0
  10. package/dist/_chunks/{_id-B3jMqqMH.mjs → id-C9Ku9Br9.mjs} +202 -179
  11. package/dist/_chunks/id-C9Ku9Br9.mjs.map +1 -0
  12. package/dist/_chunks/{_id-B853wt9z.js → id-oOE1bYls.js} +202 -180
  13. package/dist/_chunks/id-oOE1bYls.js.map +1 -0
  14. package/dist/_chunks/{index-lebOqdrv.mjs → index-ByXbOW-R.mjs} +120 -104
  15. package/dist/_chunks/index-ByXbOW-R.mjs.map +1 -0
  16. package/dist/_chunks/{index-CdU1x9cZ.js → index-CmHHjN95.js} +17 -47
  17. package/dist/_chunks/index-CmHHjN95.js.map +1 -0
  18. package/dist/_chunks/{index-BhJmjDbj.mjs → index-CyhaJuJG.mjs} +18 -47
  19. package/dist/_chunks/index-CyhaJuJG.mjs.map +1 -0
  20. package/dist/_chunks/{index-Ujtj1Rcp.js → index-DMT27jNE.js} +119 -104
  21. package/dist/_chunks/index-DMT27jNE.js.map +1 -0
  22. package/dist/_chunks/{purchase-review-workflows-DlCDg0fD.js → purchase-review-workflows-BxoDFxQ5.js} +2 -2
  23. package/dist/_chunks/purchase-review-workflows-BxoDFxQ5.js.map +1 -0
  24. package/dist/_chunks/{purchase-review-workflows-BN-5Ube7.mjs → purchase-review-workflows-DyFV_H0I.mjs} +2 -2
  25. package/dist/_chunks/{purchase-review-workflows-BN-5Ube7.mjs.map → purchase-review-workflows-DyFV_H0I.mjs.map} +1 -1
  26. package/dist/_chunks/{router-CvMnSjb9.mjs → router-BPl2HZMq.mjs} +3 -3
  27. package/dist/_chunks/router-BPl2HZMq.mjs.map +1 -0
  28. package/dist/_chunks/{router-BboD243b.js → router-vDfGt9bq.js} +3 -3
  29. package/dist/_chunks/router-vDfGt9bq.js.map +1 -0
  30. package/dist/admin/index.js +1 -1
  31. package/dist/admin/index.mjs +1 -1
  32. package/dist/admin/src/components/LimitsModal.d.ts +2 -4
  33. package/dist/admin/src/services/admin.d.ts +1 -1
  34. package/dist/admin/src/services/api.d.ts +1 -1
  35. package/dist/admin/src/services/content-manager.d.ts +4 -4
  36. package/dist/admin/src/services/settings.d.ts +1739 -9
  37. package/dist/server/index.js +455 -628
  38. package/dist/server/index.js.map +1 -1
  39. package/dist/server/index.mjs +455 -628
  40. package/dist/server/index.mjs.map +1 -1
  41. package/dist/server/src/bootstrap.d.ts.map +1 -1
  42. package/dist/server/src/constants/workflows.d.ts +1 -0
  43. package/dist/server/src/constants/workflows.d.ts.map +1 -1
  44. package/dist/server/src/content-types/index.d.ts +6 -0
  45. package/dist/server/src/content-types/index.d.ts.map +1 -1
  46. package/dist/server/src/content-types/workflow/index.d.ts +6 -0
  47. package/dist/server/src/content-types/workflow/index.d.ts.map +1 -1
  48. package/dist/server/src/controllers/assignees.d.ts.map +1 -1
  49. package/dist/server/src/controllers/index.d.ts +0 -1
  50. package/dist/server/src/controllers/index.d.ts.map +1 -1
  51. package/dist/server/src/controllers/stages.d.ts.map +1 -1
  52. package/dist/server/src/controllers/workflows.d.ts +0 -7
  53. package/dist/server/src/controllers/workflows.d.ts.map +1 -1
  54. package/dist/server/src/index.d.ts +28 -7
  55. package/dist/server/src/index.d.ts.map +1 -1
  56. package/dist/server/src/register.d.ts.map +1 -1
  57. package/dist/server/src/routes/review-workflows.d.ts.map +1 -1
  58. package/dist/server/src/services/assignees.d.ts +8 -4
  59. package/dist/server/src/services/assignees.d.ts.map +1 -1
  60. package/dist/server/src/services/document-service-middleware.d.ts +1 -0
  61. package/dist/server/src/services/document-service-middleware.d.ts.map +1 -1
  62. package/dist/server/src/services/index.d.ts +16 -6
  63. package/dist/server/src/services/index.d.ts.map +1 -1
  64. package/dist/server/src/services/metrics/index.d.ts +4 -4
  65. package/dist/server/src/services/metrics/index.d.ts.map +1 -1
  66. package/dist/server/src/services/metrics/weekly-metrics.d.ts.map +1 -1
  67. package/dist/server/src/services/stages.d.ts +7 -7
  68. package/dist/server/src/services/stages.d.ts.map +1 -1
  69. package/dist/server/src/services/workflows.d.ts.map +1 -1
  70. package/dist/server/src/validation/review-workflows.d.ts +4 -0
  71. package/dist/server/src/validation/review-workflows.d.ts.map +1 -1
  72. package/dist/shared/contracts/review-workflows.d.ts +9 -17
  73. package/dist/shared/contracts/review-workflows.d.ts.map +1 -1
  74. package/package.json +12 -14
  75. package/dist/_chunks/Layout-BMqtFafC.js.map +0 -1
  76. package/dist/_chunks/Layout-lg3hbwGL.mjs.map +0 -1
  77. package/dist/_chunks/_id-B3jMqqMH.mjs.map +0 -1
  78. package/dist/_chunks/_id-B853wt9z.js.map +0 -1
  79. package/dist/_chunks/en-D9ZrQAV6.mjs.map +0 -1
  80. package/dist/_chunks/en-xcewH2pC.js.map +0 -1
  81. package/dist/_chunks/index-BhJmjDbj.mjs.map +0 -1
  82. package/dist/_chunks/index-CdU1x9cZ.js.map +0 -1
  83. package/dist/_chunks/index-Ujtj1Rcp.js.map +0 -1
  84. package/dist/_chunks/index-lebOqdrv.mjs.map +0 -1
  85. package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +0 -1
  86. package/dist/_chunks/router-BboD243b.js.map +0 -1
  87. package/dist/_chunks/router-CvMnSjb9.mjs.map +0 -1
  88. package/strapi-server.js +0 -3
  89. /package/dist/admin/src/routes/settings/{:id.d.ts → id.d.ts} +0 -0
@@ -8,12 +8,10 @@ const designSystem = require("@strapi/design-system");
8
8
  const icons = require("@strapi/icons");
9
9
  const reactIntl = require("react-intl");
10
10
  const reactRouterDom = require("react-router-dom");
11
- const styledComponents = require("styled-components");
12
- const index = require("./index-Ujtj1Rcp.js");
13
- const Layout = require("./Layout-BMqtFafC.js");
11
+ const index = require("./index-DMT27jNE.js");
12
+ const Layout = require("./Layout-C3IORH2n.js");
14
13
  function _interopNamespace(e) {
15
- if (e && e.__esModule)
16
- return e;
14
+ if (e && e.__esModule) return e;
17
15
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
18
16
  if (e) {
19
17
  for (const k in e) {
@@ -54,8 +52,7 @@ const ReviewWorkflowsListView = () => {
54
52
  setWorkflowToDelete(null);
55
53
  };
56
54
  const handleConfirmDeleteDialog = async () => {
57
- if (!workflowToDelete)
58
- return;
55
+ if (!workflowToDelete) return;
59
56
  await deleteAction(workflowToDelete);
60
57
  setWorkflowToDelete(null);
61
58
  };
@@ -140,7 +137,7 @@ const ReviewWorkflowsListView = () => {
140
137
  {
141
138
  isLoading,
142
139
  rows: workflows,
143
- footer: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.TFooter, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}), onClick: handleCreateClick, children: formatMessage({
140
+ footer: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.TFooter, { cursor: "pointer", icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}), onClick: handleCreateClick, children: formatMessage({
144
141
  id: "Settings.review-workflows.list.page.create",
145
142
  defaultMessage: "Create new workflow"
146
143
  }) }) : null,
@@ -164,16 +161,18 @@ const ReviewWorkflowsListView = () => {
164
161
  }).join(", ") }) }),
165
162
  /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", justifyContent: "end", children: [
166
163
  canRead || canUpdate ? /* @__PURE__ */ jsxRuntime.jsx(
167
- ActionLink,
164
+ designSystem.IconButton,
168
165
  {
169
- to: `${workflow.id}`,
170
- "aria-label": formatMessage(
166
+ tag: reactRouterDom.Link,
167
+ to: workflow.id.toString(),
168
+ label: formatMessage(
171
169
  {
172
170
  id: "Settings.review-workflows.list.page.list.column.actions.edit.label",
173
171
  defaultMessage: "Edit {name}"
174
172
  },
175
173
  { name: workflow.name }
176
174
  ),
175
+ variant: "ghost",
177
176
  children: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {})
178
177
  }
179
178
  ) : null,
@@ -188,7 +187,7 @@ const ReviewWorkflowsListView = () => {
188
187
  },
189
188
  { name: "Default workflow" }
190
189
  ),
191
- borderWidth: 0,
190
+ variant: "ghost",
192
191
  onClick: (e) => {
193
192
  e.stopPropagation();
194
193
  handleDeleteWorkflow(String(workflow.id));
@@ -204,19 +203,11 @@ const ReviewWorkflowsListView = () => {
204
203
  ] })
205
204
  }
206
205
  ),
207
- /* @__PURE__ */ jsxRuntime.jsx(
208
- strapiAdmin.ConfirmDialog,
209
- {
210
- isOpen: !!workflowToDelete,
211
- onClose: toggleConfirmDeleteDialog,
212
- onConfirm: handleConfirmDeleteDialog,
213
- children: formatMessage({
214
- id: "Settings.review-workflows.list.page.delete.confirm.body",
215
- defaultMessage: "If you remove this worfklow, all stage-related information will be removed for this content-type. Are you sure you want to remove it?"
216
- })
217
- }
218
- ),
219
- /* @__PURE__ */ jsxRuntime.jsxs(index.LimitsModal.Root, { isOpen: showLimitModal, onClose: () => setShowLimitModal(false), children: [
206
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: !!workflowToDelete, onOpenChange: toggleConfirmDeleteDialog, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleConfirmDeleteDialog, children: formatMessage({
207
+ id: "Settings.review-workflows.list.page.delete.confirm.body",
208
+ defaultMessage: "If you remove this worfklow, all stage-related information will be removed for this content-type. Are you sure you want to remove it?"
209
+ }) }) }),
210
+ /* @__PURE__ */ jsxRuntime.jsxs(index.LimitsModal.Root, { open: showLimitModal, onOpenChange: () => setShowLimitModal(false), children: [
220
211
  /* @__PURE__ */ jsxRuntime.jsx(index.LimitsModal.Title, { children: formatMessage({
221
212
  id: "Settings.review-workflows.list.page.workflows.limit.title",
222
213
  defaultMessage: "You’ve reached the limit of workflows in your plan"
@@ -229,27 +220,6 @@ const ReviewWorkflowsListView = () => {
229
220
  ] })
230
221
  ] });
231
222
  };
232
- const ActionLink = styledComponents.styled(designSystem.Link)`
233
- align-items: center;
234
- display: flex;
235
- justify-content: center;
236
- padding: ${({ theme }) => `${theme.spaces[2]}}`};
237
- & > span {
238
- line-height: 1rem;
239
- font-size: 1rem;
240
- }
241
-
242
- & svg > path {
243
- fill: ${({ theme }) => theme.colors.neutral500};
244
- }
245
-
246
- &:hover,
247
- &:focus {
248
- svg > path {
249
- fill: ${({ theme }) => theme.colors.neutral800};
250
- }
251
- }
252
- `;
253
223
  const ProtectedListPage = () => {
254
224
  const permissions = index.useTypedSelector(
255
225
  (state) => state.admin_app.permissions.settings?.["review-workflows"]?.main
@@ -258,4 +228,4 @@ const ProtectedListPage = () => {
258
228
  };
259
229
  exports.ProtectedListPage = ProtectedListPage;
260
230
  exports.ReviewWorkflowsListView = ReviewWorkflowsListView;
261
- //# sourceMappingURL=index-CdU1x9cZ.js.map
231
+ //# sourceMappingURL=index-CmHHjN95.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CmHHjN95.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, LinkButton, Dialog } from '@strapi/design-system';\nimport { Pencil, Plus, Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink, Link, useNavigate } from 'react-router-dom';\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: React.MouseEventHandler<HTMLAnchorElement> &\n ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) = (event) => {\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 cursor=\"pointer\" 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 <IconButton\n tag={Link}\n to={workflow.id.toString()}\n 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 variant=\"ghost\"\n >\n <Pencil />\n </IconButton>\n ) : null}\n {workflows.length > 1 && canDelete ? (\n <IconButton\n withTooltip={false}\n 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 variant=\"ghost\"\n onClick={(e) => {\n e.stopPropagation();\n handleDeleteWorkflow(String(workflow.id));\n }}\n >\n <Trash />\n </IconButton>\n ) : null}\n </Flex>\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Content>\n </Table.Root>\n\n <Dialog.Root open={!!workflowToDelete} onOpenChange={toggleConfirmDeleteDialog}>\n <ConfirmDialog onConfirm={handleConfirmDeleteDialog}>\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 </Dialog.Root>\n\n <LimitsModal.Root open={showLimitModal} onOpenChange={() => 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 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","IconButton","Link","Pencil","Trash","Dialog","ConfirmDialog","LimitsModal"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;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CAAA;AAAA,gBAAA;AAAA,cAAA;AAAA,cA7DK,SAAS;AAAA,YAAA,CA+DjB,EACH,CAAA;AAAA,UAAA,EACF,CAAA;AAAA,QAAA;AAAA,MACF;AAAA,MAECjB,2BAAA,IAAAkB,aAAA,OAAO,MAAP,EAAY,MAAM,CAAC,CAAC,kBAAkB,cAAc,2BACnD,UAAAlB,2BAAA,IAACmB,2BAAc,EAAA,WAAW,2BACvB,UAAc,cAAA;AAAA,QACb,IAAI;AAAA,QACJ,gBACE;AAAA,MAAA,CACH,GACH,EACF,CAAA;AAAA,MAEAjB,2BAAAA,KAACkB,MAAY,YAAA,MAAZ,EAAiB,MAAM,gBAAgB,cAAc,MAAM,kBAAkB,KAAK,GACjF,UAAA;AAAA,QAACpB,2BAAAA,IAAAoB,MAAAA,YAAY,OAAZ,EACE,UAAc,cAAA;AAAA,UACb,IAAI;AAAA,UACJ,gBAAgB;AAAA,QACjB,CAAA,GACH;AAAA,QAECpB,2BAAAA,IAAAoB,MAAAA,YAAY,MAAZ,EACE,UAAc,cAAA;AAAA,UACb,IAAI;AAAA,UACJ,gBAAgB;AAAA,QAAA,CACjB,EACH,CAAA;AAAA,MAAA,EACF,CAAA;AAAA,IAAA,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;AAEA,MAAM,oBAAoB,MAAM;AAC9B,QAAM,cAAcvB,MAAA;AAAA,IAClB,CAAC,UAAU,MAAM,UAAU,YAAY,WAAW,kBAAkB,GAAG;AAAA,EACzE;AAEA,wCACGI,iBAAK,SAAL,EAAa,aACZ,UAAAD,+BAAC,0BAAwB,CAAA,GAC3B;AAEJ;;;"}
@@ -2,13 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
3
  import { useTracking, useRBAC, Page, Table, ConfirmDialog } from "@strapi/admin/strapi-admin";
4
4
  import { useLicenseLimits } from "@strapi/admin/strapi-admin/ee";
5
- import { LinkButton, TFooter, Typography, Flex, IconButton, Link } from "@strapi/design-system";
5
+ import { LinkButton, TFooter, Typography, Flex, IconButton, Dialog } from "@strapi/design-system";
6
6
  import { Plus, Pencil, Trash } from "@strapi/icons";
7
7
  import { useIntl } from "react-intl";
8
- import { useNavigate, NavLink } from "react-router-dom";
9
- import { styled } from "styled-components";
10
- import { u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal } from "./index-lebOqdrv.mjs";
11
- import { u as useReviewWorkflows, H as Header, R as Root } from "./Layout-lg3hbwGL.mjs";
8
+ import { useNavigate, NavLink, Link } from "react-router-dom";
9
+ import { u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal } from "./index-ByXbOW-R.mjs";
10
+ import { u as useReviewWorkflows, H as Header, R as Root } from "./Layout-DNKR5bym.mjs";
12
11
  const ReviewWorkflowsListView = () => {
13
12
  const { formatMessage } = useIntl();
14
13
  const navigate = useNavigate();
@@ -33,8 +32,7 @@ const ReviewWorkflowsListView = () => {
33
32
  setWorkflowToDelete(null);
34
33
  };
35
34
  const handleConfirmDeleteDialog = async () => {
36
- if (!workflowToDelete)
37
- return;
35
+ if (!workflowToDelete) return;
38
36
  await deleteAction(workflowToDelete);
39
37
  setWorkflowToDelete(null);
40
38
  };
@@ -119,7 +117,7 @@ const ReviewWorkflowsListView = () => {
119
117
  {
120
118
  isLoading,
121
119
  rows: workflows,
122
- footer: canCreate ? /* @__PURE__ */ jsx(TFooter, { icon: /* @__PURE__ */ jsx(Plus, {}), onClick: handleCreateClick, children: formatMessage({
120
+ footer: canCreate ? /* @__PURE__ */ jsx(TFooter, { cursor: "pointer", icon: /* @__PURE__ */ jsx(Plus, {}), onClick: handleCreateClick, children: formatMessage({
123
121
  id: "Settings.review-workflows.list.page.create",
124
122
  defaultMessage: "Create new workflow"
125
123
  }) }) : null,
@@ -143,16 +141,18 @@ const ReviewWorkflowsListView = () => {
143
141
  }).join(", ") }) }),
144
142
  /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", justifyContent: "end", children: [
145
143
  canRead || canUpdate ? /* @__PURE__ */ jsx(
146
- ActionLink,
144
+ IconButton,
147
145
  {
148
- to: `${workflow.id}`,
149
- "aria-label": formatMessage(
146
+ tag: Link,
147
+ to: workflow.id.toString(),
148
+ label: formatMessage(
150
149
  {
151
150
  id: "Settings.review-workflows.list.page.list.column.actions.edit.label",
152
151
  defaultMessage: "Edit {name}"
153
152
  },
154
153
  { name: workflow.name }
155
154
  ),
155
+ variant: "ghost",
156
156
  children: /* @__PURE__ */ jsx(Pencil, {})
157
157
  }
158
158
  ) : null,
@@ -167,7 +167,7 @@ const ReviewWorkflowsListView = () => {
167
167
  },
168
168
  { name: "Default workflow" }
169
169
  ),
170
- borderWidth: 0,
170
+ variant: "ghost",
171
171
  onClick: (e) => {
172
172
  e.stopPropagation();
173
173
  handleDeleteWorkflow(String(workflow.id));
@@ -183,19 +183,11 @@ const ReviewWorkflowsListView = () => {
183
183
  ] })
184
184
  }
185
185
  ),
186
- /* @__PURE__ */ jsx(
187
- ConfirmDialog,
188
- {
189
- isOpen: !!workflowToDelete,
190
- onClose: toggleConfirmDeleteDialog,
191
- onConfirm: handleConfirmDeleteDialog,
192
- children: formatMessage({
193
- id: "Settings.review-workflows.list.page.delete.confirm.body",
194
- defaultMessage: "If you remove this worfklow, all stage-related information will be removed for this content-type. Are you sure you want to remove it?"
195
- })
196
- }
197
- ),
198
- /* @__PURE__ */ jsxs(LimitsModal.Root, { isOpen: showLimitModal, onClose: () => setShowLimitModal(false), children: [
186
+ /* @__PURE__ */ jsx(Dialog.Root, { open: !!workflowToDelete, onOpenChange: toggleConfirmDeleteDialog, children: /* @__PURE__ */ jsx(ConfirmDialog, { onConfirm: handleConfirmDeleteDialog, children: formatMessage({
187
+ id: "Settings.review-workflows.list.page.delete.confirm.body",
188
+ defaultMessage: "If you remove this worfklow, all stage-related information will be removed for this content-type. Are you sure you want to remove it?"
189
+ }) }) }),
190
+ /* @__PURE__ */ jsxs(LimitsModal.Root, { open: showLimitModal, onOpenChange: () => setShowLimitModal(false), children: [
199
191
  /* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
200
192
  id: "Settings.review-workflows.list.page.workflows.limit.title",
201
193
  defaultMessage: "You’ve reached the limit of workflows in your plan"
@@ -208,27 +200,6 @@ const ReviewWorkflowsListView = () => {
208
200
  ] })
209
201
  ] });
210
202
  };
211
- const ActionLink = styled(Link)`
212
- align-items: center;
213
- display: flex;
214
- justify-content: center;
215
- padding: ${({ theme }) => `${theme.spaces[2]}}`};
216
- & > span {
217
- line-height: 1rem;
218
- font-size: 1rem;
219
- }
220
-
221
- & svg > path {
222
- fill: ${({ theme }) => theme.colors.neutral500};
223
- }
224
-
225
- &:hover,
226
- &:focus {
227
- svg > path {
228
- fill: ${({ theme }) => theme.colors.neutral800};
229
- }
230
- }
231
- `;
232
203
  const ProtectedListPage = () => {
233
204
  const permissions = useTypedSelector(
234
205
  (state) => state.admin_app.permissions.settings?.["review-workflows"]?.main
@@ -239,4 +210,4 @@ export {
239
210
  ProtectedListPage,
240
211
  ReviewWorkflowsListView
241
212
  };
242
- //# sourceMappingURL=index-BhJmjDbj.mjs.map
213
+ //# sourceMappingURL=index-CyhaJuJG.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CyhaJuJG.mjs","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, LinkButton, Dialog } from '@strapi/design-system';\nimport { Pencil, Plus, Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink, Link, useNavigate } from 'react-router-dom';\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: React.MouseEventHandler<HTMLAnchorElement> &\n ((event: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void) = (event) => {\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 cursor=\"pointer\" 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 <IconButton\n tag={Link}\n to={workflow.id.toString()}\n 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 variant=\"ghost\"\n >\n <Pencil />\n </IconButton>\n ) : null}\n {workflows.length > 1 && canDelete ? (\n <IconButton\n withTooltip={false}\n 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 variant=\"ghost\"\n onClick={(e) => {\n e.stopPropagation();\n handleDeleteWorkflow(String(workflow.id));\n }}\n >\n <Trash />\n </IconButton>\n ) : null}\n </Flex>\n </Table.Cell>\n </Table.Row>\n ))}\n </Table.Body>\n </Table.Content>\n </Table.Root>\n\n <Dialog.Root open={!!workflowToDelete} onOpenChange={toggleConfirmDeleteDialog}>\n <ConfirmDialog onConfirm={handleConfirmDeleteDialog}>\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 </Dialog.Root>\n\n <LimitsModal.Root open={showLimitModal} onOpenChange={() => 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 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":["Layout.Header","Layout.Root","contentType"],"mappings":";;;;;;;;;;AAmBO,MAAM,0BAA0B,MAAM;AACrC,QAAA,EAAE,cAAc,IAAI,QAAQ;AAClC,QAAM,WAAW,YAAY;AACvB,QAAA,EAAE,WAAW,IAAI,YAAY;AACnC,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,MAAM,SAAwB,IAAI;AAClF,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,MAAM,SAAkB,KAAK;AACzE,QAAM,EAAE,MAAM,WAAW,gBAAA,IAAoB,wBAAwB;AACrE,QAAM,EAAE,MAAM,WAAW,WAAW,QAAQ,iBAAiB,mBAAmB;AAChF,QAAM,EAAE,YAAY,WAAW,iBAAA,IAAqB,iBAAiB;AACrE,QAAM,cAAc;AAAA,IAClB,CAAC,UAAU,MAA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