@strapi/content-releases 5.0.0-beta.5 → 5.0.0-beta.7
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-FVorrIzF.js → App-BdcItFff.js} +119 -126
- package/dist/_chunks/App-BdcItFff.js.map +1 -0
- package/dist/_chunks/{App-Cmn2Mkn7.mjs → App-CJdkbHnd.mjs} +110 -116
- package/dist/_chunks/App-CJdkbHnd.mjs.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-sD6ADHk2.js → PurchaseContentReleases-Be3acS2L.js} +7 -6
- package/dist/_chunks/PurchaseContentReleases-Be3acS2L.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-C8djn9fP.mjs → PurchaseContentReleases-_MxP6-Dt.mjs} +8 -7
- package/dist/_chunks/PurchaseContentReleases-_MxP6-Dt.mjs.map +1 -0
- package/dist/_chunks/{index-BfJLth9Z.js → index-B6Y2hJ10.js} +100 -108
- package/dist/_chunks/index-B6Y2hJ10.js.map +1 -0
- package/dist/_chunks/{index-DDohgTaQ.mjs → index-BvhZTh4j.mjs} +100 -106
- package/dist/_chunks/index-BvhZTh4j.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/ReleaseAction.d.ts +1 -1
- package/dist/admin/src/services/baseQuery.d.ts +26 -0
- package/dist/admin/src/services/release.d.ts +216 -81
- package/package.json +12 -13
- package/dist/_chunks/App-Cmn2Mkn7.mjs.map +0 -1
- package/dist/_chunks/App-FVorrIzF.js.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-C8djn9fP.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-sD6ADHk2.js.map +0 -1
- package/dist/_chunks/index-BfJLth9Z.js.map +0 -1
- package/dist/_chunks/index-DDohgTaQ.mjs.map +0 -1
- package/dist/admin/src/services/axios.d.ts +0 -29
|
@@ -4,17 +4,15 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
|
4
4
|
const React = require("react");
|
|
5
5
|
const query = require("@reduxjs/toolkit/query");
|
|
6
6
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
7
|
+
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
|
7
8
|
const designSystem = require("@strapi/design-system");
|
|
8
|
-
const
|
|
9
|
-
const strapiAdmin$1 = require("@strapi/plugin-content-manager/strapi-admin");
|
|
10
|
-
const axios = require("axios");
|
|
9
|
+
const symbols = require("@strapi/icons/symbols");
|
|
11
10
|
const formik = require("formik");
|
|
12
11
|
const reactIntl = require("react-intl");
|
|
13
12
|
const reactRouterDom = require("react-router-dom");
|
|
14
13
|
const yup = require("yup");
|
|
15
14
|
const react = require("@reduxjs/toolkit/query/react");
|
|
16
|
-
const
|
|
17
|
-
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
15
|
+
const styledComponents = require("styled-components");
|
|
18
16
|
function _interopNamespace(e) {
|
|
19
17
|
if (e && e.__esModule)
|
|
20
18
|
return e;
|
|
@@ -35,7 +33,6 @@ function _interopNamespace(e) {
|
|
|
35
33
|
}
|
|
36
34
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
37
35
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
38
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
39
36
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
40
37
|
const v = glob[path];
|
|
41
38
|
if (v) {
|
|
@@ -118,7 +115,7 @@ const PERMISSIONS = {
|
|
|
118
115
|
]
|
|
119
116
|
};
|
|
120
117
|
const pluginId = "content-releases";
|
|
121
|
-
const
|
|
118
|
+
const fetchBaseQuery = async ({
|
|
122
119
|
url,
|
|
123
120
|
method,
|
|
124
121
|
data,
|
|
@@ -144,7 +141,7 @@ const axiosBaseQuery = async ({
|
|
|
144
141
|
const err = error;
|
|
145
142
|
return {
|
|
146
143
|
error: {
|
|
147
|
-
status: err.
|
|
144
|
+
status: err.status,
|
|
148
145
|
code: err.code,
|
|
149
146
|
response: {
|
|
150
147
|
data: err.response?.data
|
|
@@ -153,12 +150,9 @@ const axiosBaseQuery = async ({
|
|
|
153
150
|
};
|
|
154
151
|
}
|
|
155
152
|
};
|
|
156
|
-
const isAxiosError = (err) => {
|
|
157
|
-
return typeof err === "object" && err !== null && "response" in err && typeof err.response === "object" && err.response !== null && "data" in err.response;
|
|
158
|
-
};
|
|
159
153
|
const releaseApi = react.createApi({
|
|
160
154
|
reducerPath: pluginId,
|
|
161
|
-
baseQuery:
|
|
155
|
+
baseQuery: fetchBaseQuery,
|
|
162
156
|
tagTypes: ["Release", "ReleaseAction", "EntriesInRelease"],
|
|
163
157
|
endpoints: (build) => {
|
|
164
158
|
return {
|
|
@@ -399,14 +393,12 @@ const getTimezoneOffset = (timezone, date) => {
|
|
|
399
393
|
return "";
|
|
400
394
|
}
|
|
401
395
|
};
|
|
402
|
-
const StyledMenuItem =
|
|
396
|
+
const StyledMenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
|
403
397
|
&:hover {
|
|
404
|
-
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
398
|
+
background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
|
|
405
399
|
|
|
406
400
|
svg {
|
|
407
|
-
|
|
408
|
-
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
409
|
-
}
|
|
401
|
+
fill: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}600`]};
|
|
410
402
|
}
|
|
411
403
|
|
|
412
404
|
a {
|
|
@@ -415,9 +407,7 @@ const StyledMenuItem = styled__default.default(v2.Menu.Item)`
|
|
|
415
407
|
}
|
|
416
408
|
|
|
417
409
|
svg {
|
|
418
|
-
|
|
419
|
-
fill: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}600`]};
|
|
420
|
-
}
|
|
410
|
+
fill: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}600`]};
|
|
421
411
|
}
|
|
422
412
|
|
|
423
413
|
a {
|
|
@@ -429,7 +419,7 @@ const StyledMenuItem = styled__default.default(v2.Menu.Item)`
|
|
|
429
419
|
width: 100%;
|
|
430
420
|
}
|
|
431
421
|
`;
|
|
432
|
-
const StyledIconButton =
|
|
422
|
+
const StyledIconButton = styledComponents.styled(designSystem.IconButton)`
|
|
433
423
|
/* Setting this style inline with borderColor will not apply the style */
|
|
434
424
|
border: ${({ theme }) => `1px solid ${theme.colors.neutral200}`};
|
|
435
425
|
`;
|
|
@@ -456,7 +446,7 @@ const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
|
|
|
456
446
|
return;
|
|
457
447
|
}
|
|
458
448
|
if ("error" in response) {
|
|
459
|
-
if (
|
|
449
|
+
if (strapiAdmin.isFetchError(response.error)) {
|
|
460
450
|
toggleNotification({
|
|
461
451
|
type: "danger",
|
|
462
452
|
message: formatAPIError(response.error)
|
|
@@ -472,8 +462,8 @@ const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
|
|
|
472
462
|
if (!canDeleteAction) {
|
|
473
463
|
return null;
|
|
474
464
|
}
|
|
475
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { variant: "danger", onSelect: handleDeleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
476
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
465
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { $variant: "danger", onSelect: handleDeleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
466
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.Cross, { width: "1.6rem", height: "1.6rem" }),
|
|
477
467
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
|
|
478
468
|
id: "content-releases.content-manager-edit-view.remove-from-release",
|
|
479
469
|
defaultMessage: "Remove from release"
|
|
@@ -509,47 +499,48 @@ const ReleaseActionEntryLinkItem = ({
|
|
|
509
499
|
if (!canUpdateContentType || !canUpdateEntryForLocale) {
|
|
510
500
|
return null;
|
|
511
501
|
}
|
|
512
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
513
|
-
|
|
502
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
503
|
+
StyledMenuItem,
|
|
514
504
|
{
|
|
515
|
-
|
|
505
|
+
tag: reactRouterDom.Link,
|
|
506
|
+
isLink: true,
|
|
516
507
|
to: {
|
|
517
508
|
pathname: `/content-manager/collection-types/${contentTypeUid}/${entryId}`,
|
|
518
509
|
search: locale && `?plugins[i18n][locale]=${locale}`
|
|
519
510
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
511
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
512
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, { width: "1.6rem", height: "1.6rem" }),
|
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
514
|
+
id: "content-releases.content-manager-edit-view.edit-entry",
|
|
515
|
+
defaultMessage: "Edit entry"
|
|
516
|
+
}) })
|
|
517
|
+
] })
|
|
525
518
|
}
|
|
526
|
-
)
|
|
519
|
+
);
|
|
527
520
|
};
|
|
528
521
|
const EditReleaseItem = ({ releaseId }) => {
|
|
529
522
|
const { formatMessage } = reactIntl.useIntl();
|
|
530
|
-
return
|
|
531
|
-
|
|
532
|
-
{
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
isExternal: false,
|
|
536
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
523
|
+
return (
|
|
524
|
+
/* @ts-expect-error inference isn't working in DS */
|
|
525
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { tag: reactRouterDom.Link, isLink: true, to: `/plugins/content-releases/${releaseId}`, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
526
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, { width: "1.6rem", height: "1.6rem" }),
|
|
527
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
|
|
537
528
|
id: "content-releases.content-manager-edit-view.edit-release",
|
|
538
529
|
defaultMessage: "Edit release"
|
|
539
530
|
}) })
|
|
540
|
-
}
|
|
541
|
-
)
|
|
531
|
+
] }) })
|
|
532
|
+
);
|
|
542
533
|
};
|
|
543
534
|
const Root = ({ children, hasTriggerBorder = false }) => {
|
|
544
535
|
const { formatMessage } = reactIntl.useIntl();
|
|
545
536
|
const { allowedActions } = strapiAdmin.useRBAC(PERMISSIONS);
|
|
546
537
|
return (
|
|
547
538
|
// A user can access the dropdown if they have permissions to delete a release-action OR update a release
|
|
548
|
-
allowedActions.canDeleteAction || allowedActions.canUpdate ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
539
|
+
allowedActions.canDeleteAction || allowedActions.canUpdate ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
549
540
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
550
|
-
|
|
541
|
+
designSystem.Menu.Trigger,
|
|
551
542
|
{
|
|
552
|
-
|
|
543
|
+
tag: hasTriggerBorder ? StyledIconButton : designSystem.IconButton,
|
|
553
544
|
paddingLeft: 2,
|
|
554
545
|
paddingRight: 2,
|
|
555
546
|
"aria-label": formatMessage({
|
|
@@ -559,7 +550,7 @@ const Root = ({ children, hasTriggerBorder = false }) => {
|
|
|
559
550
|
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
560
551
|
}
|
|
561
552
|
),
|
|
562
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
553
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { top: 1, popoverPlacement: "bottom-end", children })
|
|
563
554
|
] }) : null
|
|
564
555
|
);
|
|
565
556
|
};
|
|
@@ -575,11 +566,11 @@ const getBorderLeftRadiusValue = (actionType) => {
|
|
|
575
566
|
const getBorderRightRadiusValue = (actionType) => {
|
|
576
567
|
return actionType === "publish" ? 0 : 1;
|
|
577
568
|
};
|
|
578
|
-
const FieldWrapper =
|
|
579
|
-
border-top-left-radius: ${({ actionType, theme }) => theme.spaces[getBorderLeftRadiusValue(actionType)]};
|
|
580
|
-
border-bottom-left-radius: ${({ actionType, theme }) => theme.spaces[getBorderLeftRadiusValue(actionType)]};
|
|
581
|
-
border-top-right-radius: ${({ actionType, theme }) => theme.spaces[getBorderRightRadiusValue(actionType)]};
|
|
582
|
-
border-bottom-right-radius: ${({ actionType, theme }) => theme.spaces[getBorderRightRadiusValue(actionType)]};
|
|
569
|
+
const FieldWrapper = styledComponents.styled(designSystem.Field.Root)`
|
|
570
|
+
border-top-left-radius: ${({ $actionType, theme }) => theme.spaces[getBorderLeftRadiusValue($actionType)]};
|
|
571
|
+
border-bottom-left-radius: ${({ $actionType, theme }) => theme.spaces[getBorderLeftRadiusValue($actionType)]};
|
|
572
|
+
border-top-right-radius: ${({ $actionType, theme }) => theme.spaces[getBorderRightRadiusValue($actionType)]};
|
|
573
|
+
border-bottom-right-radius: ${({ $actionType, theme }) => theme.spaces[getBorderRightRadiusValue($actionType)]};
|
|
583
574
|
|
|
584
575
|
> label {
|
|
585
576
|
color: inherit;
|
|
@@ -590,14 +581,14 @@ const FieldWrapper = styled__default.default(designSystem.Field)`
|
|
|
590
581
|
}
|
|
591
582
|
|
|
592
583
|
&[data-checked='true'] {
|
|
593
|
-
color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
594
|
-
background-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary100 : theme.colors.danger100};
|
|
595
|
-
border-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
584
|
+
color: ${({ theme, $actionType }) => $actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
585
|
+
background-color: ${({ theme, $actionType }) => $actionType === "publish" ? theme.colors.primary100 : theme.colors.danger100};
|
|
586
|
+
border-color: ${({ theme, $actionType }) => $actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
|
|
596
587
|
}
|
|
597
588
|
|
|
598
589
|
&[data-checked='false'] {
|
|
599
|
-
border-left: ${({ actionType }) => actionType === "unpublish" && "none"};
|
|
600
|
-
border-right: ${({ actionType }) => actionType === "publish" && "none"};
|
|
590
|
+
border-left: ${({ $actionType }) => $actionType === "unpublish" && "none"};
|
|
591
|
+
border-right: ${({ $actionType }) => $actionType === "publish" && "none"};
|
|
601
592
|
}
|
|
602
593
|
|
|
603
594
|
&[data-checked='false'][data-disabled='false']:hover {
|
|
@@ -626,7 +617,7 @@ const ActionOption = ({
|
|
|
626
617
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
627
618
|
FieldWrapper,
|
|
628
619
|
{
|
|
629
|
-
actionType,
|
|
620
|
+
$actionType: actionType,
|
|
630
621
|
background: "primary0",
|
|
631
622
|
borderColor: "neutral200",
|
|
632
623
|
color: selected === actionType ? "primary600" : "neutral600",
|
|
@@ -634,12 +625,11 @@ const ActionOption = ({
|
|
|
634
625
|
cursor: "pointer",
|
|
635
626
|
"data-checked": selected === actionType,
|
|
636
627
|
"data-disabled": disabled && selected !== actionType,
|
|
637
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
|
628
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Label, { children: [
|
|
638
629
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
639
|
-
designSystem.
|
|
630
|
+
designSystem.Field.Input,
|
|
640
631
|
{
|
|
641
632
|
type: "radio",
|
|
642
|
-
id: `${name}-${actionType}`,
|
|
643
633
|
name,
|
|
644
634
|
checked: selected === actionType,
|
|
645
635
|
onChange: handleChange,
|
|
@@ -694,18 +684,18 @@ const NoReleases = () => {
|
|
|
694
684
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
695
685
|
designSystem.EmptyStateLayout,
|
|
696
686
|
{
|
|
697
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
687
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" }),
|
|
698
688
|
content: formatMessage({
|
|
699
689
|
id: "content-releases.content-manager-edit-view.add-to-release.no-releases-message",
|
|
700
690
|
defaultMessage: "No available releases. Open the list of releases and create a new one from there."
|
|
701
691
|
}),
|
|
702
692
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
703
|
-
|
|
693
|
+
designSystem.LinkButton,
|
|
704
694
|
{
|
|
705
695
|
to: {
|
|
706
696
|
pathname: "/plugins/content-releases"
|
|
707
697
|
},
|
|
708
|
-
|
|
698
|
+
tag: reactRouterDom.Link,
|
|
709
699
|
variant: "secondary",
|
|
710
700
|
children: formatMessage({
|
|
711
701
|
id: "content-releases.content-manager-edit-view.add-to-release.redirect-button",
|
|
@@ -756,7 +746,7 @@ const AddActionToReleaseModal = ({
|
|
|
756
746
|
return;
|
|
757
747
|
}
|
|
758
748
|
if ("error" in response2) {
|
|
759
|
-
if (
|
|
749
|
+
if (strapiAdmin.isFetchError(response2.error)) {
|
|
760
750
|
toggleNotification({
|
|
761
751
|
type: "danger",
|
|
762
752
|
message: formatAPIError(response2.error)
|
|
@@ -783,24 +773,25 @@ const AddActionToReleaseModal = ({
|
|
|
783
773
|
children: ({ values, setFieldValue }) => {
|
|
784
774
|
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
785
775
|
releases?.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoReleases, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
786
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.
|
|
787
|
-
designSystem.
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
776
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { required: true, children: [
|
|
777
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
778
|
+
id: "content-releases.content-manager-edit-view.add-to-release.select-label",
|
|
779
|
+
defaultMessage: "Select a release"
|
|
780
|
+
}) }),
|
|
781
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
782
|
+
designSystem.SingleSelect,
|
|
783
|
+
{
|
|
784
|
+
placeholder: formatMessage({
|
|
785
|
+
id: "content-releases.content-manager-edit-view.add-to-release.select-placeholder",
|
|
786
|
+
defaultMessage: "Select"
|
|
787
|
+
}),
|
|
788
|
+
onChange: (value) => setFieldValue("releaseId", value),
|
|
789
|
+
value: values.releaseId,
|
|
790
|
+
children: releases?.map((release) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: release.id, children: release.name }, release.id))
|
|
791
|
+
}
|
|
792
|
+
)
|
|
793
|
+
] }) }),
|
|
794
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
804
795
|
id: "content-releases.content-manager-edit-view.add-to-release.action-type-label",
|
|
805
796
|
defaultMessage: "What do you want to do with this entry?"
|
|
806
797
|
}) }),
|
|
@@ -843,6 +834,7 @@ const CMReleasesContainer = () => {
|
|
|
843
834
|
const { formatMessage, formatDate, formatTime } = reactIntl.useIntl();
|
|
844
835
|
const { id, slug, collectionType } = reactRouterDom.useParams();
|
|
845
836
|
const isCreatingEntry = id === "create";
|
|
837
|
+
const entryId = parseInt(id, 10);
|
|
846
838
|
const { allowedActions } = strapiAdmin.useRBAC(PERMISSIONS);
|
|
847
839
|
const { canCreateAction, canRead: canMain, canDeleteAction } = allowedActions;
|
|
848
840
|
const { schema } = strapiAdmin$1.unstable_useDocument({
|
|
@@ -854,7 +846,7 @@ const CMReleasesContainer = () => {
|
|
|
854
846
|
const canFetch = id != null && contentTypeUid != null;
|
|
855
847
|
const fetchParams = canFetch ? {
|
|
856
848
|
contentTypeUid,
|
|
857
|
-
entryId
|
|
849
|
+
entryId,
|
|
858
850
|
hasEntryAttached: true
|
|
859
851
|
} : query.skipToken;
|
|
860
852
|
const response = useGetReleasesForEntryQuery(fetchParams);
|
|
@@ -878,7 +870,7 @@ const CMReleasesContainer = () => {
|
|
|
878
870
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
879
871
|
designSystem.Box,
|
|
880
872
|
{
|
|
881
|
-
|
|
873
|
+
tag: "aside",
|
|
882
874
|
"aria-label": formatMessage({
|
|
883
875
|
id: "content-releases.plugin.name",
|
|
884
876
|
defaultMessage: "Releases"
|
|
@@ -994,7 +986,7 @@ const CMReleasesContainer = () => {
|
|
|
994
986
|
{
|
|
995
987
|
handleClose: toggleModal,
|
|
996
988
|
contentTypeUid,
|
|
997
|
-
entryId
|
|
989
|
+
entryId
|
|
998
990
|
}
|
|
999
991
|
)
|
|
1000
992
|
]
|
|
@@ -1076,7 +1068,7 @@ const ReleaseAction = ({ documentIds, model }) => {
|
|
|
1076
1068
|
return true;
|
|
1077
1069
|
}
|
|
1078
1070
|
if ("error" in response2) {
|
|
1079
|
-
if (
|
|
1071
|
+
if (strapiAdmin.isFetchError(response2.error)) {
|
|
1080
1072
|
toggleNotification({
|
|
1081
1073
|
type: "warning",
|
|
1082
1074
|
message: formatAPIError(response2.error)
|
|
@@ -1118,24 +1110,25 @@ const ReleaseAction = ({ documentIds, model }) => {
|
|
|
1118
1110
|
initialValues: INITIAL_VALUES,
|
|
1119
1111
|
children: ({ values, setFieldValue }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
1120
1112
|
releases?.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoReleases, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
|
1121
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.
|
|
1122
|
-
designSystem.
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1113
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { required: true, children: [
|
|
1114
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
1115
|
+
id: "content-releases.content-manager-list-view.add-to-release.select-label",
|
|
1116
|
+
defaultMessage: "Select a release"
|
|
1117
|
+
}) }),
|
|
1118
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1119
|
+
designSystem.SingleSelect,
|
|
1120
|
+
{
|
|
1121
|
+
placeholder: formatMessage({
|
|
1122
|
+
id: "content-releases.content-manager-list-view.add-to-release.select-placeholder",
|
|
1123
|
+
defaultMessage: "Select"
|
|
1124
|
+
}),
|
|
1125
|
+
onChange: (value) => setFieldValue("releaseId", value),
|
|
1126
|
+
value: values.releaseId,
|
|
1127
|
+
children: releases?.map((release) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: release.id, children: release.name }, release.id))
|
|
1128
|
+
}
|
|
1129
|
+
)
|
|
1130
|
+
] }) }),
|
|
1131
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
1139
1132
|
id: "content-releases.content-manager-list-view.add-to-release.action-type-label",
|
|
1140
1133
|
defaultMessage: "What do you want to do with these entries?"
|
|
1141
1134
|
}) }),
|
|
@@ -1195,7 +1188,7 @@ const admin = {
|
|
|
1195
1188
|
id: `${pluginId}.plugin.name`,
|
|
1196
1189
|
defaultMessage: "Releases"
|
|
1197
1190
|
},
|
|
1198
|
-
Component: () => Promise.resolve().then(() => require("./App-
|
|
1191
|
+
Component: () => Promise.resolve().then(() => require("./App-BdcItFff.js")).then((mod) => ({ default: mod.App })),
|
|
1199
1192
|
permissions: PERMISSIONS.main
|
|
1200
1193
|
});
|
|
1201
1194
|
app.addMiddlewares([() => releaseApi.middleware]);
|
|
@@ -1221,7 +1214,7 @@ const admin = {
|
|
|
1221
1214
|
},
|
|
1222
1215
|
permissions: [],
|
|
1223
1216
|
async Component() {
|
|
1224
|
-
const { PurchaseContentReleases } = await Promise.resolve().then(() => require("./PurchaseContentReleases-
|
|
1217
|
+
const { PurchaseContentReleases } = await Promise.resolve().then(() => require("./PurchaseContentReleases-Be3acS2L.js"));
|
|
1225
1218
|
return { default: PurchaseContentReleases };
|
|
1226
1219
|
},
|
|
1227
1220
|
lockIcon: true
|
|
@@ -1252,7 +1245,6 @@ exports.ReleaseActionMenu = ReleaseActionMenu;
|
|
|
1252
1245
|
exports.ReleaseActionOptions = ReleaseActionOptions;
|
|
1253
1246
|
exports.admin = admin;
|
|
1254
1247
|
exports.getTimezoneOffset = getTimezoneOffset;
|
|
1255
|
-
exports.isAxiosError = isAxiosError;
|
|
1256
1248
|
exports.pluginId = pluginId;
|
|
1257
1249
|
exports.releaseApi = releaseApi;
|
|
1258
1250
|
exports.useCreateReleaseMutation = useCreateReleaseMutation;
|
|
@@ -1263,4 +1255,4 @@ exports.useGetReleasesQuery = useGetReleasesQuery;
|
|
|
1263
1255
|
exports.usePublishReleaseMutation = usePublishReleaseMutation;
|
|
1264
1256
|
exports.useUpdateReleaseActionMutation = useUpdateReleaseActionMutation;
|
|
1265
1257
|
exports.useUpdateReleaseMutation = useUpdateReleaseMutation;
|
|
1266
|
-
//# sourceMappingURL=index-
|
|
1258
|
+
//# sourceMappingURL=index-B6Y2hJ10.js.map
|