@strapi/content-releases 0.0.0-experimental.e1ede8c55a0e1e22ce20137bf238fc374bd5dd51 → 0.0.0-experimental.e5740babedd53cf5b6af99d74920b6b9ef1e4c11
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-o5_WfqR-.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-ngTk74JV.mjs → en-RdapH-9X.mjs} +22 -7
- package/dist/_chunks/en-RdapH-9X.mjs.map +1 -0
- package/dist/_chunks/{en-haKSQIo8.js → en-faJDuv3q.js} +22 -7
- package/dist/_chunks/en-faJDuv3q.js.map +1 -0
- package/dist/_chunks/{index-EdBmRHRU.js → index-ML_b3php.js} +242 -57
- package/dist/_chunks/index-ML_b3php.js.map +1 -0
- package/dist/_chunks/{index-XAQOX_IB.mjs → index-Ys87ROOe.mjs} +257 -72
- 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-g2P5kbSm.mjs +0 -945
- package/dist/_chunks/App-g2P5kbSm.mjs.map +0 -1
- package/dist/_chunks/App-o5_WfqR-.js.map +0 -1
- package/dist/_chunks/en-haKSQIo8.js.map +0 -1
- package/dist/_chunks/en-ngTk74JV.mjs.map +0 -1
- package/dist/_chunks/index-EdBmRHRU.js.map +0 -1
- package/dist/_chunks/index-XAQOX_IB.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,37 +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
|
-
`;
|
|
351
|
-
const StyledCross = styled__default.default(icons.Cross)`
|
|
352
|
-
padding: ${({ theme }) => theme.spaces[1]};
|
|
353
401
|
`;
|
|
354
402
|
const StyledIconButton = styled__default.default(designSystem.IconButton)`
|
|
355
403
|
/* Setting this style inline with borderColor will not apply the style */
|
|
356
404
|
border: ${({ theme }) => `1px solid ${theme.colors.neutral200}`};
|
|
357
405
|
`;
|
|
358
|
-
const
|
|
359
|
-
releaseId,
|
|
360
|
-
actionId,
|
|
361
|
-
hasTriggerBorder = false
|
|
362
|
-
}) => {
|
|
406
|
+
const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
|
|
363
407
|
const { formatMessage } = reactIntl.useIntl();
|
|
364
408
|
const toggleNotification = helperPlugin.useNotification();
|
|
365
409
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -392,6 +436,73 @@ const ReleaseActionMenu = ({
|
|
|
392
436
|
}
|
|
393
437
|
}
|
|
394
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();
|
|
395
506
|
return (
|
|
396
507
|
// A user can access the dropdown if they have permissions to delete a release-action OR update a release
|
|
397
508
|
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: [...PERMISSIONS.deleteAction, ...PERMISSIONS.update], children: /* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.Root, { children: [
|
|
@@ -408,16 +519,16 @@ const ReleaseActionMenu = ({
|
|
|
408
519
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
409
520
|
}
|
|
410
521
|
),
|
|
411
|
-
/* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { top: 1, popoverPlacement: "bottom-end", children
|
|
412
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledCross, {}),
|
|
413
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
|
|
414
|
-
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
415
|
-
defaultMessage: "Remove from release"
|
|
416
|
-
}) })
|
|
417
|
-
] }) }) }) })
|
|
522
|
+
/* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { top: 1, popoverPlacement: "bottom-end", children })
|
|
418
523
|
] }) })
|
|
419
524
|
);
|
|
420
525
|
};
|
|
526
|
+
const ReleaseActionMenu = {
|
|
527
|
+
Root,
|
|
528
|
+
EditReleaseItem,
|
|
529
|
+
DeleteReleaseActionItem,
|
|
530
|
+
ReleaseActionEntryLinkItem
|
|
531
|
+
};
|
|
421
532
|
const getBorderLeftRadiusValue = (actionType) => {
|
|
422
533
|
return actionType === "publish" ? 1 : 0;
|
|
423
534
|
};
|
|
@@ -438,19 +549,40 @@ const FieldWrapper = styled__default.default(designSystem.Field)`
|
|
|
438
549
|
text-transform: capitalize;
|
|
439
550
|
}
|
|
440
551
|
|
|
441
|
-
&:active,
|
|
442
552
|
&[data-checked='true'] {
|
|
443
|
-
color: ${({ theme }) => theme.colors.primary700};
|
|
444
|
-
background-color: ${({ theme }) => theme.colors.primary100};
|
|
445
|
-
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};
|
|
446
556
|
}
|
|
447
557
|
|
|
448
558
|
&[data-checked='false'] {
|
|
449
559
|
border-left: ${({ actionType }) => actionType === "unpublish" && "none"};
|
|
450
560
|
border-right: ${({ actionType }) => actionType === "publish" && "none"};
|
|
451
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
|
+
}
|
|
452
578
|
`;
|
|
453
|
-
const ActionOption = ({
|
|
579
|
+
const ActionOption = ({
|
|
580
|
+
selected,
|
|
581
|
+
actionType,
|
|
582
|
+
handleChange,
|
|
583
|
+
name,
|
|
584
|
+
disabled = false
|
|
585
|
+
}) => {
|
|
454
586
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
455
587
|
FieldWrapper,
|
|
456
588
|
{
|
|
@@ -461,6 +593,7 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
461
593
|
position: "relative",
|
|
462
594
|
cursor: "pointer",
|
|
463
595
|
"data-checked": selected === actionType,
|
|
596
|
+
"data-disabled": disabled && selected !== actionType,
|
|
464
597
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.FieldLabel, { htmlFor: `${name}-${actionType}`, children: [
|
|
465
598
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
466
599
|
designSystem.FieldInput,
|
|
@@ -470,7 +603,8 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
470
603
|
name,
|
|
471
604
|
checked: selected === actionType,
|
|
472
605
|
onChange: handleChange,
|
|
473
|
-
value: actionType
|
|
606
|
+
value: actionType,
|
|
607
|
+
disabled
|
|
474
608
|
}
|
|
475
609
|
) }),
|
|
476
610
|
actionType
|
|
@@ -478,7 +612,12 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
478
612
|
}
|
|
479
613
|
);
|
|
480
614
|
};
|
|
481
|
-
const ReleaseActionOptions = ({
|
|
615
|
+
const ReleaseActionOptions = ({
|
|
616
|
+
selected,
|
|
617
|
+
handleChange,
|
|
618
|
+
name,
|
|
619
|
+
disabled = false
|
|
620
|
+
}) => {
|
|
482
621
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
|
483
622
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
484
623
|
ActionOption,
|
|
@@ -486,7 +625,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
486
625
|
actionType: "publish",
|
|
487
626
|
selected,
|
|
488
627
|
handleChange,
|
|
489
|
-
name
|
|
628
|
+
name,
|
|
629
|
+
disabled
|
|
490
630
|
}
|
|
491
631
|
),
|
|
492
632
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -495,7 +635,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
495
635
|
actionType: "unpublish",
|
|
496
636
|
selected,
|
|
497
637
|
handleChange,
|
|
498
|
-
name
|
|
638
|
+
name,
|
|
639
|
+
disabled
|
|
499
640
|
}
|
|
500
641
|
)
|
|
501
642
|
] });
|
|
@@ -539,6 +680,7 @@ const AddActionToReleaseModal = ({
|
|
|
539
680
|
contentTypeUid,
|
|
540
681
|
entryId
|
|
541
682
|
}) => {
|
|
683
|
+
const releaseHeaderId = React__namespace.useId();
|
|
542
684
|
const { formatMessage } = reactIntl.useIntl();
|
|
543
685
|
const toggleNotification = helperPlugin.useNotification();
|
|
544
686
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -586,8 +728,8 @@ const AddActionToReleaseModal = ({
|
|
|
586
728
|
}
|
|
587
729
|
}
|
|
588
730
|
};
|
|
589
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy:
|
|
590
|
-
/* @__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({
|
|
591
733
|
id: "content-releases.content-manager-edit-view.add-to-release",
|
|
592
734
|
defaultMessage: "Add to release"
|
|
593
735
|
}) }) }),
|
|
@@ -657,16 +799,18 @@ const AddActionToReleaseModal = ({
|
|
|
657
799
|
};
|
|
658
800
|
const CMReleasesContainer = () => {
|
|
659
801
|
const [isModalOpen, setIsModalOpen] = React__namespace.useState(false);
|
|
660
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
802
|
+
const { formatMessage, formatDate, formatTime } = reactIntl.useIntl();
|
|
661
803
|
const {
|
|
662
804
|
isCreatingEntry,
|
|
663
|
-
|
|
805
|
+
hasDraftAndPublish,
|
|
806
|
+
initialData: { id: entryId },
|
|
807
|
+
slug
|
|
664
808
|
} = helperPlugin.useCMEditViewDataManager();
|
|
665
|
-
const
|
|
666
|
-
const canFetch =
|
|
809
|
+
const contentTypeUid = slug;
|
|
810
|
+
const canFetch = entryId != null && contentTypeUid != null;
|
|
667
811
|
const fetchParams = canFetch ? {
|
|
668
|
-
contentTypeUid
|
|
669
|
-
entryId
|
|
812
|
+
contentTypeUid,
|
|
813
|
+
entryId,
|
|
670
814
|
hasEntryAttached: true
|
|
671
815
|
} : query.skipToken;
|
|
672
816
|
const response = useGetReleasesForEntryQuery(fetchParams);
|
|
@@ -674,7 +818,7 @@ const CMReleasesContainer = () => {
|
|
|
674
818
|
if (!canFetch) {
|
|
675
819
|
return null;
|
|
676
820
|
}
|
|
677
|
-
if (isCreatingEntry || !
|
|
821
|
+
if (isCreatingEntry || !hasDraftAndPublish) {
|
|
678
822
|
return null;
|
|
679
823
|
}
|
|
680
824
|
const toggleModal = () => setIsModalOpen((prev) => !prev);
|
|
@@ -741,16 +885,40 @@ const CMReleasesContainer = () => {
|
|
|
741
885
|
)
|
|
742
886
|
}
|
|
743
887
|
),
|
|
744
|
-
/* @__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: [
|
|
745
889
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 2, fontWeight: "bold", variant: "omega", textColor: "neutral700", children: release.name }),
|
|
746
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
747
|
-
|
|
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
|
+
},
|
|
748
895
|
{
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
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
|
+
)
|
|
752
910
|
}
|
|
753
|
-
)
|
|
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
|
+
] }) })
|
|
754
922
|
] })
|
|
755
923
|
]
|
|
756
924
|
},
|
|
@@ -778,8 +946,8 @@ const CMReleasesContainer = () => {
|
|
|
778
946
|
AddActionToReleaseModal,
|
|
779
947
|
{
|
|
780
948
|
handleClose: toggleModal,
|
|
781
|
-
contentTypeUid
|
|
782
|
-
entryId
|
|
949
|
+
contentTypeUid,
|
|
950
|
+
entryId
|
|
783
951
|
}
|
|
784
952
|
)
|
|
785
953
|
]
|
|
@@ -789,7 +957,7 @@ const CMReleasesContainer = () => {
|
|
|
789
957
|
const admin = {
|
|
790
958
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
791
959
|
register(app) {
|
|
792
|
-
if (window.strapi.features.isEnabled("cms-content-releases")
|
|
960
|
+
if (window.strapi.features.isEnabled("cms-content-releases")) {
|
|
793
961
|
app.addMenuLink({
|
|
794
962
|
to: `/plugins/${pluginId}`,
|
|
795
963
|
icon: icons.PaperPlane,
|
|
@@ -798,7 +966,7 @@ const admin = {
|
|
|
798
966
|
defaultMessage: "Releases"
|
|
799
967
|
},
|
|
800
968
|
async Component() {
|
|
801
|
-
const { App } = await Promise.resolve().then(() => require("./App-
|
|
969
|
+
const { App } = await Promise.resolve().then(() => require("./App-l62gIUTX.js"));
|
|
802
970
|
return App;
|
|
803
971
|
},
|
|
804
972
|
permissions: PERMISSIONS.main
|
|
@@ -811,12 +979,26 @@ const admin = {
|
|
|
811
979
|
name: `${pluginId}-link`,
|
|
812
980
|
Component: CMReleasesContainer
|
|
813
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
|
+
});
|
|
814
996
|
}
|
|
815
997
|
},
|
|
816
998
|
async registerTrads({ locales }) {
|
|
817
999
|
const importedTrads = await Promise.all(
|
|
818
1000
|
locales.map((locale) => {
|
|
819
|
-
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 }) => {
|
|
820
1002
|
return {
|
|
821
1003
|
data: helperPlugin.prefixPluginTranslations(data, "content-releases"),
|
|
822
1004
|
locale
|
|
@@ -836,14 +1018,17 @@ exports.PERMISSIONS = PERMISSIONS;
|
|
|
836
1018
|
exports.ReleaseActionMenu = ReleaseActionMenu;
|
|
837
1019
|
exports.ReleaseActionOptions = ReleaseActionOptions;
|
|
838
1020
|
exports.admin = admin;
|
|
1021
|
+
exports.getTimezoneOffset = getTimezoneOffset;
|
|
839
1022
|
exports.isAxiosError = isAxiosError;
|
|
840
1023
|
exports.pluginId = pluginId;
|
|
1024
|
+
exports.releaseApi = releaseApi;
|
|
841
1025
|
exports.useCreateReleaseMutation = useCreateReleaseMutation;
|
|
842
1026
|
exports.useDeleteReleaseMutation = useDeleteReleaseMutation;
|
|
843
1027
|
exports.useGetReleaseActionsQuery = useGetReleaseActionsQuery;
|
|
844
1028
|
exports.useGetReleaseQuery = useGetReleaseQuery;
|
|
845
1029
|
exports.useGetReleasesQuery = useGetReleasesQuery;
|
|
846
1030
|
exports.usePublishReleaseMutation = usePublishReleaseMutation;
|
|
1031
|
+
exports.useTypedDispatch = useTypedDispatch;
|
|
847
1032
|
exports.useUpdateReleaseActionMutation = useUpdateReleaseActionMutation;
|
|
848
1033
|
exports.useUpdateReleaseMutation = useUpdateReleaseMutation;
|
|
849
|
-
//# sourceMappingURL=index-
|
|
1034
|
+
//# sourceMappingURL=index-ML_b3php.js.map
|