@strapi/review-workflows 0.0.0-next.c22d1aa5024dc77092c3df7e990ad89dcd79e7b0 → 0.0.0-next.c57731c6e91ae024fa544ad986d80a3c4a489dbf
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/admin/chunks/{Layout-B4l91S3p.js → Layout-COWXwu3C.js} +2 -2
- package/dist/admin/chunks/{Layout-B4l91S3p.js.map → Layout-COWXwu3C.js.map} +1 -1
- package/dist/admin/chunks/{Layout-CXRcBLOx.js → Layout-CsShRydy.mjs} +2 -2
- package/dist/admin/chunks/Layout-CsShRydy.mjs.map +1 -0
- package/dist/admin/chunks/{en-C6SESe-Y.js → en-BNGiWajd.js} +6 -2
- package/dist/admin/chunks/en-BNGiWajd.js.map +1 -0
- package/dist/admin/chunks/{en-BixG7IBu.js → en-BrZXFtVv.mjs} +6 -2
- package/dist/admin/chunks/en-BrZXFtVv.mjs.map +1 -0
- package/dist/admin/chunks/{id-DnRGfGvc.js → id-D8zbh_Y8.js} +3 -3
- package/dist/admin/chunks/{id-DnRGfGvc.js.map → id-D8zbh_Y8.js.map} +1 -1
- package/dist/admin/chunks/{id-SiBUWtYE.js → id-afdVynVx.mjs} +3 -3
- package/dist/admin/chunks/id-afdVynVx.mjs.map +1 -0
- package/dist/admin/chunks/{index-Df6sZesT.js → index-2VGAYchq.mjs} +268 -113
- package/dist/admin/chunks/index-2VGAYchq.mjs.map +1 -0
- package/dist/admin/chunks/{index-DZpcSUvc.js → index-7Tk-SHLf.js} +3 -3
- package/dist/admin/chunks/{index-DZpcSUvc.js.map → index-7Tk-SHLf.js.map} +1 -1
- package/dist/admin/chunks/{index-D-2M8KV9.js → index-BXlkcM4s.mjs} +3 -3
- package/dist/admin/chunks/index-BXlkcM4s.mjs.map +1 -0
- package/dist/admin/chunks/{index-C5IeISWp.js → index-CEABZUwQ.js} +266 -111
- package/dist/admin/chunks/index-CEABZUwQ.js.map +1 -0
- package/dist/admin/chunks/purchase-review-workflows-BJkm1_Dd.mjs +180 -0
- package/dist/admin/chunks/purchase-review-workflows-BJkm1_Dd.mjs.map +1 -0
- package/dist/admin/chunks/purchase-review-workflows-BQL0PbmB.js +182 -0
- package/dist/admin/chunks/purchase-review-workflows-BQL0PbmB.js.map +1 -0
- package/dist/admin/chunks/{router-CrN8UbpP.js → router-Cc8VcSCc.js} +3 -3
- package/dist/admin/chunks/{router-CrN8UbpP.js.map → router-Cc8VcSCc.js.map} +1 -1
- package/dist/admin/chunks/{router-C9Jpl4gL.js → router-JyFAzv9_.mjs} +3 -3
- package/dist/admin/chunks/router-JyFAzv9_.mjs.map +1 -0
- package/dist/admin/chunks/uk-CbRUr1I7.js +16 -0
- package/dist/admin/chunks/uk-CbRUr1I7.js.map +1 -0
- package/dist/admin/chunks/uk-DLlzEBUF.mjs +14 -0
- package/dist/admin/chunks/uk-DLlzEBUF.mjs.map +1 -0
- package/dist/admin/index.js +2 -2
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/routes/content-manager/model/id/components/AssigneeSelect.d.ts +3 -1
- package/dist/admin/src/routes/content-manager/model/id/components/Header.d.ts +5 -0
- package/dist/admin/src/routes/content-manager/model/id/components/StageSelect.d.ts +3 -1
- package/package.json +7 -8
- package/dist/admin/chunks/Layout-CXRcBLOx.js.map +0 -1
- package/dist/admin/chunks/en-BixG7IBu.js.map +0 -1
- package/dist/admin/chunks/en-C6SESe-Y.js.map +0 -1
- package/dist/admin/chunks/id-SiBUWtYE.js.map +0 -1
- package/dist/admin/chunks/index-C5IeISWp.js.map +0 -1
- package/dist/admin/chunks/index-D-2M8KV9.js.map +0 -1
- package/dist/admin/chunks/index-Df6sZesT.js.map +0 -1
- package/dist/admin/chunks/purchase-review-workflows-CEP8kvxZ.js +0 -53
- package/dist/admin/chunks/purchase-review-workflows-CEP8kvxZ.js.map +0 -1
- package/dist/admin/chunks/purchase-review-workflows-Drlxm8yP.js +0 -55
- package/dist/admin/chunks/purchase-review-workflows-Drlxm8yP.js.map +0 -1
- package/dist/admin/chunks/router-C9Jpl4gL.js.map +0 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
var designSystem = require('@strapi/design-system');
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var strapiAdmin$1 = require('@strapi/content-manager/strapi-admin');
|
|
6
|
-
var reactIntl = require('react-intl');
|
|
7
6
|
var reactRouterDom = require('react-router-dom');
|
|
8
7
|
var React = require('react');
|
|
9
8
|
var strapiAdmin = require('@strapi/admin/strapi-admin');
|
|
9
|
+
var reactIntl = require('react-intl');
|
|
10
10
|
var reactRedux = require('react-redux');
|
|
11
11
|
var ee = require('@strapi/admin/strapi-admin/ee');
|
|
12
12
|
var icons = require('@strapi/icons');
|
|
@@ -175,7 +175,7 @@ const isBaseQueryError = (error)=>{
|
|
|
175
175
|
const STAGE_ATTRIBUTE_NAME = 'strapi_stage';
|
|
176
176
|
const ASSIGNEE_ATTRIBUTE_NAME = 'strapi_assignee';
|
|
177
177
|
|
|
178
|
-
const AssigneeSelect = ()=>{
|
|
178
|
+
const AssigneeSelect = ({ isCompact })=>{
|
|
179
179
|
const { collectionType = '', id, slug: model = '' } = reactRouterDom.useParams();
|
|
180
180
|
const permissions = useTypedSelector((state)=>state.admin_app.permissions);
|
|
181
181
|
const { formatMessage } = reactIntl.useIntl();
|
|
@@ -186,7 +186,7 @@ const AssigneeSelect = ()=>{
|
|
|
186
186
|
const params = React__namespace.useMemo(()=>buildValidParams(query), [
|
|
187
187
|
query
|
|
188
188
|
]);
|
|
189
|
-
const { data, isLoading, isError } = strapiAdmin.useAdminUsers(undefined, {
|
|
189
|
+
const { data, isLoading: isLoadingUsers, isError } = strapiAdmin.useAdminUsers(undefined, {
|
|
190
190
|
skip: isLoadingPermissions || !canRead
|
|
191
191
|
});
|
|
192
192
|
const { document } = strapiAdmin$1.unstable_useDocument({
|
|
@@ -225,7 +225,57 @@ const AssigneeSelect = ()=>{
|
|
|
225
225
|
})
|
|
226
226
|
});
|
|
227
227
|
}
|
|
228
|
+
if (isCompact && 'error' in res) {
|
|
229
|
+
toggleNotification({
|
|
230
|
+
type: 'danger',
|
|
231
|
+
message: formatAPIError(res.error)
|
|
232
|
+
});
|
|
233
|
+
}
|
|
228
234
|
};
|
|
235
|
+
const isDisabled = !isLoadingPermissions && !isLoadingUsers && users.length === 0 || !document.documentId;
|
|
236
|
+
const isLoading = isLoadingUsers || isLoadingPermissions || isMutating;
|
|
237
|
+
const assigneeLabel = formatMessage({
|
|
238
|
+
id: 'content-manager.reviewWorkflows.assignee.label',
|
|
239
|
+
defaultMessage: 'Assignee'
|
|
240
|
+
});
|
|
241
|
+
const assigneeClearLabel = formatMessage({
|
|
242
|
+
id: 'content-manager.reviewWorkflows.assignee.clear',
|
|
243
|
+
defaultMessage: 'Clear assignee'
|
|
244
|
+
});
|
|
245
|
+
const assigneePlaceholder = formatMessage({
|
|
246
|
+
id: 'content-manager.reviewWorkflows.assignee.placeholder',
|
|
247
|
+
defaultMessage: 'Select…'
|
|
248
|
+
});
|
|
249
|
+
if (isCompact) {
|
|
250
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
|
|
251
|
+
name: ASSIGNEE_ATTRIBUTE_NAME,
|
|
252
|
+
id: ASSIGNEE_ATTRIBUTE_NAME,
|
|
253
|
+
children: [
|
|
254
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
|
|
255
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
|
|
256
|
+
children: assigneeLabel
|
|
257
|
+
})
|
|
258
|
+
}),
|
|
259
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Combobox, {
|
|
260
|
+
clearLabel: assigneeClearLabel,
|
|
261
|
+
disabled: isDisabled,
|
|
262
|
+
value: currentAssignee ? currentAssignee.id.toString() : null,
|
|
263
|
+
onChange: handleChange,
|
|
264
|
+
onClear: ()=>handleChange(null),
|
|
265
|
+
placeholder: assigneePlaceholder,
|
|
266
|
+
loading: isLoading || isLoadingPermissions || isMutating,
|
|
267
|
+
size: "S",
|
|
268
|
+
children: users.map((user)=>{
|
|
269
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.ComboboxOption, {
|
|
270
|
+
value: user.id.toString(),
|
|
271
|
+
textValue: getDisplayName(user),
|
|
272
|
+
children: getDisplayName(user)
|
|
273
|
+
}, user.id);
|
|
274
|
+
})
|
|
275
|
+
})
|
|
276
|
+
]
|
|
277
|
+
});
|
|
278
|
+
}
|
|
229
279
|
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
|
|
230
280
|
name: ASSIGNEE_ATTRIBUTE_NAME,
|
|
231
281
|
id: ASSIGNEE_ATTRIBUTE_NAME,
|
|
@@ -235,24 +285,15 @@ const AssigneeSelect = ()=>{
|
|
|
235
285
|
}) || error && formatAPIError(error)) ?? undefined,
|
|
236
286
|
children: [
|
|
237
287
|
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
|
|
238
|
-
children:
|
|
239
|
-
id: 'content-manager.reviewWorkflows.assignee.label',
|
|
240
|
-
defaultMessage: 'Assignee'
|
|
241
|
-
})
|
|
288
|
+
children: assigneeLabel
|
|
242
289
|
}),
|
|
243
290
|
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Combobox, {
|
|
244
|
-
clearLabel:
|
|
245
|
-
id: 'content-manager.reviewWorkflows.assignee.clear',
|
|
246
|
-
defaultMessage: 'Clear assignee'
|
|
247
|
-
}),
|
|
291
|
+
clearLabel: assigneeClearLabel,
|
|
248
292
|
disabled: !isLoadingPermissions && !isLoading && users.length === 0 || !document.documentId,
|
|
249
293
|
value: currentAssignee ? currentAssignee.id.toString() : null,
|
|
250
294
|
onChange: handleChange,
|
|
251
295
|
onClear: ()=>handleChange(null),
|
|
252
|
-
placeholder:
|
|
253
|
-
id: 'content-manager.reviewWorkflows.assignee.placeholder',
|
|
254
|
-
defaultMessage: 'Select…'
|
|
255
|
-
}),
|
|
296
|
+
placeholder: assigneePlaceholder,
|
|
256
297
|
loading: isLoading || isLoadingPermissions || isMutating,
|
|
257
298
|
children: users.map((user)=>{
|
|
258
299
|
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.ComboboxOption, {
|
|
@@ -422,7 +463,115 @@ const AVAILABLE_COLORS = Object.entries(STAGE_COLORS).map(([themeColorName, name
|
|
|
422
463
|
name
|
|
423
464
|
}));
|
|
424
465
|
|
|
425
|
-
|
|
466
|
+
/* -------------------------------------------------------------------------------------------------
|
|
467
|
+
* LimitModals
|
|
468
|
+
* -----------------------------------------------------------------------------------------------*/ const WorkflowLimitModal = ({ open, onOpenChange })=>{
|
|
469
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
470
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(LimitsModal.Root, {
|
|
471
|
+
open: open,
|
|
472
|
+
onOpenChange: onOpenChange,
|
|
473
|
+
children: [
|
|
474
|
+
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Title, {
|
|
475
|
+
children: formatMessage({
|
|
476
|
+
id: 'content-manager.reviewWorkflows.workflows.limit.title',
|
|
477
|
+
defaultMessage: 'You’ve reached the limit of workflows in your plan'
|
|
478
|
+
})
|
|
479
|
+
}),
|
|
480
|
+
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Body, {
|
|
481
|
+
children: formatMessage({
|
|
482
|
+
id: 'content-manager.reviewWorkflows.workflows.limit.body',
|
|
483
|
+
defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.'
|
|
484
|
+
})
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
});
|
|
488
|
+
};
|
|
489
|
+
const StageLimitModal = ({ open, onOpenChange })=>{
|
|
490
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
491
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(LimitsModal.Root, {
|
|
492
|
+
open: open,
|
|
493
|
+
onOpenChange: onOpenChange,
|
|
494
|
+
children: [
|
|
495
|
+
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Title, {
|
|
496
|
+
children: formatMessage({
|
|
497
|
+
id: 'content-manager.reviewWorkflows.stages.limit.title',
|
|
498
|
+
defaultMessage: 'You have reached the limit of stages for this workflow in your plan'
|
|
499
|
+
})
|
|
500
|
+
}),
|
|
501
|
+
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Body, {
|
|
502
|
+
children: formatMessage({
|
|
503
|
+
id: 'content-manager.reviewWorkflows.stages.limit.body',
|
|
504
|
+
defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.'
|
|
505
|
+
})
|
|
506
|
+
})
|
|
507
|
+
]
|
|
508
|
+
});
|
|
509
|
+
};
|
|
510
|
+
/* -------------------------------------------------------------------------------------------------
|
|
511
|
+
* StageSelect
|
|
512
|
+
* -----------------------------------------------------------------------------------------------*/ const Select = ({ stages, activeWorkflowStage, isLoading, ...props })=>{
|
|
513
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
514
|
+
const { themeColorName } = getStageColorByHex(activeWorkflowStage?.color) ?? {};
|
|
515
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelect, {
|
|
516
|
+
disabled: stages.length === 0,
|
|
517
|
+
placeholder: formatMessage({
|
|
518
|
+
id: 'content-manager.reviewWorkflows.assignee.placeholder',
|
|
519
|
+
defaultMessage: 'Select…'
|
|
520
|
+
}),
|
|
521
|
+
startIcon: activeWorkflowStage && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
|
|
522
|
+
tag: "span",
|
|
523
|
+
height: 2,
|
|
524
|
+
background: activeWorkflowStage?.color,
|
|
525
|
+
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
|
|
526
|
+
hasRadius: true,
|
|
527
|
+
shrink: 0,
|
|
528
|
+
width: 2,
|
|
529
|
+
marginRight: "-3px"
|
|
530
|
+
}),
|
|
531
|
+
// @ts-expect-error – `customizeContent` is not correctly typed in the DS.
|
|
532
|
+
customizeContent: ()=>{
|
|
533
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
534
|
+
tag: "span",
|
|
535
|
+
justifyContent: "space-between",
|
|
536
|
+
alignItems: "center",
|
|
537
|
+
width: "100%",
|
|
538
|
+
children: [
|
|
539
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
540
|
+
textColor: "neutral800",
|
|
541
|
+
ellipsis: true,
|
|
542
|
+
lineHeight: "inherit",
|
|
543
|
+
children: activeWorkflowStage?.name ?? ''
|
|
544
|
+
}),
|
|
545
|
+
isLoading ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Loader, {
|
|
546
|
+
small: true,
|
|
547
|
+
style: {
|
|
548
|
+
display: 'flex'
|
|
549
|
+
},
|
|
550
|
+
"data-testid": "loader"
|
|
551
|
+
}) : null
|
|
552
|
+
]
|
|
553
|
+
});
|
|
554
|
+
},
|
|
555
|
+
...props,
|
|
556
|
+
children: stages.map(({ id, color, name })=>{
|
|
557
|
+
const { themeColorName } = getStageColorByHex(color) ?? {};
|
|
558
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
|
|
559
|
+
startIcon: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
|
|
560
|
+
height: 2,
|
|
561
|
+
background: color,
|
|
562
|
+
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
|
|
563
|
+
hasRadius: true,
|
|
564
|
+
shrink: 0,
|
|
565
|
+
width: 2
|
|
566
|
+
}),
|
|
567
|
+
value: id,
|
|
568
|
+
textValue: name,
|
|
569
|
+
children: name
|
|
570
|
+
}, id);
|
|
571
|
+
})
|
|
572
|
+
});
|
|
573
|
+
};
|
|
574
|
+
const StageSelect = ({ isCompact })=>{
|
|
426
575
|
const { collectionType = '', slug: model = '', id = '' } = reactRouterDom.useParams();
|
|
427
576
|
const { formatMessage } = reactIntl.useIntl();
|
|
428
577
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
@@ -495,6 +644,12 @@ const StageSelect = ()=>{
|
|
|
495
644
|
})
|
|
496
645
|
});
|
|
497
646
|
}
|
|
647
|
+
if (isCompact && 'error' in res) {
|
|
648
|
+
toggleNotification({
|
|
649
|
+
type: 'danger',
|
|
650
|
+
message: formatAPIError(res.error)
|
|
651
|
+
});
|
|
652
|
+
}
|
|
498
653
|
}
|
|
499
654
|
}
|
|
500
655
|
} catch (error) {
|
|
@@ -507,127 +662,118 @@ const StageSelect = ()=>{
|
|
|
507
662
|
});
|
|
508
663
|
}
|
|
509
664
|
};
|
|
510
|
-
const { themeColorName } = getStageColorByHex(activeWorkflowStage?.color) ?? {};
|
|
511
665
|
const isLoading = isLoadingStages || isLoadingDocument;
|
|
666
|
+
const reviewStageLabel = formatMessage({
|
|
667
|
+
id: 'content-manager.reviewWorkflows.stage.label',
|
|
668
|
+
defaultMessage: 'Review stage'
|
|
669
|
+
});
|
|
670
|
+
const reviewStageHint = !isLoading && stages.length === 0 && // TODO: Handle errors and hints
|
|
671
|
+
formatMessage({
|
|
672
|
+
id: 'content-manager.reviewWorkflows.stages.no-transition',
|
|
673
|
+
defaultMessage: 'You don’t have the permission to update this stage.'
|
|
674
|
+
});
|
|
675
|
+
if (isCompact) {
|
|
676
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
677
|
+
children: [
|
|
678
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
|
|
679
|
+
label: reviewStageHint,
|
|
680
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Root, {
|
|
681
|
+
name: STAGE_ATTRIBUTE_NAME,
|
|
682
|
+
id: STAGE_ATTRIBUTE_NAME,
|
|
683
|
+
children: /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
684
|
+
children: [
|
|
685
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.VisuallyHidden, {
|
|
686
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
|
|
687
|
+
children: reviewStageLabel
|
|
688
|
+
})
|
|
689
|
+
}),
|
|
690
|
+
/*#__PURE__*/ jsxRuntime.jsx(Select, {
|
|
691
|
+
stages: stages,
|
|
692
|
+
activeWorkflowStage: activeWorkflowStage,
|
|
693
|
+
isLoading: isLoading,
|
|
694
|
+
size: "S",
|
|
695
|
+
disabled: stages.length === 0,
|
|
696
|
+
value: activeWorkflowStage?.id,
|
|
697
|
+
onChange: handleChange,
|
|
698
|
+
placeholder: formatMessage({
|
|
699
|
+
id: 'content-manager.reviewWorkflows.assignee.placeholder',
|
|
700
|
+
defaultMessage: 'Select…'
|
|
701
|
+
})
|
|
702
|
+
})
|
|
703
|
+
]
|
|
704
|
+
})
|
|
705
|
+
})
|
|
706
|
+
}),
|
|
707
|
+
/*#__PURE__*/ jsxRuntime.jsx(WorkflowLimitModal, {
|
|
708
|
+
open: showLimitModal === 'workflow',
|
|
709
|
+
onOpenChange: ()=>setShowLimitModal(null)
|
|
710
|
+
}),
|
|
711
|
+
/*#__PURE__*/ jsxRuntime.jsx(StageLimitModal, {
|
|
712
|
+
open: showLimitModal === 'stage',
|
|
713
|
+
onOpenChange: ()=>setShowLimitModal(null)
|
|
714
|
+
})
|
|
715
|
+
]
|
|
716
|
+
});
|
|
717
|
+
}
|
|
512
718
|
return /*#__PURE__*/ jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
513
719
|
children: [
|
|
514
720
|
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Field.Root, {
|
|
515
|
-
hint:
|
|
516
|
-
id: 'content-manager.reviewWorkflows.stages.no-transition',
|
|
517
|
-
defaultMessage: 'You don’t have the permission to update this stage.'
|
|
518
|
-
}),
|
|
721
|
+
hint: reviewStageHint,
|
|
519
722
|
error: error && formatAPIError(error) || undefined,
|
|
520
723
|
name: STAGE_ATTRIBUTE_NAME,
|
|
521
724
|
id: STAGE_ATTRIBUTE_NAME,
|
|
522
725
|
children: [
|
|
523
726
|
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Label, {
|
|
524
|
-
children:
|
|
525
|
-
id: 'content-manager.reviewWorkflows.stage.label',
|
|
526
|
-
defaultMessage: 'Review stage'
|
|
527
|
-
})
|
|
727
|
+
children: reviewStageLabel
|
|
528
728
|
}),
|
|
529
|
-
/*#__PURE__*/ jsxRuntime.jsx(
|
|
729
|
+
/*#__PURE__*/ jsxRuntime.jsx(Select, {
|
|
730
|
+
stages: stages,
|
|
731
|
+
activeWorkflowStage: activeWorkflowStage,
|
|
732
|
+
isLoading: isLoading,
|
|
530
733
|
disabled: stages.length === 0,
|
|
531
734
|
value: activeWorkflowStage?.id,
|
|
532
735
|
onChange: handleChange,
|
|
533
736
|
placeholder: formatMessage({
|
|
534
737
|
id: 'content-manager.reviewWorkflows.assignee.placeholder',
|
|
535
738
|
defaultMessage: 'Select…'
|
|
536
|
-
}),
|
|
537
|
-
startIcon: activeWorkflowStage && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
|
|
538
|
-
tag: "span",
|
|
539
|
-
height: 2,
|
|
540
|
-
background: activeWorkflowStage?.color,
|
|
541
|
-
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
|
|
542
|
-
hasRadius: true,
|
|
543
|
-
shrink: 0,
|
|
544
|
-
width: 2,
|
|
545
|
-
marginRight: "-3px"
|
|
546
|
-
}),
|
|
547
|
-
// @ts-expect-error – `customizeContent` is not correctly typed in the DS.
|
|
548
|
-
customizeContent: ()=>{
|
|
549
|
-
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
550
|
-
tag: "span",
|
|
551
|
-
justifyContent: "space-between",
|
|
552
|
-
alignItems: "center",
|
|
553
|
-
width: "100%",
|
|
554
|
-
children: [
|
|
555
|
-
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
556
|
-
textColor: "neutral800",
|
|
557
|
-
ellipsis: true,
|
|
558
|
-
children: activeWorkflowStage?.name ?? ''
|
|
559
|
-
}),
|
|
560
|
-
isLoading ? /*#__PURE__*/ jsxRuntime.jsx(designSystem.Loader, {
|
|
561
|
-
small: true,
|
|
562
|
-
style: {
|
|
563
|
-
display: 'flex'
|
|
564
|
-
},
|
|
565
|
-
"data-testid": "loader"
|
|
566
|
-
}) : null
|
|
567
|
-
]
|
|
568
|
-
});
|
|
569
|
-
},
|
|
570
|
-
children: stages.map(({ id, color, name })=>{
|
|
571
|
-
const { themeColorName } = getStageColorByHex(color) ?? {};
|
|
572
|
-
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
|
|
573
|
-
startIcon: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Flex, {
|
|
574
|
-
height: 2,
|
|
575
|
-
background: color,
|
|
576
|
-
borderColor: themeColorName === 'neutral0' ? 'neutral150' : undefined,
|
|
577
|
-
hasRadius: true,
|
|
578
|
-
shrink: 0,
|
|
579
|
-
width: 2
|
|
580
|
-
}),
|
|
581
|
-
value: id,
|
|
582
|
-
textValue: name,
|
|
583
|
-
children: name
|
|
584
|
-
}, id);
|
|
585
739
|
})
|
|
586
740
|
}),
|
|
587
741
|
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
|
588
742
|
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
589
743
|
]
|
|
590
744
|
}),
|
|
591
|
-
/*#__PURE__*/ jsxRuntime.
|
|
745
|
+
/*#__PURE__*/ jsxRuntime.jsx(WorkflowLimitModal, {
|
|
592
746
|
open: showLimitModal === 'workflow',
|
|
593
|
-
onOpenChange: ()=>setShowLimitModal(null)
|
|
594
|
-
children: [
|
|
595
|
-
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Title, {
|
|
596
|
-
children: formatMessage({
|
|
597
|
-
id: 'content-manager.reviewWorkflows.workflows.limit.title',
|
|
598
|
-
defaultMessage: 'You’ve reached the limit of workflows in your plan'
|
|
599
|
-
})
|
|
600
|
-
}),
|
|
601
|
-
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Body, {
|
|
602
|
-
children: formatMessage({
|
|
603
|
-
id: 'content-manager.reviewWorkflows.workflows.limit.body',
|
|
604
|
-
defaultMessage: 'Delete a workflow or contact Sales to enable more workflows.'
|
|
605
|
-
})
|
|
606
|
-
})
|
|
607
|
-
]
|
|
747
|
+
onOpenChange: ()=>setShowLimitModal(null)
|
|
608
748
|
}),
|
|
609
|
-
/*#__PURE__*/ jsxRuntime.
|
|
749
|
+
/*#__PURE__*/ jsxRuntime.jsx(StageLimitModal, {
|
|
610
750
|
open: showLimitModal === 'stage',
|
|
611
|
-
onOpenChange: ()=>setShowLimitModal(null)
|
|
612
|
-
children: [
|
|
613
|
-
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Title, {
|
|
614
|
-
children: formatMessage({
|
|
615
|
-
id: 'content-manager.reviewWorkflows.stages.limit.title',
|
|
616
|
-
defaultMessage: 'You have reached the limit of stages for this workflow in your plan'
|
|
617
|
-
})
|
|
618
|
-
}),
|
|
619
|
-
/*#__PURE__*/ jsxRuntime.jsx(LimitsModal.Body, {
|
|
620
|
-
children: formatMessage({
|
|
621
|
-
id: 'content-manager.reviewWorkflows.stages.limit.body',
|
|
622
|
-
defaultMessage: 'Try deleting some stages or contact Sales to enable more stages.'
|
|
623
|
-
})
|
|
624
|
-
})
|
|
625
|
-
]
|
|
751
|
+
onOpenChange: ()=>setShowLimitModal(null)
|
|
626
752
|
})
|
|
627
753
|
]
|
|
628
754
|
});
|
|
629
755
|
};
|
|
630
756
|
|
|
757
|
+
const Header = ()=>{
|
|
758
|
+
const { slug = '', id, collectionType } = reactRouterDom.useParams();
|
|
759
|
+
const { edit: { options } } = strapiAdmin$1.unstable_useDocumentLayout(slug);
|
|
760
|
+
if (!window.strapi.isEE || !options?.reviewWorkflows || collectionType !== 'single-types' && !id || id === 'create') {
|
|
761
|
+
return null;
|
|
762
|
+
}
|
|
763
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
764
|
+
gap: 2,
|
|
765
|
+
children: [
|
|
766
|
+
/*#__PURE__*/ jsxRuntime.jsx(AssigneeSelect, {
|
|
767
|
+
isCompact: true
|
|
768
|
+
}),
|
|
769
|
+
/*#__PURE__*/ jsxRuntime.jsx(StageSelect, {
|
|
770
|
+
isCompact: true
|
|
771
|
+
})
|
|
772
|
+
]
|
|
773
|
+
});
|
|
774
|
+
};
|
|
775
|
+
Header.type = 'preview';
|
|
776
|
+
|
|
631
777
|
const Panel = ()=>{
|
|
632
778
|
const { slug = '', id, collectionType } = reactRouterDom.useParams();
|
|
633
779
|
const { edit: { options } } = strapiAdmin$1.unstable_useDocumentLayout(slug);
|
|
@@ -873,7 +1019,8 @@ const prefixPluginTranslations = (trad, pluginId)=>{
|
|
|
873
1019
|
|
|
874
1020
|
function __variableDynamicImportRuntime2__(path) {
|
|
875
1021
|
switch (path) {
|
|
876
|
-
case './translations/en.json': return Promise.resolve().then(function () { return require('./en-
|
|
1022
|
+
case './translations/en.json': return Promise.resolve().then(function () { return require('./en-BNGiWajd.js'); });
|
|
1023
|
+
case './translations/uk.json': return Promise.resolve().then(function () { return require('./uk-CbRUr1I7.js'); });
|
|
877
1024
|
default: return new Promise(function(resolve, reject) {
|
|
878
1025
|
(typeof queueMicrotask === 'function' ? queueMicrotask : setTimeout)(
|
|
879
1026
|
reject.bind(null, new Error("Unknown variable dynamic import: " + path))
|
|
@@ -900,7 +1047,7 @@ const admin = {
|
|
|
900
1047
|
},
|
|
901
1048
|
permissions: [],
|
|
902
1049
|
async Component () {
|
|
903
|
-
const { Router } = await Promise.resolve().then(function () { return require('./router-
|
|
1050
|
+
const { Router } = await Promise.resolve().then(function () { return require('./router-Cc8VcSCc.js'); });
|
|
904
1051
|
return {
|
|
905
1052
|
default: Router
|
|
906
1053
|
};
|
|
@@ -917,7 +1064,7 @@ const admin = {
|
|
|
917
1064
|
licenseOnly: true,
|
|
918
1065
|
permissions: [],
|
|
919
1066
|
async Component () {
|
|
920
|
-
const { PurchaseReviewWorkflows } = await Promise.resolve().then(function () { return require('./purchase-review-workflows-
|
|
1067
|
+
const { PurchaseReviewWorkflows } = await Promise.resolve().then(function () { return require('./purchase-review-workflows-BQL0PbmB.js'); });
|
|
921
1068
|
return {
|
|
922
1069
|
default: PurchaseReviewWorkflows
|
|
923
1070
|
};
|
|
@@ -925,6 +1072,14 @@ const admin = {
|
|
|
925
1072
|
});
|
|
926
1073
|
}
|
|
927
1074
|
},
|
|
1075
|
+
bootstrap (app) {
|
|
1076
|
+
if (window.strapi.features.isEnabled(FEATURE_ID)) {
|
|
1077
|
+
app.getPlugin('content-manager').injectComponent('preview', 'actions', {
|
|
1078
|
+
name: 'review-workflows-assignee',
|
|
1079
|
+
Component: Header
|
|
1080
|
+
});
|
|
1081
|
+
}
|
|
1082
|
+
},
|
|
928
1083
|
async registerTrads ({ locales }) {
|
|
929
1084
|
const importedTrads = await Promise.all(locales.map((locale)=>{
|
|
930
1085
|
return __variableDynamicImportRuntime2__(`./translations/${locale}.json`).then(({ default: data })=>{
|
|
@@ -957,4 +1112,4 @@ exports.useGetContentTypesQuery = useGetContentTypesQuery;
|
|
|
957
1112
|
exports.useGetWorkflowsQuery = useGetWorkflowsQuery;
|
|
958
1113
|
exports.useTypedSelector = useTypedSelector;
|
|
959
1114
|
exports.useUpdateWorkflowMutation = useUpdateWorkflowMutation;
|
|
960
|
-
//# sourceMappingURL=index-
|
|
1115
|
+
//# sourceMappingURL=index-CEABZUwQ.js.map
|