@strapi/content-releases 0.0.0-next.09b9d36b22a205d90c9303f2e37134938cf76c90 → 0.0.0-next.0a8a7f1e0ee2fb410eeffb9eb1943d28f1f24705
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/App-HVXzE3i3.mjs +1313 -0
- package/dist/_chunks/App-HVXzE3i3.mjs.map +1 -0
- package/dist/_chunks/{App-8384e404.js → App-l62gIUTX.js} +790 -421
- package/dist/_chunks/App-l62gIUTX.js.map +1 -0
- package/dist/_chunks/PurchaseContentReleases-Clm0iACO.mjs +51 -0
- package/dist/_chunks/PurchaseContentReleases-Clm0iACO.mjs.map +1 -0
- package/dist/_chunks/PurchaseContentReleases-YhAPgpG9.js +51 -0
- package/dist/_chunks/PurchaseContentReleases-YhAPgpG9.js.map +1 -0
- package/dist/_chunks/{en-142f336a.mjs → en-RdapH-9X.mjs} +22 -7
- package/dist/_chunks/en-RdapH-9X.mjs.map +1 -0
- package/dist/_chunks/{en-f235921e.js → en-faJDuv3q.js} +22 -7
- package/dist/_chunks/en-faJDuv3q.js.map +1 -0
- package/dist/_chunks/{index-7250b0a5.js → index-ML_b3php.js} +248 -48
- package/dist/_chunks/index-ML_b3php.js.map +1 -0
- package/dist/_chunks/{index-e14e1ea9.mjs → index-Ys87ROOe.mjs} +263 -63
- package/dist/_chunks/index-Ys87ROOe.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +3 -2
- package/dist/admin/index.mjs.map +1 -1
- package/dist/server/index.js +1130 -299
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +1129 -300
- package/dist/server/index.mjs.map +1 -1
- package/package.json +15 -11
- package/dist/_chunks/App-8384e404.js.map +0 -1
- package/dist/_chunks/App-c3fca40f.mjs +0 -945
- package/dist/_chunks/App-c3fca40f.mjs.map +0 -1
- package/dist/_chunks/en-142f336a.mjs.map +0 -1
- package/dist/_chunks/en-f235921e.js.map +0 -1
- package/dist/_chunks/index-7250b0a5.js.map +0 -1
- package/dist/_chunks/index-e14e1ea9.mjs.map +0 -1
|
@@ -13,6 +13,7 @@ const reactRouterDom = require("react-router-dom");
|
|
|
13
13
|
const yup = require("yup");
|
|
14
14
|
const react = require("@reduxjs/toolkit/query/react");
|
|
15
15
|
const styled = require("styled-components");
|
|
16
|
+
const reactRedux = require("react-redux");
|
|
16
17
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
17
18
|
function _interopNamespace(e) {
|
|
18
19
|
if (e && e.__esModule)
|
|
@@ -281,7 +282,27 @@ const releaseApi = react.createApi({
|
|
|
281
282
|
data: body
|
|
282
283
|
};
|
|
283
284
|
},
|
|
284
|
-
invalidatesTags: () => [{ type: "ReleaseAction", id: "LIST" }]
|
|
285
|
+
invalidatesTags: () => [{ type: "ReleaseAction", id: "LIST" }],
|
|
286
|
+
async onQueryStarted({ body, params, query: query2, actionPath }, { dispatch, queryFulfilled }) {
|
|
287
|
+
const paramsWithoutActionId = {
|
|
288
|
+
releaseId: params.releaseId,
|
|
289
|
+
...query2
|
|
290
|
+
};
|
|
291
|
+
const patchResult = dispatch(
|
|
292
|
+
releaseApi.util.updateQueryData("getReleaseActions", paramsWithoutActionId, (draft) => {
|
|
293
|
+
const [key, index] = actionPath;
|
|
294
|
+
const action = draft.data[key][index];
|
|
295
|
+
if (action) {
|
|
296
|
+
action.type = body.type;
|
|
297
|
+
}
|
|
298
|
+
})
|
|
299
|
+
);
|
|
300
|
+
try {
|
|
301
|
+
await queryFulfilled;
|
|
302
|
+
} catch {
|
|
303
|
+
patchResult.undo();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
285
306
|
}),
|
|
286
307
|
deleteReleaseAction: build.mutation({
|
|
287
308
|
query({ params }) {
|
|
@@ -290,8 +311,9 @@ const releaseApi = react.createApi({
|
|
|
290
311
|
method: "DELETE"
|
|
291
312
|
};
|
|
292
313
|
},
|
|
293
|
-
invalidatesTags: [
|
|
314
|
+
invalidatesTags: (result, error, arg) => [
|
|
294
315
|
{ type: "Release", id: "LIST" },
|
|
316
|
+
{ type: "Release", id: arg.params.releaseId },
|
|
295
317
|
{ type: "ReleaseAction", id: "LIST" }
|
|
296
318
|
]
|
|
297
319
|
}),
|
|
@@ -311,7 +333,7 @@ const releaseApi = react.createApi({
|
|
|
311
333
|
method: "DELETE"
|
|
312
334
|
};
|
|
313
335
|
},
|
|
314
|
-
invalidatesTags: (
|
|
336
|
+
invalidatesTags: () => [{ type: "Release", id: "LIST" }]
|
|
315
337
|
})
|
|
316
338
|
};
|
|
317
339
|
}
|
|
@@ -329,29 +351,59 @@ const {
|
|
|
329
351
|
useDeleteReleaseActionMutation,
|
|
330
352
|
useDeleteReleaseMutation
|
|
331
353
|
} = releaseApi;
|
|
354
|
+
const getTimezoneOffset = (timezone, date) => {
|
|
355
|
+
try {
|
|
356
|
+
const offsetPart = new Intl.DateTimeFormat("en", {
|
|
357
|
+
timeZone: timezone,
|
|
358
|
+
timeZoneName: "longOffset"
|
|
359
|
+
}).formatToParts(date).find((part) => part.type === "timeZoneName");
|
|
360
|
+
const offset = offsetPart ? offsetPart.value : "";
|
|
361
|
+
let utcOffset = offset.replace("GMT", "UTC");
|
|
362
|
+
if (!utcOffset.includes("+") && !utcOffset.includes("-")) {
|
|
363
|
+
utcOffset = `${utcOffset}+00:00`;
|
|
364
|
+
}
|
|
365
|
+
return utcOffset;
|
|
366
|
+
} catch (error) {
|
|
367
|
+
return "";
|
|
368
|
+
}
|
|
369
|
+
};
|
|
370
|
+
const useTypedDispatch = reactRedux.useDispatch;
|
|
371
|
+
const useTypedSelector = reactRedux.useSelector;
|
|
332
372
|
const StyledMenuItem = styled__default.default(v2.Menu.Item)`
|
|
333
373
|
&:hover {
|
|
334
|
-
background: ${({ theme }) => theme.colors
|
|
374
|
+
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
375
|
+
|
|
376
|
+
svg {
|
|
377
|
+
path {
|
|
378
|
+
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
a {
|
|
383
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
384
|
+
}
|
|
335
385
|
}
|
|
336
386
|
|
|
337
387
|
svg {
|
|
338
388
|
path {
|
|
339
|
-
fill: ${({ theme }) => theme.colors
|
|
389
|
+
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
340
390
|
}
|
|
341
391
|
}
|
|
342
392
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
393
|
+
a {
|
|
394
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
span,
|
|
398
|
+
a {
|
|
399
|
+
width: 100%;
|
|
349
400
|
}
|
|
350
401
|
`;
|
|
351
|
-
const
|
|
352
|
-
|
|
402
|
+
const StyledIconButton = styled__default.default(designSystem.IconButton)`
|
|
403
|
+
/* Setting this style inline with borderColor will not apply the style */
|
|
404
|
+
border: ${({ theme }) => `1px solid ${theme.colors.neutral200}`};
|
|
353
405
|
`;
|
|
354
|
-
const
|
|
406
|
+
const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
|
|
355
407
|
const { formatMessage } = reactIntl.useIntl();
|
|
356
408
|
const toggleNotification = helperPlugin.useNotification();
|
|
357
409
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -384,13 +436,80 @@ const ReleaseActionMenu = ({ releaseId, actionId }) => {
|
|
|
384
436
|
}
|
|
385
437
|
}
|
|
386
438
|
};
|
|
439
|
+
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { variant: "danger", onSelect: handleDeleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
440
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Cross, width: 3, height: 3 }),
|
|
441
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
|
|
442
|
+
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
443
|
+
defaultMessage: "Remove from release"
|
|
444
|
+
}) })
|
|
445
|
+
] }) }) });
|
|
446
|
+
};
|
|
447
|
+
const ReleaseActionEntryLinkItem = ({
|
|
448
|
+
contentTypeUid,
|
|
449
|
+
entryId,
|
|
450
|
+
locale
|
|
451
|
+
}) => {
|
|
452
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
453
|
+
const collectionTypePermissions = useTypedSelector(
|
|
454
|
+
(state) => state.rbacProvider.collectionTypesRelatedPermissions
|
|
455
|
+
);
|
|
456
|
+
const updatePermissions = contentTypeUid ? collectionTypePermissions[contentTypeUid]?.["plugin::content-manager.explorer.update"] : [];
|
|
457
|
+
const canUpdateEntryForLocale = Boolean(
|
|
458
|
+
!locale || updatePermissions?.find(
|
|
459
|
+
(permission) => permission.properties?.locales?.includes(locale)
|
|
460
|
+
)
|
|
461
|
+
);
|
|
462
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
463
|
+
helperPlugin.CheckPermissions,
|
|
464
|
+
{
|
|
465
|
+
permissions: [
|
|
466
|
+
{
|
|
467
|
+
action: "plugin::content-manager.explorer.update",
|
|
468
|
+
subject: contentTypeUid
|
|
469
|
+
}
|
|
470
|
+
],
|
|
471
|
+
children: canUpdateEntryForLocale && /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
472
|
+
v2.Link,
|
|
473
|
+
{
|
|
474
|
+
as: reactRouterDom.NavLink,
|
|
475
|
+
to: {
|
|
476
|
+
pathname: `/content-manager/collection-types/${contentTypeUid}/${entryId}`,
|
|
477
|
+
search: locale && `?plugins[i18n][locale]=${locale}`
|
|
478
|
+
},
|
|
479
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Pencil, width: 3, height: 3 }),
|
|
480
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
481
|
+
id: "content-releases.content-manager-edit-view.edit-entry",
|
|
482
|
+
defaultMessage: "Edit entry"
|
|
483
|
+
}) })
|
|
484
|
+
}
|
|
485
|
+
) })
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
};
|
|
489
|
+
const EditReleaseItem = ({ releaseId }) => {
|
|
490
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
491
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
492
|
+
v2.Link,
|
|
493
|
+
{
|
|
494
|
+
href: `/admin/plugins/content-releases/${releaseId}`,
|
|
495
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Pencil, width: 3, height: 3 }),
|
|
496
|
+
isExternal: false,
|
|
497
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
498
|
+
id: "content-releases.content-manager-edit-view.edit-release",
|
|
499
|
+
defaultMessage: "Edit release"
|
|
500
|
+
}) })
|
|
501
|
+
}
|
|
502
|
+
) });
|
|
503
|
+
};
|
|
504
|
+
const Root = ({ children, hasTriggerBorder = false }) => {
|
|
505
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
387
506
|
return (
|
|
388
507
|
// A user can access the dropdown if they have permissions to delete a release-action OR update a release
|
|
389
508
|
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: [...PERMISSIONS.deleteAction, ...PERMISSIONS.update], children: /* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.Root, { children: [
|
|
390
509
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
391
510
|
v2.Menu.Trigger,
|
|
392
511
|
{
|
|
393
|
-
as: designSystem.IconButton,
|
|
512
|
+
as: hasTriggerBorder ? StyledIconButton : designSystem.IconButton,
|
|
394
513
|
paddingLeft: 2,
|
|
395
514
|
paddingRight: 2,
|
|
396
515
|
"aria-label": formatMessage({
|
|
@@ -400,16 +519,16 @@ const ReleaseActionMenu = ({ releaseId, actionId }) => {
|
|
|
400
519
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
401
520
|
}
|
|
402
521
|
),
|
|
403
|
-
/* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { top: 1, popoverPlacement: "bottom-end", children
|
|
404
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledCross, {}),
|
|
405
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
406
|
-
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
407
|
-
defaultMessage: "Remove from release"
|
|
408
|
-
}) })
|
|
409
|
-
] }) }) }) })
|
|
522
|
+
/* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { top: 1, popoverPlacement: "bottom-end", children })
|
|
410
523
|
] }) })
|
|
411
524
|
);
|
|
412
525
|
};
|
|
526
|
+
const ReleaseActionMenu = {
|
|
527
|
+
Root,
|
|
528
|
+
EditReleaseItem,
|
|
529
|
+
DeleteReleaseActionItem,
|
|
530
|
+
ReleaseActionEntryLinkItem
|
|
531
|
+
};
|
|
413
532
|
const getBorderLeftRadiusValue = (actionType) => {
|
|
414
533
|
return actionType === "publish" ? 1 : 0;
|
|
415
534
|
};
|
|
@@ -430,19 +549,40 @@ const FieldWrapper = styled__default.default(designSystem.Field)`
|
|
|
430
549
|
text-transform: capitalize;
|
|
431
550
|
}
|
|
432
551
|
|
|
433
|
-
&:active,
|
|
434
552
|
&[data-checked='true'] {
|
|
435
|
-
color: ${({ theme }) => theme.colors.primary700};
|
|
436
|
-
background-color: ${({ theme }) => theme.colors.primary100};
|
|
437
|
-
border-color: ${({ theme }) => theme.colors.primary700};
|
|
553
|
+
color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
554
|
+
background-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary100 : theme.colors.danger100};
|
|
555
|
+
border-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
438
556
|
}
|
|
439
557
|
|
|
440
558
|
&[data-checked='false'] {
|
|
441
559
|
border-left: ${({ actionType }) => actionType === "unpublish" && "none"};
|
|
442
560
|
border-right: ${({ actionType }) => actionType === "publish" && "none"};
|
|
443
561
|
}
|
|
562
|
+
|
|
563
|
+
&[data-checked='false'][data-disabled='false']:hover {
|
|
564
|
+
color: ${({ theme }) => theme.colors.neutral700};
|
|
565
|
+
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
566
|
+
border-color: ${({ theme }) => theme.colors.neutral200};
|
|
567
|
+
|
|
568
|
+
& > label {
|
|
569
|
+
cursor: pointer;
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
&[data-disabled='true'] {
|
|
574
|
+
color: ${({ theme }) => theme.colors.neutral600};
|
|
575
|
+
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
576
|
+
border-color: ${({ theme }) => theme.colors.neutral300};
|
|
577
|
+
}
|
|
444
578
|
`;
|
|
445
|
-
const ActionOption = ({
|
|
579
|
+
const ActionOption = ({
|
|
580
|
+
selected,
|
|
581
|
+
actionType,
|
|
582
|
+
handleChange,
|
|
583
|
+
name,
|
|
584
|
+
disabled = false
|
|
585
|
+
}) => {
|
|
446
586
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
447
587
|
FieldWrapper,
|
|
448
588
|
{
|
|
@@ -453,6 +593,7 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
453
593
|
position: "relative",
|
|
454
594
|
cursor: "pointer",
|
|
455
595
|
"data-checked": selected === actionType,
|
|
596
|
+
"data-disabled": disabled && selected !== actionType,
|
|
456
597
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.FieldLabel, { htmlFor: `${name}-${actionType}`, children: [
|
|
457
598
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
458
599
|
designSystem.FieldInput,
|
|
@@ -462,7 +603,8 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
462
603
|
name,
|
|
463
604
|
checked: selected === actionType,
|
|
464
605
|
onChange: handleChange,
|
|
465
|
-
value: actionType
|
|
606
|
+
value: actionType,
|
|
607
|
+
disabled
|
|
466
608
|
}
|
|
467
609
|
) }),
|
|
468
610
|
actionType
|
|
@@ -470,7 +612,12 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
470
612
|
}
|
|
471
613
|
);
|
|
472
614
|
};
|
|
473
|
-
const ReleaseActionOptions = ({
|
|
615
|
+
const ReleaseActionOptions = ({
|
|
616
|
+
selected,
|
|
617
|
+
handleChange,
|
|
618
|
+
name,
|
|
619
|
+
disabled = false
|
|
620
|
+
}) => {
|
|
474
621
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
475
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
476
623
|
ActionOption,
|
|
@@ -478,7 +625,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
478
625
|
actionType: "publish",
|
|
479
626
|
selected,
|
|
480
627
|
handleChange,
|
|
481
|
-
name
|
|
628
|
+
name,
|
|
629
|
+
disabled
|
|
482
630
|
}
|
|
483
631
|
),
|
|
484
632
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -487,7 +635,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
487
635
|
actionType: "unpublish",
|
|
488
636
|
selected,
|
|
489
637
|
handleChange,
|
|
490
|
-
name
|
|
638
|
+
name,
|
|
639
|
+
disabled
|
|
491
640
|
}
|
|
492
641
|
)
|
|
493
642
|
] });
|
|
@@ -531,6 +680,7 @@ const AddActionToReleaseModal = ({
|
|
|
531
680
|
contentTypeUid,
|
|
532
681
|
entryId
|
|
533
682
|
}) => {
|
|
683
|
+
const releaseHeaderId = React__namespace.useId();
|
|
534
684
|
const { formatMessage } = reactIntl.useIntl();
|
|
535
685
|
const toggleNotification = helperPlugin.useNotification();
|
|
536
686
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -578,8 +728,8 @@ const AddActionToReleaseModal = ({
|
|
|
578
728
|
}
|
|
579
729
|
}
|
|
580
730
|
};
|
|
581
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy:
|
|
582
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id:
|
|
731
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy: releaseHeaderId, children: [
|
|
732
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: releaseHeaderId, fontWeight: "bold", textColor: "neutral800", children: formatMessage({
|
|
583
733
|
id: "content-releases.content-manager-edit-view.add-to-release",
|
|
584
734
|
defaultMessage: "Add to release"
|
|
585
735
|
}) }) }),
|
|
@@ -649,16 +799,18 @@ const AddActionToReleaseModal = ({
|
|
|
649
799
|
};
|
|
650
800
|
const CMReleasesContainer = () => {
|
|
651
801
|
const [isModalOpen, setIsModalOpen] = React__namespace.useState(false);
|
|
652
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
802
|
+
const { formatMessage, formatDate, formatTime } = reactIntl.useIntl();
|
|
653
803
|
const {
|
|
654
804
|
isCreatingEntry,
|
|
655
|
-
|
|
805
|
+
hasDraftAndPublish,
|
|
806
|
+
initialData: { id: entryId },
|
|
807
|
+
slug
|
|
656
808
|
} = helperPlugin.useCMEditViewDataManager();
|
|
657
|
-
const
|
|
658
|
-
const canFetch =
|
|
809
|
+
const contentTypeUid = slug;
|
|
810
|
+
const canFetch = entryId != null && contentTypeUid != null;
|
|
659
811
|
const fetchParams = canFetch ? {
|
|
660
|
-
contentTypeUid
|
|
661
|
-
entryId
|
|
812
|
+
contentTypeUid,
|
|
813
|
+
entryId,
|
|
662
814
|
hasEntryAttached: true
|
|
663
815
|
} : query.skipToken;
|
|
664
816
|
const response = useGetReleasesForEntryQuery(fetchParams);
|
|
@@ -666,7 +818,7 @@ const CMReleasesContainer = () => {
|
|
|
666
818
|
if (!canFetch) {
|
|
667
819
|
return null;
|
|
668
820
|
}
|
|
669
|
-
if (isCreatingEntry || !
|
|
821
|
+
if (isCreatingEntry || !hasDraftAndPublish) {
|
|
670
822
|
return null;
|
|
671
823
|
}
|
|
672
824
|
const toggleModal = () => setIsModalOpen((prev) => !prev);
|
|
@@ -733,9 +885,40 @@ const CMReleasesContainer = () => {
|
|
|
733
885
|
)
|
|
734
886
|
}
|
|
735
887
|
),
|
|
736
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap:
|
|
888
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 2, width: "100%", alignItems: "flex-start", children: [
|
|
737
889
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 2, fontWeight: "bold", variant: "omega", textColor: "neutral700", children: release.name }),
|
|
738
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
890
|
+
release.scheduledAt && release.timezone && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(
|
|
891
|
+
{
|
|
892
|
+
id: "content-releases.content-manager-edit-view.scheduled.date",
|
|
893
|
+
defaultMessage: "{date} at {time} ({offset})"
|
|
894
|
+
},
|
|
895
|
+
{
|
|
896
|
+
date: formatDate(new Date(release.scheduledAt), {
|
|
897
|
+
day: "2-digit",
|
|
898
|
+
month: "2-digit",
|
|
899
|
+
year: "numeric",
|
|
900
|
+
timeZone: release.timezone
|
|
901
|
+
}),
|
|
902
|
+
time: formatTime(new Date(release.scheduledAt), {
|
|
903
|
+
hourCycle: "h23",
|
|
904
|
+
timeZone: release.timezone
|
|
905
|
+
}),
|
|
906
|
+
offset: getTimezoneOffset(
|
|
907
|
+
release.timezone,
|
|
908
|
+
new Date(release.scheduledAt)
|
|
909
|
+
)
|
|
910
|
+
}
|
|
911
|
+
) }),
|
|
912
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(ReleaseActionMenu.Root, { hasTriggerBorder: true, children: [
|
|
913
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReleaseActionMenu.EditReleaseItem, { releaseId: release.id }),
|
|
914
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
915
|
+
ReleaseActionMenu.DeleteReleaseActionItem,
|
|
916
|
+
{
|
|
917
|
+
releaseId: release.id,
|
|
918
|
+
actionId: release.action.id
|
|
919
|
+
}
|
|
920
|
+
)
|
|
921
|
+
] }) })
|
|
739
922
|
] })
|
|
740
923
|
]
|
|
741
924
|
},
|
|
@@ -763,8 +946,8 @@ const CMReleasesContainer = () => {
|
|
|
763
946
|
AddActionToReleaseModal,
|
|
764
947
|
{
|
|
765
948
|
handleClose: toggleModal,
|
|
766
|
-
contentTypeUid
|
|
767
|
-
entryId
|
|
949
|
+
contentTypeUid,
|
|
950
|
+
entryId
|
|
768
951
|
}
|
|
769
952
|
)
|
|
770
953
|
]
|
|
@@ -774,7 +957,7 @@ const CMReleasesContainer = () => {
|
|
|
774
957
|
const admin = {
|
|
775
958
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
776
959
|
register(app) {
|
|
777
|
-
if (window.strapi.features.isEnabled("cms-content-releases")
|
|
960
|
+
if (window.strapi.features.isEnabled("cms-content-releases")) {
|
|
778
961
|
app.addMenuLink({
|
|
779
962
|
to: `/plugins/${pluginId}`,
|
|
780
963
|
icon: icons.PaperPlane,
|
|
@@ -783,7 +966,7 @@ const admin = {
|
|
|
783
966
|
defaultMessage: "Releases"
|
|
784
967
|
},
|
|
785
968
|
async Component() {
|
|
786
|
-
const { App } = await Promise.resolve().then(() => require("./App-
|
|
969
|
+
const { App } = await Promise.resolve().then(() => require("./App-l62gIUTX.js"));
|
|
787
970
|
return App;
|
|
788
971
|
},
|
|
789
972
|
permissions: PERMISSIONS.main
|
|
@@ -796,12 +979,26 @@ const admin = {
|
|
|
796
979
|
name: `${pluginId}-link`,
|
|
797
980
|
Component: CMReleasesContainer
|
|
798
981
|
});
|
|
982
|
+
} else if (!window.strapi.features.isEnabled("cms-content-releases") && window.strapi?.flags?.promoteEE) {
|
|
983
|
+
app.addMenuLink({
|
|
984
|
+
to: `/plugins/purchase-content-releases`,
|
|
985
|
+
icon: icons.PaperPlane,
|
|
986
|
+
intlLabel: {
|
|
987
|
+
id: `${pluginId}.plugin.name`,
|
|
988
|
+
defaultMessage: "Releases"
|
|
989
|
+
},
|
|
990
|
+
async Component() {
|
|
991
|
+
const { PurchaseContentReleases } = await Promise.resolve().then(() => require("./PurchaseContentReleases-YhAPgpG9.js"));
|
|
992
|
+
return PurchaseContentReleases;
|
|
993
|
+
},
|
|
994
|
+
lockIcon: true
|
|
995
|
+
});
|
|
799
996
|
}
|
|
800
997
|
},
|
|
801
998
|
async registerTrads({ locales }) {
|
|
802
999
|
const importedTrads = await Promise.all(
|
|
803
1000
|
locales.map((locale) => {
|
|
804
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
|
1001
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-faJDuv3q.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
805
1002
|
return {
|
|
806
1003
|
data: helperPlugin.prefixPluginTranslations(data, "content-releases"),
|
|
807
1004
|
locale
|
|
@@ -821,14 +1018,17 @@ exports.PERMISSIONS = PERMISSIONS;
|
|
|
821
1018
|
exports.ReleaseActionMenu = ReleaseActionMenu;
|
|
822
1019
|
exports.ReleaseActionOptions = ReleaseActionOptions;
|
|
823
1020
|
exports.admin = admin;
|
|
1021
|
+
exports.getTimezoneOffset = getTimezoneOffset;
|
|
824
1022
|
exports.isAxiosError = isAxiosError;
|
|
825
1023
|
exports.pluginId = pluginId;
|
|
1024
|
+
exports.releaseApi = releaseApi;
|
|
826
1025
|
exports.useCreateReleaseMutation = useCreateReleaseMutation;
|
|
827
1026
|
exports.useDeleteReleaseMutation = useDeleteReleaseMutation;
|
|
828
1027
|
exports.useGetReleaseActionsQuery = useGetReleaseActionsQuery;
|
|
829
1028
|
exports.useGetReleaseQuery = useGetReleaseQuery;
|
|
830
1029
|
exports.useGetReleasesQuery = useGetReleasesQuery;
|
|
831
1030
|
exports.usePublishReleaseMutation = usePublishReleaseMutation;
|
|
1031
|
+
exports.useTypedDispatch = useTypedDispatch;
|
|
832
1032
|
exports.useUpdateReleaseActionMutation = useUpdateReleaseActionMutation;
|
|
833
1033
|
exports.useUpdateReleaseMutation = useUpdateReleaseMutation;
|
|
834
|
-
//# sourceMappingURL=index-
|
|
1034
|
+
//# sourceMappingURL=index-ML_b3php.js.map
|