@strapi/review-workflows 5.0.0-beta.3 → 5.0.0-beta.5

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 (149) hide show
  1. package/dist/_chunks/Layout-dGg4FA1R.js +260 -0
  2. package/dist/_chunks/Layout-dGg4FA1R.js.map +1 -0
  3. package/dist/_chunks/Layout-facLKucY.mjs +240 -0
  4. package/dist/_chunks/Layout-facLKucY.mjs.map +1 -0
  5. package/dist/_chunks/_id-B6DgrtpA.js +1333 -0
  6. package/dist/_chunks/_id-B6DgrtpA.js.map +1 -0
  7. package/dist/_chunks/_id-D4CXKOqG.mjs +1311 -0
  8. package/dist/_chunks/_id-D4CXKOqG.mjs.map +1 -0
  9. package/dist/_chunks/en-D9ZrQAV6.mjs +12 -0
  10. package/dist/_chunks/en-D9ZrQAV6.mjs.map +1 -0
  11. package/dist/_chunks/en-xcewH2pC.js +12 -0
  12. package/dist/_chunks/en-xcewH2pC.js.map +1 -0
  13. package/dist/_chunks/index-BuKZWpJw.js +268 -0
  14. package/dist/_chunks/index-BuKZWpJw.js.map +1 -0
  15. package/dist/_chunks/index-D7Y0ofdg.mjs +851 -0
  16. package/dist/_chunks/index-D7Y0ofdg.mjs.map +1 -0
  17. package/dist/_chunks/index-DX8AGcIP.js +871 -0
  18. package/dist/_chunks/index-DX8AGcIP.js.map +1 -0
  19. package/dist/_chunks/index-QbWLXdZR.mjs +247 -0
  20. package/dist/_chunks/index-QbWLXdZR.mjs.map +1 -0
  21. package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs +51 -0
  22. package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +1 -0
  23. package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js +51 -0
  24. package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +1 -0
  25. package/dist/_chunks/router-CL62NScV.js +24 -0
  26. package/dist/_chunks/router-CL62NScV.js.map +1 -0
  27. package/dist/_chunks/router-ylD0eA48.mjs +24 -0
  28. package/dist/_chunks/router-ylD0eA48.mjs.map +1 -0
  29. package/dist/admin/index.js +4 -0
  30. package/dist/admin/index.js.map +1 -0
  31. package/dist/admin/index.mjs +5 -0
  32. package/dist/admin/index.mjs.map +1 -0
  33. package/dist/admin/src/components/LimitsModal.d.ts +15 -0
  34. package/dist/admin/src/constants.d.ts +9 -0
  35. package/dist/admin/src/index.d.ts +3 -0
  36. package/dist/admin/src/modules/hooks.d.ts +7 -0
  37. package/dist/admin/src/router.d.ts +2 -0
  38. package/dist/admin/src/routes/content-manager/[model]/[id]/components/AssigneeSelect.d.ts +2 -0
  39. package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +3 -0
  40. package/dist/admin/src/routes/content-manager/[model]/[id]/components/StageSelect.d.ts +1 -0
  41. package/dist/admin/src/routes/content-manager/[model]/[id]/components/constants.d.ts +2 -0
  42. package/dist/admin/src/routes/content-manager/[model]/components/AssigneeFilter.d.ts +7 -0
  43. package/dist/admin/src/routes/content-manager/[model]/components/StageFilter.d.ts +8 -0
  44. package/dist/admin/src/routes/content-manager/[model]/components/TableColumns.d.ts +18 -0
  45. package/dist/admin/src/routes/content-manager/[model]/configure/constants.d.ts +7 -0
  46. package/dist/admin/src/routes/content-manager/[model]/constants.d.ts +71 -0
  47. package/dist/admin/src/routes/purchase-review-workflows.d.ts +2 -0
  48. package/dist/admin/src/routes/settings/:id.d.ts +2 -0
  49. package/dist/admin/src/routes/settings/components/AddStage.d.ts +2 -0
  50. package/dist/admin/src/routes/settings/components/Layout.d.ts +12 -0
  51. package/dist/admin/src/routes/settings/components/StageDragPreview.d.ts +6 -0
  52. package/dist/admin/src/routes/settings/components/Stages.d.ts +12 -0
  53. package/dist/admin/src/routes/settings/components/WorkflowAttributes.d.ts +6 -0
  54. package/dist/admin/src/routes/settings/constants.d.ts +2 -0
  55. package/dist/admin/src/routes/settings/hooks/useDragAndDrop.d.ts +51 -0
  56. package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +14 -0
  57. package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +25 -0
  58. package/dist/admin/src/routes/settings/index.d.ts +3 -0
  59. package/dist/admin/src/services/admin.d.ts +5 -0
  60. package/dist/admin/src/services/api.d.ts +3 -0
  61. package/dist/admin/src/services/content-manager.d.ts +38 -0
  62. package/dist/admin/src/services/settings.d.ts +13 -0
  63. package/dist/admin/src/utils/api.d.ts +38 -0
  64. package/dist/admin/src/utils/cm-hooks.d.ts +46 -0
  65. package/dist/admin/src/utils/colors.d.ts +9 -0
  66. package/dist/admin/src/utils/translations.d.ts +3 -0
  67. package/dist/admin/src/utils/users.d.ts +6 -0
  68. package/dist/server/index.js +8256 -0
  69. package/dist/server/index.js.map +1 -0
  70. package/dist/server/index.mjs +8257 -0
  71. package/dist/server/index.mjs.map +1 -0
  72. package/dist/server/src/bootstrap.d.ts +3 -0
  73. package/dist/server/src/bootstrap.d.ts.map +1 -0
  74. package/dist/server/src/config/actions.d.ts +19 -0
  75. package/dist/server/src/config/actions.d.ts.map +1 -0
  76. package/dist/server/src/constants/webhook-events.d.ts +6 -0
  77. package/dist/server/src/constants/webhook-events.d.ts.map +1 -0
  78. package/dist/server/src/constants/workflows.d.ts +34 -0
  79. package/dist/server/src/constants/workflows.d.ts.map +1 -0
  80. package/dist/server/src/content-types/index.d.ts +90 -0
  81. package/dist/server/src/content-types/index.d.ts.map +1 -0
  82. package/dist/server/src/content-types/workflow/index.d.ts +41 -0
  83. package/dist/server/src/content-types/workflow/index.d.ts.map +1 -0
  84. package/dist/server/src/content-types/workflow-stage/index.d.ts +49 -0
  85. package/dist/server/src/content-types/workflow-stage/index.d.ts.map +1 -0
  86. package/dist/server/src/controllers/assignees.d.ts +19 -0
  87. package/dist/server/src/controllers/assignees.d.ts.map +1 -0
  88. package/dist/server/src/controllers/index.d.ts +21 -0
  89. package/dist/server/src/controllers/index.d.ts.map +1 -0
  90. package/dist/server/src/controllers/stages.d.ts +39 -0
  91. package/dist/server/src/controllers/stages.d.ts.map +1 -0
  92. package/dist/server/src/controllers/workflows.d.ts +32 -0
  93. package/dist/server/src/controllers/workflows.d.ts.map +1 -0
  94. package/dist/server/src/destroy.d.ts +6 -0
  95. package/dist/server/src/destroy.d.ts.map +1 -0
  96. package/dist/server/src/index.d.ts +322 -0
  97. package/dist/server/src/index.d.ts.map +1 -0
  98. package/dist/server/src/middlewares/review-workflows.d.ts +17 -0
  99. package/dist/server/src/middlewares/review-workflows.d.ts.map +1 -0
  100. package/dist/server/src/migrations/handle-deleted-ct-in-workflows.d.ts +6 -0
  101. package/dist/server/src/migrations/handle-deleted-ct-in-workflows.d.ts.map +1 -0
  102. package/dist/server/src/migrations/multiple-workflows.d.ts +3 -0
  103. package/dist/server/src/migrations/multiple-workflows.d.ts.map +1 -0
  104. package/dist/server/src/migrations/set-stages-default-color.d.ts +6 -0
  105. package/dist/server/src/migrations/set-stages-default-color.d.ts.map +1 -0
  106. package/dist/server/src/migrations/set-stages-roles.d.ts +6 -0
  107. package/dist/server/src/migrations/set-stages-roles.d.ts.map +1 -0
  108. package/dist/server/src/migrations/set-workflow-default-name.d.ts +7 -0
  109. package/dist/server/src/migrations/set-workflow-default-name.d.ts.map +1 -0
  110. package/dist/server/src/migrations/shorten-stage-attribute.d.ts +6 -0
  111. package/dist/server/src/migrations/shorten-stage-attribute.d.ts.map +1 -0
  112. package/dist/server/src/register.d.ts +6 -0
  113. package/dist/server/src/register.d.ts.map +1 -0
  114. package/dist/server/src/routes/index.d.ts +21 -0
  115. package/dist/server/src/routes/index.d.ts.map +1 -0
  116. package/dist/server/src/routes/review-workflows.d.ts +19 -0
  117. package/dist/server/src/routes/review-workflows.d.ts.map +1 -0
  118. package/dist/server/src/routes/utils.d.ts +2 -0
  119. package/dist/server/src/routes/utils.d.ts.map +1 -0
  120. package/dist/server/src/services/assignees.d.ts +13 -0
  121. package/dist/server/src/services/assignees.d.ts.map +1 -0
  122. package/dist/server/src/services/document-service-middleware.d.ts +7 -0
  123. package/dist/server/src/services/document-service-middleware.d.ts.map +1 -0
  124. package/dist/server/src/services/index.d.ts +92 -0
  125. package/dist/server/src/services/index.d.ts.map +1 -0
  126. package/dist/server/src/services/metrics/index.d.ts +21 -0
  127. package/dist/server/src/services/metrics/index.d.ts.map +1 -0
  128. package/dist/server/src/services/metrics/weekly-metrics.d.ts +16 -0
  129. package/dist/server/src/services/metrics/weekly-metrics.d.ts.map +1 -0
  130. package/dist/server/src/services/stage-permissions.d.ts +11 -0
  131. package/dist/server/src/services/stage-permissions.d.ts.map +1 -0
  132. package/dist/server/src/services/stages.d.ts +46 -0
  133. package/dist/server/src/services/stages.d.ts.map +1 -0
  134. package/dist/server/src/services/validation.d.ts +26 -0
  135. package/dist/server/src/services/validation.d.ts.map +1 -0
  136. package/dist/server/src/services/workflow-content-types.d.ts +21 -0
  137. package/dist/server/src/services/workflow-content-types.d.ts.map +1 -0
  138. package/dist/server/src/services/workflows.d.ts +84 -0
  139. package/dist/server/src/services/workflows.d.ts.map +1 -0
  140. package/dist/server/src/utils/index.d.ts +17 -0
  141. package/dist/server/src/utils/index.d.ts.map +1 -0
  142. package/dist/server/src/utils/review-workflows.d.ts +31 -0
  143. package/dist/server/src/utils/review-workflows.d.ts.map +1 -0
  144. package/dist/server/src/validation/review-workflows.d.ts +31 -0
  145. package/dist/server/src/validation/review-workflows.d.ts.map +1 -0
  146. package/dist/shared/contracts/review-workflows.d.ts +152 -0
  147. package/dist/shared/contracts/review-workflows.d.ts.map +1 -0
  148. package/package.json +24 -12
  149. package/strapi-server.js +3 -0
@@ -0,0 +1,247 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { useTracking, useRBAC, Page, Table, ConfirmDialog } from "@strapi/admin/strapi-admin";
4
+ import { useLicenseLimits } from "@strapi/admin/strapi-admin/ee";
5
+ import { TFooter, Typography, Flex, IconButton } from "@strapi/design-system";
6
+ import { LinkButton, Link } from "@strapi/design-system/v2";
7
+ import { Plus, Pencil, Trash } from "@strapi/icons";
8
+ import { useIntl } from "react-intl";
9
+ import { useNavigate, NavLink } from "react-router-dom";
10
+ import styled from "styled-components";
11
+ import { u as useGetContentTypesQuery, a as useTypedSelector, C as CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME, L as LimitsModal } from "./index-D7Y0ofdg.mjs";
12
+ import { u as useReviewWorkflows, H as Header, R as Root } from "./Layout-facLKucY.mjs";
13
+ const ReviewWorkflowsListView = () => {
14
+ const { formatMessage } = useIntl();
15
+ const navigate = useNavigate();
16
+ const { trackUsage } = useTracking();
17
+ const [workflowToDelete, setWorkflowToDelete] = React.useState(null);
18
+ const [showLimitModal, setShowLimitModal] = React.useState(false);
19
+ const { data, isLoading: isLoadingModels } = useGetContentTypesQuery();
20
+ const { meta, workflows, isLoading, delete: deleteAction } = useReviewWorkflows();
21
+ const { getFeature, isLoading: isLicenseLoading } = useLicenseLimits();
22
+ const permissions = useTypedSelector(
23
+ (state) => state.admin_app.permissions.settings?.["review-workflows"]
24
+ );
25
+ const {
26
+ allowedActions: { canCreate, canRead, canUpdate, canDelete }
27
+ } = useRBAC(permissions);
28
+ const limits = getFeature("review-workflows");
29
+ const numberOfWorkflows = limits?.[CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME];
30
+ const handleDeleteWorkflow = (workflowId) => {
31
+ setWorkflowToDelete(workflowId);
32
+ };
33
+ const toggleConfirmDeleteDialog = () => {
34
+ setWorkflowToDelete(null);
35
+ };
36
+ const handleConfirmDeleteDialog = async () => {
37
+ if (!workflowToDelete)
38
+ return;
39
+ await deleteAction(workflowToDelete);
40
+ setWorkflowToDelete(null);
41
+ };
42
+ const handleCreateClick = (event) => {
43
+ event.preventDefault();
44
+ if (numberOfWorkflows && meta && meta?.workflowCount >= parseInt(numberOfWorkflows, 10)) {
45
+ event.preventDefault();
46
+ setShowLimitModal(true);
47
+ } else {
48
+ navigate("create");
49
+ trackUsage("willCreateWorkflow");
50
+ }
51
+ };
52
+ React.useEffect(() => {
53
+ if (!isLoading && !isLicenseLoading) {
54
+ if (numberOfWorkflows && meta && meta?.workflowCount > parseInt(numberOfWorkflows, 10)) {
55
+ setShowLimitModal(true);
56
+ }
57
+ }
58
+ }, [isLicenseLoading, isLoading, meta, meta?.workflowCount, numberOfWorkflows]);
59
+ const headers = [
60
+ {
61
+ label: formatMessage({
62
+ id: "Settings.review-workflows.list.page.list.column.name.title",
63
+ defaultMessage: "Name"
64
+ }),
65
+ name: "name"
66
+ },
67
+ {
68
+ label: formatMessage({
69
+ id: "Settings.review-workflows.list.page.list.column.stages.title",
70
+ defaultMessage: "Stages"
71
+ }),
72
+ name: "stages"
73
+ },
74
+ {
75
+ label: formatMessage({
76
+ id: "Settings.review-workflows.list.page.list.column.contentTypes.title",
77
+ defaultMessage: "Content Types"
78
+ }),
79
+ name: "content-types"
80
+ }
81
+ ];
82
+ if (isLoading || isLoadingModels) {
83
+ return /* @__PURE__ */ jsx(Page.Loading, {});
84
+ }
85
+ const contentTypes = Object.values(data ?? {}).reduce((acc, curr) => {
86
+ acc.push(...curr);
87
+ return acc;
88
+ }, []);
89
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
90
+ /* @__PURE__ */ jsx(
91
+ Header,
92
+ {
93
+ primaryAction: canCreate ? /* @__PURE__ */ jsx(
94
+ LinkButton,
95
+ {
96
+ startIcon: /* @__PURE__ */ jsx(Plus, {}),
97
+ size: "S",
98
+ as: NavLink,
99
+ to: "create",
100
+ onClick: handleCreateClick,
101
+ children: formatMessage({
102
+ id: "Settings.review-workflows.list.page.create",
103
+ defaultMessage: "Create new workflow"
104
+ })
105
+ }
106
+ ) : null,
107
+ subtitle: formatMessage({
108
+ id: "Settings.review-workflows.list.page.subtitle",
109
+ defaultMessage: "Manage your content review process"
110
+ }),
111
+ title: formatMessage({
112
+ id: "Settings.review-workflows.list.page.title",
113
+ defaultMessage: "Review Workflows"
114
+ })
115
+ }
116
+ ),
117
+ /* @__PURE__ */ jsxs(Root, { children: [
118
+ /* @__PURE__ */ jsx(
119
+ Table.Root,
120
+ {
121
+ isLoading,
122
+ rows: workflows,
123
+ footer: canCreate ? /* @__PURE__ */ jsx(TFooter, { icon: /* @__PURE__ */ jsx(Plus, {}), onClick: handleCreateClick, children: formatMessage({
124
+ id: "Settings.review-workflows.list.page.create",
125
+ defaultMessage: "Create new workflow"
126
+ }) }) : null,
127
+ headers,
128
+ children: /* @__PURE__ */ jsxs(Table.Content, { children: [
129
+ /* @__PURE__ */ jsx(Table.Head, { children: headers.map((head) => /* @__PURE__ */ jsx(Table.HeaderCell, { ...head }, head.name)) }),
130
+ /* @__PURE__ */ jsx(Table.Body, { children: workflows.map((workflow) => /* @__PURE__ */ jsxs(
131
+ Table.Row,
132
+ {
133
+ onClick: () => {
134
+ navigate(`${workflow.id}`);
135
+ },
136
+ children: [
137
+ /* @__PURE__ */ jsx(Table.Cell, { width: `${250 / 16}rem`, children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", fontWeight: "bold", ellipsis: true, children: workflow.name }) }),
138
+ /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: workflow.stages.length }) }),
139
+ /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: workflow.contentTypes.map((uid) => {
140
+ const contentType = contentTypes.find(
141
+ (contentType2) => contentType2.uid === uid
142
+ );
143
+ return contentType?.info.displayName ?? "";
144
+ }).join(", ") }) }),
145
+ /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", justifyContent: "end", children: [
146
+ canRead || canUpdate ? /* @__PURE__ */ jsx(
147
+ ActionLink,
148
+ {
149
+ to: `${workflow.id}`,
150
+ "aria-label": formatMessage(
151
+ {
152
+ id: "Settings.review-workflows.list.page.list.column.actions.edit.label",
153
+ defaultMessage: "Edit {name}"
154
+ },
155
+ { name: workflow.name }
156
+ ),
157
+ children: /* @__PURE__ */ jsx(Pencil, {})
158
+ }
159
+ ) : null,
160
+ workflows.length > 1 && canDelete ? /* @__PURE__ */ jsx(
161
+ IconButton,
162
+ {
163
+ "aria-label": formatMessage(
164
+ {
165
+ id: "Settings.review-workflows.list.page.list.column.actions.delete.label",
166
+ defaultMessage: "Delete {name}"
167
+ },
168
+ { name: "Default workflow" }
169
+ ),
170
+ icon: /* @__PURE__ */ jsx(Trash, {}),
171
+ borderWidth: 0,
172
+ onClick: (e) => {
173
+ e.stopPropagation();
174
+ handleDeleteWorkflow(String(workflow.id));
175
+ }
176
+ }
177
+ ) : null
178
+ ] }) })
179
+ ]
180
+ },
181
+ workflow.id
182
+ )) })
183
+ ] })
184
+ }
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: [
199
+ /* @__PURE__ */ jsx(LimitsModal.Title, { children: formatMessage({
200
+ id: "Settings.review-workflows.list.page.workflows.limit.title",
201
+ defaultMessage: "You’ve reached the limit of workflows in your plan"
202
+ }) }),
203
+ /* @__PURE__ */ jsx(LimitsModal.Body, { children: formatMessage({
204
+ id: "Settings.review-workflows.list.page.workflows.limit.body",
205
+ defaultMessage: "Delete a workflow or contact Sales to enable more workflows."
206
+ }) })
207
+ ] })
208
+ ] })
209
+ ] });
210
+ };
211
+ const ActionLink = styled(Link)`
212
+ align-items: center;
213
+ height: ${32 / 16}rem;
214
+ display: flex;
215
+ justify-content: center;
216
+ padding: ${({ theme }) => `${theme.spaces[2]}}`};
217
+ width: ${32 / 16}rem;
218
+
219
+ svg {
220
+ height: ${12 / 16}rem;
221
+ width: ${12 / 16}rem;
222
+
223
+ path {
224
+ fill: ${({ theme }) => theme.colors.neutral500};
225
+ }
226
+ }
227
+
228
+ &:hover,
229
+ &:focus {
230
+ svg {
231
+ path {
232
+ fill: ${({ theme }) => theme.colors.neutral800};
233
+ }
234
+ }
235
+ }
236
+ `;
237
+ const ProtectedListPage = () => {
238
+ const permissions = useTypedSelector(
239
+ (state) => state.admin_app.permissions.settings?.["review-workflows"]?.main
240
+ );
241
+ return /* @__PURE__ */ jsx(Page.Protect, { permissions, children: /* @__PURE__ */ jsx(ReviewWorkflowsListView, {}) });
242
+ };
243
+ export {
244
+ ProtectedListPage,
245
+ ReviewWorkflowsListView
246
+ };
247
+ //# sourceMappingURL=index-QbWLXdZR.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-QbWLXdZR.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 } from '@strapi/design-system';\nimport { Link, LinkButton } from '@strapi/design-system/v2';\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 as={NavLink}\n // @ts-expect-error – the `as` prop does not correctly infer the props of it's component\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={`${250 / 16}rem`}>\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 // @ts-expect-error – the `as` prop does not correctly infer the props of it's component\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 height: ${32 / 16}rem;\n display: flex;\n justify-content: center;\n padding: ${({ theme }) => `${theme.spaces[2]}}`};\n width: ${32 / 16}rem;\n\n svg {\n height: ${12 / 16}rem;\n width: ${12 / 16}rem;\n\n path {\n fill: ${({ theme }) => theme.colors.neutral500};\n }\n }\n\n &:hover,\n &:focus {\n svg {\n path {\n fill: ${({ theme }) => theme.colors.neutral800};\n }\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":";;;;;;;;;;;;AAqBO,MAAM,0BAA0B,MAAM;AACrC,QAAA,EAAE,kBAAkB;AAC1B,QAAM,WAAW;AACX,QAAA,EAAE,eAAe;AACvB,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,MAAM,SAAwB,IAAI;AAClF,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,MAAM,SAAkB,KAAK;AACzE,QAAM,EAAE,MAAM,WAAW,oBAAoB,wBAAwB;AACrE,QAAM,EAAE,MAAM,WAAW,WAAW,QAAQ,aAAA,IAAiB;AAC7D,QAAM,EAAE,YAAY,WAAW,qBAAqB,iBAAiB;AACrE,QAAM,cAAc;AAAA,IAClB,CAAC,UAAU,MAAM,UAAU,YAAY,WAAW,kBAAkB;AAAA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AAAA;AAAA;AAAA,cAGN,CAAC,EAAE,MAAA,MAAY,MAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,gBAQpC,CAAC,EAAE,MAAA,MAAY,MAAM,OAAO,UAAU;AAAA;AAAA;AAAA;AAAA;AAMtD,MAAM,oBAAoB,MAAM;AAC9B,QAAM,cAAc;AAAA,IAClB,CAAC,UAAU,MAAM,UAAU,YAAY,WAAW,kBAAkB,GAAG;AAAA,EAAA;AAGzE,6BACG,KAAK,SAAL,EAAa,aACZ,UAAA,oBAAC,2BAAwB,EAC3B,CAAA;AAEJ;"}
@@ -0,0 +1,51 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Layout, Main, HeaderLayout, Box, EmptyStateLayout } from "@strapi/design-system";
3
+ import { LinkButton } from "@strapi/design-system/v2";
4
+ import { EmptyPermissions, ExternalLink } from "@strapi/icons";
5
+ import { useIntl } from "react-intl";
6
+ const PurchaseReviewWorkflows = () => {
7
+ const { formatMessage } = useIntl();
8
+ return /* @__PURE__ */ jsx(Layout, { children: /* @__PURE__ */ jsxs(Main, { children: [
9
+ /* @__PURE__ */ jsx(
10
+ HeaderLayout,
11
+ {
12
+ title: formatMessage({
13
+ id: "Settings.review-workflows.list.page.title",
14
+ defaultMessage: "Review Workflows"
15
+ }),
16
+ subtitle: formatMessage({
17
+ id: "Settings.review-workflows.list.page.subtitle",
18
+ defaultMessage: "Manage your content review process"
19
+ })
20
+ }
21
+ ),
22
+ /* @__PURE__ */ jsx(Box, { paddingLeft: 10, paddingRight: 10, children: /* @__PURE__ */ jsx(
23
+ EmptyStateLayout,
24
+ {
25
+ icon: /* @__PURE__ */ jsx(EmptyPermissions, { width: "10rem" }),
26
+ content: formatMessage({
27
+ id: "Settings.review-workflows.not-available",
28
+ defaultMessage: "Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows."
29
+ }),
30
+ action: /* @__PURE__ */ jsx(
31
+ LinkButton,
32
+ {
33
+ variant: "default",
34
+ endIcon: /* @__PURE__ */ jsx(ExternalLink, {}),
35
+ href: "https://strp.cc/3tdNfJq",
36
+ isExternal: true,
37
+ target: "_blank",
38
+ children: formatMessage({
39
+ id: "global.learn-more",
40
+ defaultMessage: "Learn more"
41
+ })
42
+ }
43
+ )
44
+ }
45
+ ) })
46
+ ] }) });
47
+ };
48
+ export {
49
+ PurchaseReviewWorkflows
50
+ };
51
+ //# sourceMappingURL=purchase-review-workflows-B-V0sA2I.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purchase-review-workflows-B-V0sA2I.mjs","sources":["../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Box, Layout, Main, HeaderLayout, EmptyStateLayout } from '@strapi/design-system';\nimport { LinkButton } from '@strapi/design-system/v2';\nimport { ExternalLink, EmptyPermissions } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Layout>\n <Main>\n <HeaderLayout\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=\"10rem\" />}\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 </Layout>\n );\n};\n\nexport { PurchaseReviewWorkflows };\n"],"names":[],"mappings":";;;;;AAKA,MAAM,0BAA0B,MAAM;AAC9B,QAAA,EAAE,kBAAkB;AAGxB,SAAA,oBAAC,QACC,EAAA,UAAA,qBAAC,MACC,EAAA,UAAA;AAAA,IAAA;AAAA,MAAC;AAAA,MAAA;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;"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const designSystem = require("@strapi/design-system");
5
+ const v2 = require("@strapi/design-system/v2");
6
+ const icons = require("@strapi/icons");
7
+ const reactIntl = require("react-intl");
8
+ const PurchaseReviewWorkflows = () => {
9
+ const { formatMessage } = reactIntl.useIntl();
10
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Layout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { children: [
11
+ /* @__PURE__ */ jsxRuntime.jsx(
12
+ designSystem.HeaderLayout,
13
+ {
14
+ title: formatMessage({
15
+ id: "Settings.review-workflows.list.page.title",
16
+ defaultMessage: "Review Workflows"
17
+ }),
18
+ subtitle: formatMessage({
19
+ id: "Settings.review-workflows.list.page.subtitle",
20
+ defaultMessage: "Manage your content review process"
21
+ })
22
+ }
23
+ ),
24
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 10, paddingRight: 10, children: /* @__PURE__ */ jsxRuntime.jsx(
25
+ designSystem.EmptyStateLayout,
26
+ {
27
+ icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EmptyPermissions, { width: "10rem" }),
28
+ content: formatMessage({
29
+ id: "Settings.review-workflows.not-available",
30
+ defaultMessage: "Review Workflows is only available as part of a paid plan. Upgrade to create and manage workflows."
31
+ }),
32
+ action: /* @__PURE__ */ jsxRuntime.jsx(
33
+ v2.LinkButton,
34
+ {
35
+ variant: "default",
36
+ endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ExternalLink, {}),
37
+ href: "https://strp.cc/3tdNfJq",
38
+ isExternal: true,
39
+ target: "_blank",
40
+ children: formatMessage({
41
+ id: "global.learn-more",
42
+ defaultMessage: "Learn more"
43
+ })
44
+ }
45
+ )
46
+ }
47
+ ) })
48
+ ] }) });
49
+ };
50
+ exports.PurchaseReviewWorkflows = PurchaseReviewWorkflows;
51
+ //# sourceMappingURL=purchase-review-workflows-Ds61D_tk.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"purchase-review-workflows-Ds61D_tk.js","sources":["../../admin/src/routes/purchase-review-workflows.tsx"],"sourcesContent":["import { Box, Layout, Main, HeaderLayout, EmptyStateLayout } from '@strapi/design-system';\nimport { LinkButton } from '@strapi/design-system/v2';\nimport { ExternalLink, EmptyPermissions } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nconst PurchaseReviewWorkflows = () => {\n const { formatMessage } = useIntl();\n\n return (\n <Layout>\n <Main>\n <HeaderLayout\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=\"10rem\" />}\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 </Layout>\n );\n};\n\nexport { PurchaseReviewWorkflows };\n"],"names":["useIntl","jsx","Layout","jsxs","Main","HeaderLayout","Box","EmptyStateLayout","EmptyPermissions","LinkButton","ExternalLink"],"mappings":";;;;;;;AAKA,MAAM,0BAA0B,MAAM;AAC9B,QAAA,EAAE,kBAAkBA,UAAAA;AAGxB,SAAAC,2BAAAA,IAACC,aAAAA,QACC,EAAA,UAAAC,2BAAAA,KAACC,aAAAA,MACC,EAAA,UAAA;AAAA,IAAAH,2BAAA;AAAA,MAACI,aAAA;AAAA,MAAA;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,IACCJ,2BAAA,IAAAK,aAAA,KAAA,EAAI,aAAa,IAAI,cAAc,IAClC,UAAAL,2BAAA;AAAA,MAACM,aAAA;AAAA,MAAA;AAAA,QACC,MAAMN,2BAAAA,IAACO,MAAAA,kBAAiB,EAAA,OAAM,QAAQ,CAAA;AAAA,QACtC,SAAS,cAAc;AAAA,UACrB,IAAI;AAAA,UACJ,gBACE;AAAA,QAAA,CACH;AAAA,QACD,QACEP,2BAAA;AAAA,UAACQ,GAAA;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;;"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const jsxRuntime = require("react/jsx-runtime");
4
+ const React = require("react");
5
+ const reactRouterDom = require("react-router-dom");
6
+ const ProtectedListPage = React.lazy(
7
+ () => Promise.resolve().then(() => require("./index-BuKZWpJw.js")).then((mod) => ({ default: mod.ProtectedListPage }))
8
+ );
9
+ const ProtectedEditPage = React.lazy(
10
+ () => Promise.resolve().then(() => require("./_id-B6DgrtpA.js")).then((mod) => ({ default: mod.ProtectedEditPage }))
11
+ );
12
+ const routes = [
13
+ {
14
+ path: "/",
15
+ Component: ProtectedListPage
16
+ },
17
+ {
18
+ path: ":id",
19
+ Component: ProtectedEditPage
20
+ }
21
+ ];
22
+ const Router = () => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Routes, { children: routes.map((route) => /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { ...route }, route.path)) });
23
+ exports.Router = Router;
24
+ //# sourceMappingURL=router-CL62NScV.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-CL62NScV.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;;"}
@@ -0,0 +1,24 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { lazy } from "react";
3
+ import { Routes, Route } from "react-router-dom";
4
+ const ProtectedListPage = lazy(
5
+ () => import("./index-QbWLXdZR.mjs").then((mod) => ({ default: mod.ProtectedListPage }))
6
+ );
7
+ const ProtectedEditPage = lazy(
8
+ () => import("./_id-D4CXKOqG.mjs").then((mod) => ({ default: mod.ProtectedEditPage }))
9
+ );
10
+ const routes = [
11
+ {
12
+ path: "/",
13
+ Component: ProtectedListPage
14
+ },
15
+ {
16
+ path: ":id",
17
+ Component: ProtectedEditPage
18
+ }
19
+ ];
20
+ const Router = () => /* @__PURE__ */ jsx(Routes, { children: routes.map((route) => /* @__PURE__ */ jsx(Route, { ...route }, route.path)) });
21
+ export {
22
+ Router
23
+ };
24
+ //# sourceMappingURL=router-ylD0eA48.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"router-ylD0eA48.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;"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ const index = require("../_chunks/index-DX8AGcIP.js");
3
+ module.exports = index.admin;
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
@@ -0,0 +1,5 @@
1
+ import { h } from "../_chunks/index-D7Y0ofdg.mjs";
2
+ export {
3
+ h as default
4
+ };
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
@@ -0,0 +1,15 @@
1
+ import * as React from 'react';
2
+ export type LimitsModalProps = {
3
+ isOpen?: boolean;
4
+ onClose: () => void;
5
+ };
6
+ declare const LimitsModal: {
7
+ Title: React.FC<{
8
+ children?: React.ReactNode;
9
+ }>;
10
+ Body: React.FC<{
11
+ children?: React.ReactNode;
12
+ }>;
13
+ Root: React.FC<React.PropsWithChildren<LimitsModalProps>>;
14
+ };
15
+ export { LimitsModal };
@@ -0,0 +1,9 @@
1
+ declare const PLUGIN_ID = "review-workflows";
2
+ /**
3
+ * The name of the feature in the license.
4
+ */
5
+ declare const FEATURE_ID = "review-workflows";
6
+ export declare const CHARGEBEE_WORKFLOW_ENTITLEMENT_NAME = "numberOfWorkflows";
7
+ export declare const CHARGEBEE_STAGES_PER_WORKFLOW_ENTITLEMENT_NAME = "stagesPerWorkflow";
8
+ export declare const STAGE_COLOR_DEFAULT: string;
9
+ export { FEATURE_ID, PLUGIN_ID };
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '@strapi/types';
2
+ declare const admin: Plugin.Config.AdminInput;
3
+ export default admin;
@@ -0,0 +1,7 @@
1
+ import { Dispatch } from '@reduxjs/toolkit';
2
+ import { TypedUseSelectorHook } from 'react-redux';
3
+ import type { Store } from '@strapi/admin/strapi-admin';
4
+ type RootState = ReturnType<Store['getState']>;
5
+ declare const useTypedDispatch: () => Dispatch;
6
+ declare const useTypedSelector: TypedUseSelectorHook<RootState>;
7
+ export { useTypedSelector, useTypedDispatch };
@@ -0,0 +1,2 @@
1
+ declare const Router: () => import("react/jsx-runtime").JSX.Element;
2
+ export { Router };
@@ -0,0 +1,2 @@
1
+ declare const AssigneeSelect: () => import("react/jsx-runtime").JSX.Element | null;
2
+ export { AssigneeSelect };
@@ -0,0 +1,3 @@
1
+ import type { PanelComponent } from '@strapi/plugin-content-manager/strapi-admin';
2
+ declare const Panel: PanelComponent;
3
+ export { Panel };
@@ -0,0 +1 @@
1
+ export declare const StageSelect: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ export declare const STAGE_ATTRIBUTE_NAME = "strapi_stage";
2
+ export declare const ASSIGNEE_ATTRIBUTE_NAME = "strapi_assignee";
@@ -0,0 +1,7 @@
1
+ import { type Filters } from '@strapi/admin/strapi-admin';
2
+ import { ComboboxProps } from '@strapi/design-system';
3
+ interface AssigneeFilterProps extends Pick<ComboboxProps, 'value' | 'onChange'> {
4
+ }
5
+ declare const AssigneeFilter: ({ name }: Filters.ValueInputProps) => import("react/jsx-runtime").JSX.Element;
6
+ export { AssigneeFilter };
7
+ export type { AssigneeFilterProps };
@@ -0,0 +1,8 @@
1
+ import { type Filters } from '@strapi/admin/strapi-admin';
2
+ import { SingleSelectProps } from '@strapi/design-system';
3
+ interface StageFilterProps extends Pick<SingleSelectProps, 'value' | 'onChange'> {
4
+ uid?: string;
5
+ }
6
+ declare const StageFilter: (props: Filters.ValueInputProps) => import("react/jsx-runtime").JSX.Element;
7
+ export { StageFilter };
8
+ export type { StageFilterProps };
@@ -0,0 +1,18 @@
1
+ import { SanitizedAdminUser } from '@strapi/admin/strapi-admin';
2
+ interface StageColumnProps {
3
+ documentId?: string;
4
+ id?: number;
5
+ strapi_stage?: {
6
+ color?: string;
7
+ name: string;
8
+ };
9
+ }
10
+ declare const StageColumn: (props: StageColumnProps) => import("react/jsx-runtime").JSX.Element;
11
+ interface AssigneeColumnProps {
12
+ documentId?: string;
13
+ id?: number;
14
+ strapi_assignee?: Pick<SanitizedAdminUser, 'firstname' | 'lastname' | 'username' | 'email'> | null;
15
+ }
16
+ declare const AssigneeColumn: (props: AssigneeColumnProps) => import("react/jsx-runtime").JSX.Element;
17
+ export { StageColumn, AssigneeColumn };
18
+ export type { StageColumnProps, AssigneeColumnProps };
@@ -0,0 +1,7 @@
1
+ export declare const REVIEW_WORKFLOW_STAGE_SORT_OPTION_NAME: {
2
+ value: string;
3
+ label: {
4
+ id: string;
5
+ defaultMessage: string;
6
+ };
7
+ };