@strapi/content-releases 0.0.0-next.e1ede8c55a0e1e22ce20137bf238fc374bd5dd51 → 0.0.0-next.e6eaa3d0563c85f80fd88b258df70a55c057096e
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-R-kksTW7.mjs +1308 -0
- package/dist/_chunks/App-R-kksTW7.mjs.map +1 -0
- package/dist/_chunks/{App-o5_WfqR-.js → App-WZHc_d3m.js} +783 -419
- package/dist/_chunks/App-WZHc_d3m.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-k6fw6RYi.js} +240 -56
- package/dist/_chunks/index-k6fw6RYi.js.map +1 -0
- package/dist/_chunks/{index-XAQOX_IB.mjs → index-vpSczx8v.mjs} +255 -71
- package/dist/_chunks/index-vpSczx8v.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
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import { getFetchClient, useNotification, useAPIErrorHandler, CheckPermissions, useCMEditViewDataManager, NoContent, prefixPluginTranslations } from "@strapi/helper-plugin";
|
|
2
|
-
import { Cross, More, Plus, PaperPlane } from "@strapi/icons";
|
|
2
|
+
import { Cross, Pencil, More, Plus, PaperPlane } from "@strapi/icons";
|
|
3
3
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { skipToken } from "@reduxjs/toolkit/query";
|
|
6
|
-
import { IconButton, Flex, Typography, Field, FieldLabel, VisuallyHidden, FieldInput, Box, Button, ModalLayout, ModalHeader, ModalBody, SingleSelect, SingleSelectOption, ModalFooter } from "@strapi/design-system";
|
|
7
|
-
import { Menu, LinkButton } from "@strapi/design-system/v2";
|
|
6
|
+
import { IconButton, Flex, Icon, Typography, Field, FieldLabel, VisuallyHidden, FieldInput, Box, Button, ModalLayout, ModalHeader, ModalBody, SingleSelect, SingleSelectOption, ModalFooter } from "@strapi/design-system";
|
|
7
|
+
import { Menu, Link, LinkButton } from "@strapi/design-system/v2";
|
|
8
8
|
import { isAxiosError as isAxiosError$1 } from "axios";
|
|
9
9
|
import { Formik, Form } from "formik";
|
|
10
10
|
import { useIntl } from "react-intl";
|
|
11
|
-
import {
|
|
11
|
+
import { NavLink, Link as Link$1 } from "react-router-dom";
|
|
12
12
|
import * as yup from "yup";
|
|
13
13
|
import { createApi } from "@reduxjs/toolkit/query/react";
|
|
14
14
|
import styled from "styled-components";
|
|
15
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
15
16
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
16
17
|
const v = glob[path];
|
|
17
18
|
if (v) {
|
|
@@ -258,7 +259,27 @@ const releaseApi = createApi({
|
|
|
258
259
|
data: body
|
|
259
260
|
};
|
|
260
261
|
},
|
|
261
|
-
invalidatesTags: () => [{ type: "ReleaseAction", id: "LIST" }]
|
|
262
|
+
invalidatesTags: () => [{ type: "ReleaseAction", id: "LIST" }],
|
|
263
|
+
async onQueryStarted({ body, params, query, actionPath }, { dispatch, queryFulfilled }) {
|
|
264
|
+
const paramsWithoutActionId = {
|
|
265
|
+
releaseId: params.releaseId,
|
|
266
|
+
...query
|
|
267
|
+
};
|
|
268
|
+
const patchResult = dispatch(
|
|
269
|
+
releaseApi.util.updateQueryData("getReleaseActions", paramsWithoutActionId, (draft) => {
|
|
270
|
+
const [key, index] = actionPath;
|
|
271
|
+
const action = draft.data[key][index];
|
|
272
|
+
if (action) {
|
|
273
|
+
action.type = body.type;
|
|
274
|
+
}
|
|
275
|
+
})
|
|
276
|
+
);
|
|
277
|
+
try {
|
|
278
|
+
await queryFulfilled;
|
|
279
|
+
} catch {
|
|
280
|
+
patchResult.undo();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
262
283
|
}),
|
|
263
284
|
deleteReleaseAction: build.mutation({
|
|
264
285
|
query({ params }) {
|
|
@@ -288,7 +309,7 @@ const releaseApi = createApi({
|
|
|
288
309
|
method: "DELETE"
|
|
289
310
|
};
|
|
290
311
|
},
|
|
291
|
-
invalidatesTags: (
|
|
312
|
+
invalidatesTags: () => [{ type: "Release", id: "LIST" }]
|
|
292
313
|
})
|
|
293
314
|
};
|
|
294
315
|
}
|
|
@@ -306,37 +327,59 @@ const {
|
|
|
306
327
|
useDeleteReleaseActionMutation,
|
|
307
328
|
useDeleteReleaseMutation
|
|
308
329
|
} = releaseApi;
|
|
330
|
+
const getTimezoneOffset = (timezone, date) => {
|
|
331
|
+
try {
|
|
332
|
+
const offsetPart = new Intl.DateTimeFormat("en", {
|
|
333
|
+
timeZone: timezone,
|
|
334
|
+
timeZoneName: "longOffset"
|
|
335
|
+
}).formatToParts(date).find((part) => part.type === "timeZoneName");
|
|
336
|
+
const offset = offsetPart ? offsetPart.value : "";
|
|
337
|
+
let utcOffset = offset.replace("GMT", "UTC");
|
|
338
|
+
if (!utcOffset.includes("+") && !utcOffset.includes("-")) {
|
|
339
|
+
utcOffset = `${utcOffset}+00:00`;
|
|
340
|
+
}
|
|
341
|
+
return utcOffset;
|
|
342
|
+
} catch (error) {
|
|
343
|
+
return "";
|
|
344
|
+
}
|
|
345
|
+
};
|
|
346
|
+
const useTypedDispatch = useDispatch;
|
|
347
|
+
const useTypedSelector = useSelector;
|
|
309
348
|
const StyledMenuItem = styled(Menu.Item)`
|
|
310
349
|
&:hover {
|
|
311
|
-
background: ${({ theme }) => theme.colors
|
|
350
|
+
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
351
|
+
|
|
352
|
+
svg {
|
|
353
|
+
path {
|
|
354
|
+
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
a {
|
|
359
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
360
|
+
}
|
|
312
361
|
}
|
|
313
362
|
|
|
314
363
|
svg {
|
|
315
364
|
path {
|
|
316
|
-
fill: ${({ theme }) => theme.colors
|
|
365
|
+
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
317
366
|
}
|
|
318
367
|
}
|
|
319
368
|
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
369
|
+
a {
|
|
370
|
+
color: ${({ theme }) => theme.colors.neutral800};
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
span,
|
|
374
|
+
a {
|
|
375
|
+
width: 100%;
|
|
326
376
|
}
|
|
327
|
-
`;
|
|
328
|
-
const StyledCross = styled(Cross)`
|
|
329
|
-
padding: ${({ theme }) => theme.spaces[1]};
|
|
330
377
|
`;
|
|
331
378
|
const StyledIconButton = styled(IconButton)`
|
|
332
379
|
/* Setting this style inline with borderColor will not apply the style */
|
|
333
380
|
border: ${({ theme }) => `1px solid ${theme.colors.neutral200}`};
|
|
334
381
|
`;
|
|
335
|
-
const
|
|
336
|
-
releaseId,
|
|
337
|
-
actionId,
|
|
338
|
-
hasTriggerBorder = false
|
|
339
|
-
}) => {
|
|
382
|
+
const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
|
|
340
383
|
const { formatMessage } = useIntl();
|
|
341
384
|
const toggleNotification = useNotification();
|
|
342
385
|
const { formatAPIError } = useAPIErrorHandler();
|
|
@@ -369,6 +412,73 @@ const ReleaseActionMenu = ({
|
|
|
369
412
|
}
|
|
370
413
|
}
|
|
371
414
|
};
|
|
415
|
+
return /* @__PURE__ */ jsx(CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsx(StyledMenuItem, { variant: "danger", onSelect: handleDeleteAction, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
416
|
+
/* @__PURE__ */ jsx(Icon, { as: Cross, width: 3, height: 3 }),
|
|
417
|
+
/* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
|
|
418
|
+
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
419
|
+
defaultMessage: "Remove from release"
|
|
420
|
+
}) })
|
|
421
|
+
] }) }) });
|
|
422
|
+
};
|
|
423
|
+
const ReleaseActionEntryLinkItem = ({
|
|
424
|
+
contentTypeUid,
|
|
425
|
+
entryId,
|
|
426
|
+
locale
|
|
427
|
+
}) => {
|
|
428
|
+
const { formatMessage } = useIntl();
|
|
429
|
+
const collectionTypePermissions = useTypedSelector(
|
|
430
|
+
(state) => state.rbacProvider.collectionTypesRelatedPermissions
|
|
431
|
+
);
|
|
432
|
+
const updatePermissions = contentTypeUid ? collectionTypePermissions[contentTypeUid]?.["plugin::content-manager.explorer.update"] : [];
|
|
433
|
+
const canUpdateEntryForLocale = Boolean(
|
|
434
|
+
!locale || updatePermissions?.find(
|
|
435
|
+
(permission) => permission.properties?.locales?.includes(locale)
|
|
436
|
+
)
|
|
437
|
+
);
|
|
438
|
+
return /* @__PURE__ */ jsx(
|
|
439
|
+
CheckPermissions,
|
|
440
|
+
{
|
|
441
|
+
permissions: [
|
|
442
|
+
{
|
|
443
|
+
action: "plugin::content-manager.explorer.update",
|
|
444
|
+
subject: contentTypeUid
|
|
445
|
+
}
|
|
446
|
+
],
|
|
447
|
+
children: canUpdateEntryForLocale && /* @__PURE__ */ jsx(StyledMenuItem, { children: /* @__PURE__ */ jsx(
|
|
448
|
+
Link,
|
|
449
|
+
{
|
|
450
|
+
as: NavLink,
|
|
451
|
+
to: {
|
|
452
|
+
pathname: `/content-manager/collection-types/${contentTypeUid}/${entryId}`,
|
|
453
|
+
search: locale && `?plugins[i18n][locale]=${locale}`
|
|
454
|
+
},
|
|
455
|
+
startIcon: /* @__PURE__ */ jsx(Icon, { as: Pencil, width: 3, height: 3 }),
|
|
456
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children: formatMessage({
|
|
457
|
+
id: "content-releases.content-manager-edit-view.edit-entry",
|
|
458
|
+
defaultMessage: "Edit entry"
|
|
459
|
+
}) })
|
|
460
|
+
}
|
|
461
|
+
) })
|
|
462
|
+
}
|
|
463
|
+
);
|
|
464
|
+
};
|
|
465
|
+
const EditReleaseItem = ({ releaseId }) => {
|
|
466
|
+
const { formatMessage } = useIntl();
|
|
467
|
+
return /* @__PURE__ */ jsx(StyledMenuItem, { children: /* @__PURE__ */ jsx(
|
|
468
|
+
Link,
|
|
469
|
+
{
|
|
470
|
+
as: NavLink,
|
|
471
|
+
to: `/plugins/content-releases/${releaseId}`,
|
|
472
|
+
startIcon: /* @__PURE__ */ jsx(Icon, { as: Pencil, width: 3, height: 3 }),
|
|
473
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", children: formatMessage({
|
|
474
|
+
id: "content-releases.content-manager-edit-view.edit-release",
|
|
475
|
+
defaultMessage: "Edit release"
|
|
476
|
+
}) })
|
|
477
|
+
}
|
|
478
|
+
) });
|
|
479
|
+
};
|
|
480
|
+
const Root = ({ children, hasTriggerBorder = false }) => {
|
|
481
|
+
const { formatMessage } = useIntl();
|
|
372
482
|
return (
|
|
373
483
|
// A user can access the dropdown if they have permissions to delete a release-action OR update a release
|
|
374
484
|
/* @__PURE__ */ jsx(CheckPermissions, { permissions: [...PERMISSIONS.deleteAction, ...PERMISSIONS.update], children: /* @__PURE__ */ jsxs(Menu.Root, { children: [
|
|
@@ -385,16 +495,16 @@ const ReleaseActionMenu = ({
|
|
|
385
495
|
icon: /* @__PURE__ */ jsx(More, {})
|
|
386
496
|
}
|
|
387
497
|
),
|
|
388
|
-
/* @__PURE__ */ jsx(Menu.Content, { top: 1, popoverPlacement: "bottom-end", children
|
|
389
|
-
/* @__PURE__ */ jsx(StyledCross, {}),
|
|
390
|
-
/* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
|
|
391
|
-
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
392
|
-
defaultMessage: "Remove from release"
|
|
393
|
-
}) })
|
|
394
|
-
] }) }) }) })
|
|
498
|
+
/* @__PURE__ */ jsx(Menu.Content, { top: 1, popoverPlacement: "bottom-end", children })
|
|
395
499
|
] }) })
|
|
396
500
|
);
|
|
397
501
|
};
|
|
502
|
+
const ReleaseActionMenu = {
|
|
503
|
+
Root,
|
|
504
|
+
EditReleaseItem,
|
|
505
|
+
DeleteReleaseActionItem,
|
|
506
|
+
ReleaseActionEntryLinkItem
|
|
507
|
+
};
|
|
398
508
|
const getBorderLeftRadiusValue = (actionType) => {
|
|
399
509
|
return actionType === "publish" ? 1 : 0;
|
|
400
510
|
};
|
|
@@ -415,19 +525,40 @@ const FieldWrapper = styled(Field)`
|
|
|
415
525
|
text-transform: capitalize;
|
|
416
526
|
}
|
|
417
527
|
|
|
418
|
-
&:active,
|
|
419
528
|
&[data-checked='true'] {
|
|
420
|
-
color: ${({ theme }) => theme.colors.primary700};
|
|
421
|
-
background-color: ${({ theme }) => theme.colors.primary100};
|
|
422
|
-
border-color: ${({ theme }) => theme.colors.primary700};
|
|
529
|
+
color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
530
|
+
background-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary100 : theme.colors.danger100};
|
|
531
|
+
border-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
423
532
|
}
|
|
424
533
|
|
|
425
534
|
&[data-checked='false'] {
|
|
426
535
|
border-left: ${({ actionType }) => actionType === "unpublish" && "none"};
|
|
427
536
|
border-right: ${({ actionType }) => actionType === "publish" && "none"};
|
|
428
537
|
}
|
|
538
|
+
|
|
539
|
+
&[data-checked='false'][data-disabled='false']:hover {
|
|
540
|
+
color: ${({ theme }) => theme.colors.neutral700};
|
|
541
|
+
background-color: ${({ theme }) => theme.colors.neutral100};
|
|
542
|
+
border-color: ${({ theme }) => theme.colors.neutral200};
|
|
543
|
+
|
|
544
|
+
& > label {
|
|
545
|
+
cursor: pointer;
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
&[data-disabled='true'] {
|
|
550
|
+
color: ${({ theme }) => theme.colors.neutral600};
|
|
551
|
+
background-color: ${({ theme }) => theme.colors.neutral150};
|
|
552
|
+
border-color: ${({ theme }) => theme.colors.neutral300};
|
|
553
|
+
}
|
|
429
554
|
`;
|
|
430
|
-
const ActionOption = ({
|
|
555
|
+
const ActionOption = ({
|
|
556
|
+
selected,
|
|
557
|
+
actionType,
|
|
558
|
+
handleChange,
|
|
559
|
+
name,
|
|
560
|
+
disabled = false
|
|
561
|
+
}) => {
|
|
431
562
|
return /* @__PURE__ */ jsx(
|
|
432
563
|
FieldWrapper,
|
|
433
564
|
{
|
|
@@ -438,6 +569,7 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
438
569
|
position: "relative",
|
|
439
570
|
cursor: "pointer",
|
|
440
571
|
"data-checked": selected === actionType,
|
|
572
|
+
"data-disabled": disabled && selected !== actionType,
|
|
441
573
|
children: /* @__PURE__ */ jsxs(FieldLabel, { htmlFor: `${name}-${actionType}`, children: [
|
|
442
574
|
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx(
|
|
443
575
|
FieldInput,
|
|
@@ -447,7 +579,8 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
447
579
|
name,
|
|
448
580
|
checked: selected === actionType,
|
|
449
581
|
onChange: handleChange,
|
|
450
|
-
value: actionType
|
|
582
|
+
value: actionType,
|
|
583
|
+
disabled
|
|
451
584
|
}
|
|
452
585
|
) }),
|
|
453
586
|
actionType
|
|
@@ -455,7 +588,12 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
|
|
|
455
588
|
}
|
|
456
589
|
);
|
|
457
590
|
};
|
|
458
|
-
const ReleaseActionOptions = ({
|
|
591
|
+
const ReleaseActionOptions = ({
|
|
592
|
+
selected,
|
|
593
|
+
handleChange,
|
|
594
|
+
name,
|
|
595
|
+
disabled = false
|
|
596
|
+
}) => {
|
|
459
597
|
return /* @__PURE__ */ jsxs(Flex, { children: [
|
|
460
598
|
/* @__PURE__ */ jsx(
|
|
461
599
|
ActionOption,
|
|
@@ -463,7 +601,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
463
601
|
actionType: "publish",
|
|
464
602
|
selected,
|
|
465
603
|
handleChange,
|
|
466
|
-
name
|
|
604
|
+
name,
|
|
605
|
+
disabled
|
|
467
606
|
}
|
|
468
607
|
),
|
|
469
608
|
/* @__PURE__ */ jsx(
|
|
@@ -472,7 +611,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
|
|
|
472
611
|
actionType: "unpublish",
|
|
473
612
|
selected,
|
|
474
613
|
handleChange,
|
|
475
|
-
name
|
|
614
|
+
name,
|
|
615
|
+
disabled
|
|
476
616
|
}
|
|
477
617
|
)
|
|
478
618
|
] });
|
|
@@ -500,7 +640,7 @@ const NoReleases = () => {
|
|
|
500
640
|
to: {
|
|
501
641
|
pathname: "/plugins/content-releases"
|
|
502
642
|
},
|
|
503
|
-
as: Link,
|
|
643
|
+
as: Link$1,
|
|
504
644
|
variant: "secondary",
|
|
505
645
|
children: formatMessage({
|
|
506
646
|
id: "content-releases.content-manager-edit-view.add-to-release.redirect-button",
|
|
@@ -516,6 +656,7 @@ const AddActionToReleaseModal = ({
|
|
|
516
656
|
contentTypeUid,
|
|
517
657
|
entryId
|
|
518
658
|
}) => {
|
|
659
|
+
const releaseHeaderId = React.useId();
|
|
519
660
|
const { formatMessage } = useIntl();
|
|
520
661
|
const toggleNotification = useNotification();
|
|
521
662
|
const { formatAPIError } = useAPIErrorHandler();
|
|
@@ -563,8 +704,8 @@ const AddActionToReleaseModal = ({
|
|
|
563
704
|
}
|
|
564
705
|
}
|
|
565
706
|
};
|
|
566
|
-
return /* @__PURE__ */ jsxs(ModalLayout, { onClose: handleClose, labelledBy:
|
|
567
|
-
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { id:
|
|
707
|
+
return /* @__PURE__ */ jsxs(ModalLayout, { onClose: handleClose, labelledBy: releaseHeaderId, children: [
|
|
708
|
+
/* @__PURE__ */ jsx(ModalHeader, { children: /* @__PURE__ */ jsx(Typography, { id: releaseHeaderId, fontWeight: "bold", textColor: "neutral800", children: formatMessage({
|
|
568
709
|
id: "content-releases.content-manager-edit-view.add-to-release",
|
|
569
710
|
defaultMessage: "Add to release"
|
|
570
711
|
}) }) }),
|
|
@@ -634,16 +775,18 @@ const AddActionToReleaseModal = ({
|
|
|
634
775
|
};
|
|
635
776
|
const CMReleasesContainer = () => {
|
|
636
777
|
const [isModalOpen, setIsModalOpen] = React.useState(false);
|
|
637
|
-
const { formatMessage } = useIntl();
|
|
778
|
+
const { formatMessage, formatDate, formatTime } = useIntl();
|
|
638
779
|
const {
|
|
639
780
|
isCreatingEntry,
|
|
640
|
-
|
|
781
|
+
hasDraftAndPublish,
|
|
782
|
+
initialData: { id: entryId },
|
|
783
|
+
slug
|
|
641
784
|
} = useCMEditViewDataManager();
|
|
642
|
-
const
|
|
643
|
-
const canFetch =
|
|
785
|
+
const contentTypeUid = slug;
|
|
786
|
+
const canFetch = entryId != null && contentTypeUid != null;
|
|
644
787
|
const fetchParams = canFetch ? {
|
|
645
|
-
contentTypeUid
|
|
646
|
-
entryId
|
|
788
|
+
contentTypeUid,
|
|
789
|
+
entryId,
|
|
647
790
|
hasEntryAttached: true
|
|
648
791
|
} : skipToken;
|
|
649
792
|
const response = useGetReleasesForEntryQuery(fetchParams);
|
|
@@ -651,7 +794,7 @@ const CMReleasesContainer = () => {
|
|
|
651
794
|
if (!canFetch) {
|
|
652
795
|
return null;
|
|
653
796
|
}
|
|
654
|
-
if (isCreatingEntry || !
|
|
797
|
+
if (isCreatingEntry || !hasDraftAndPublish) {
|
|
655
798
|
return null;
|
|
656
799
|
}
|
|
657
800
|
const toggleModal = () => setIsModalOpen((prev) => !prev);
|
|
@@ -718,16 +861,40 @@ const CMReleasesContainer = () => {
|
|
|
718
861
|
)
|
|
719
862
|
}
|
|
720
863
|
),
|
|
721
|
-
/* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap:
|
|
864
|
+
/* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 2, width: "100%", alignItems: "flex-start", children: [
|
|
722
865
|
/* @__PURE__ */ jsx(Typography, { fontSize: 2, fontWeight: "bold", variant: "omega", textColor: "neutral700", children: release.name }),
|
|
723
|
-
/* @__PURE__ */ jsx(
|
|
724
|
-
ReleaseActionMenu,
|
|
866
|
+
release.scheduledAt && release.timezone && /* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(
|
|
725
867
|
{
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
868
|
+
id: "content-releases.content-manager-edit-view.scheduled.date",
|
|
869
|
+
defaultMessage: "{date} at {time} ({offset})"
|
|
870
|
+
},
|
|
871
|
+
{
|
|
872
|
+
date: formatDate(new Date(release.scheduledAt), {
|
|
873
|
+
day: "2-digit",
|
|
874
|
+
month: "2-digit",
|
|
875
|
+
year: "numeric",
|
|
876
|
+
timeZone: release.timezone
|
|
877
|
+
}),
|
|
878
|
+
time: formatTime(new Date(release.scheduledAt), {
|
|
879
|
+
hourCycle: "h23",
|
|
880
|
+
timeZone: release.timezone
|
|
881
|
+
}),
|
|
882
|
+
offset: getTimezoneOffset(
|
|
883
|
+
release.timezone,
|
|
884
|
+
new Date(release.scheduledAt)
|
|
885
|
+
)
|
|
729
886
|
}
|
|
730
|
-
)
|
|
887
|
+
) }),
|
|
888
|
+
/* @__PURE__ */ jsx(CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxs(ReleaseActionMenu.Root, { hasTriggerBorder: true, children: [
|
|
889
|
+
/* @__PURE__ */ jsx(ReleaseActionMenu.EditReleaseItem, { releaseId: release.id }),
|
|
890
|
+
/* @__PURE__ */ jsx(
|
|
891
|
+
ReleaseActionMenu.DeleteReleaseActionItem,
|
|
892
|
+
{
|
|
893
|
+
releaseId: release.id,
|
|
894
|
+
actionId: release.action.id
|
|
895
|
+
}
|
|
896
|
+
)
|
|
897
|
+
] }) })
|
|
731
898
|
] })
|
|
732
899
|
]
|
|
733
900
|
},
|
|
@@ -755,8 +922,8 @@ const CMReleasesContainer = () => {
|
|
|
755
922
|
AddActionToReleaseModal,
|
|
756
923
|
{
|
|
757
924
|
handleClose: toggleModal,
|
|
758
|
-
contentTypeUid
|
|
759
|
-
entryId
|
|
925
|
+
contentTypeUid,
|
|
926
|
+
entryId
|
|
760
927
|
}
|
|
761
928
|
)
|
|
762
929
|
]
|
|
@@ -766,7 +933,7 @@ const CMReleasesContainer = () => {
|
|
|
766
933
|
const admin = {
|
|
767
934
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
768
935
|
register(app) {
|
|
769
|
-
if (window.strapi.features.isEnabled("cms-content-releases")
|
|
936
|
+
if (window.strapi.features.isEnabled("cms-content-releases")) {
|
|
770
937
|
app.addMenuLink({
|
|
771
938
|
to: `/plugins/${pluginId}`,
|
|
772
939
|
icon: PaperPlane,
|
|
@@ -775,7 +942,7 @@ const admin = {
|
|
|
775
942
|
defaultMessage: "Releases"
|
|
776
943
|
},
|
|
777
944
|
async Component() {
|
|
778
|
-
const { App } = await import("./App-
|
|
945
|
+
const { App } = await import("./App-R-kksTW7.mjs");
|
|
779
946
|
return App;
|
|
780
947
|
},
|
|
781
948
|
permissions: PERMISSIONS.main
|
|
@@ -788,12 +955,26 @@ const admin = {
|
|
|
788
955
|
name: `${pluginId}-link`,
|
|
789
956
|
Component: CMReleasesContainer
|
|
790
957
|
});
|
|
958
|
+
} else if (!window.strapi.features.isEnabled("cms-content-releases") && window.strapi?.flags?.promoteEE) {
|
|
959
|
+
app.addMenuLink({
|
|
960
|
+
to: `/plugins/purchase-content-releases`,
|
|
961
|
+
icon: PaperPlane,
|
|
962
|
+
intlLabel: {
|
|
963
|
+
id: `${pluginId}.plugin.name`,
|
|
964
|
+
defaultMessage: "Releases"
|
|
965
|
+
},
|
|
966
|
+
async Component() {
|
|
967
|
+
const { PurchaseContentReleases } = await import("./PurchaseContentReleases-Clm0iACO.mjs");
|
|
968
|
+
return PurchaseContentReleases;
|
|
969
|
+
},
|
|
970
|
+
lockIcon: true
|
|
971
|
+
});
|
|
791
972
|
}
|
|
792
973
|
},
|
|
793
974
|
async registerTrads({ locales }) {
|
|
794
975
|
const importedTrads = await Promise.all(
|
|
795
976
|
locales.map((locale) => {
|
|
796
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-
|
|
977
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-RdapH-9X.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
|
|
797
978
|
return {
|
|
798
979
|
data: prefixPluginTranslations(data, "content-releases"),
|
|
799
980
|
locale
|
|
@@ -812,17 +993,20 @@ const admin = {
|
|
|
812
993
|
export {
|
|
813
994
|
PERMISSIONS as P,
|
|
814
995
|
ReleaseActionOptions as R,
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
996
|
+
useCreateReleaseMutation as a,
|
|
997
|
+
useGetReleaseQuery as b,
|
|
998
|
+
useUpdateReleaseMutation as c,
|
|
999
|
+
useDeleteReleaseMutation as d,
|
|
1000
|
+
usePublishReleaseMutation as e,
|
|
1001
|
+
useTypedDispatch as f,
|
|
1002
|
+
getTimezoneOffset as g,
|
|
1003
|
+
useGetReleaseActionsQuery as h,
|
|
823
1004
|
isAxiosError as i,
|
|
824
|
-
|
|
1005
|
+
useUpdateReleaseActionMutation as j,
|
|
1006
|
+
ReleaseActionMenu as k,
|
|
1007
|
+
admin as l,
|
|
825
1008
|
pluginId as p,
|
|
826
|
-
|
|
1009
|
+
releaseApi as r,
|
|
1010
|
+
useGetReleasesQuery as u
|
|
827
1011
|
};
|
|
828
|
-
//# sourceMappingURL=index-
|
|
1012
|
+
//# sourceMappingURL=index-vpSczx8v.mjs.map
|