@strapi/content-releases 0.0.0-experimental.d362bf200f5f9359a4bbd4a549603de5ee1f04ca → 0.0.0-experimental.d3cdf79a0d5f803dfeb6d0f055bb2f3b913bb015
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/LICENSE +17 -1
- package/dist/_chunks/{App-X01LBg5V.mjs → App-CiZCkScI.mjs} +666 -437
- package/dist/_chunks/App-CiZCkScI.mjs.map +1 -0
- package/dist/_chunks/App-SGjO5UPV.js +1578 -0
- package/dist/_chunks/App-SGjO5UPV.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-YhAPgpG9.js → PurchaseContentReleases--qQepXpP.js} +9 -8
- package/dist/_chunks/PurchaseContentReleases--qQepXpP.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Clm0iACO.mjs → PurchaseContentReleases-D-n-w-st.mjs} +10 -9
- package/dist/_chunks/PurchaseContentReleases-D-n-w-st.mjs.map +1 -0
- package/dist/_chunks/ReleasesSettingsPage-Cto_NLUd.js +178 -0
- package/dist/_chunks/ReleasesSettingsPage-Cto_NLUd.js.map +1 -0
- package/dist/_chunks/ReleasesSettingsPage-DQT8N3A-.mjs +178 -0
- package/dist/_chunks/ReleasesSettingsPage-DQT8N3A-.mjs.map +1 -0
- package/dist/_chunks/{en-faJDuv3q.js → en-BWPPsSH-.js} +28 -3
- package/dist/_chunks/en-BWPPsSH-.js.map +1 -0
- package/dist/_chunks/{en-RdapH-9X.mjs → en-D9Q4YW03.mjs} +28 -3
- package/dist/_chunks/en-D9Q4YW03.mjs.map +1 -0
- package/dist/_chunks/index-BjvFfTtA.mjs +1386 -0
- package/dist/_chunks/index-BjvFfTtA.mjs.map +1 -0
- package/dist/_chunks/index-CyU534vL.js +1404 -0
- package/dist/_chunks/index-CyU534vL.js.map +1 -0
- package/dist/_chunks/schemas-DBYv9gK8.js +61 -0
- package/dist/_chunks/schemas-DBYv9gK8.js.map +1 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs +44 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/EntryValidationPopover.d.ts +13 -0
- package/dist/admin/src/components/ReleaseAction.d.ts +3 -0
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +3 -3
- package/dist/admin/src/components/ReleaseActionModal.d.ts +24 -0
- package/dist/admin/src/components/ReleaseListCell.d.ts +28 -0
- package/dist/admin/src/components/ReleaseModal.d.ts +3 -2
- package/dist/admin/src/components/ReleasesPanel.d.ts +3 -0
- package/dist/admin/src/constants.d.ts +18 -0
- package/dist/admin/src/modules/hooks.d.ts +7 -0
- package/dist/admin/src/pages/ReleasesSettingsPage.d.ts +1 -0
- package/dist/admin/src/services/release.d.ts +56 -313
- package/dist/admin/src/utils/api.d.ts +6 -0
- package/dist/admin/src/utils/time.d.ts +9 -0
- package/dist/admin/src/validation/schemas.d.ts +6 -0
- package/dist/server/index.js +916 -580
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +916 -579
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/constants.d.ts +11 -2
- package/dist/server/src/constants.d.ts.map +1 -1
- package/dist/server/src/content-types/index.d.ts +3 -5
- package/dist/server/src/content-types/index.d.ts.map +1 -1
- package/dist/server/src/content-types/release-action/index.d.ts +3 -5
- package/dist/server/src/content-types/release-action/index.d.ts.map +1 -1
- package/dist/server/src/content-types/release-action/schema.d.ts +3 -5
- package/dist/server/src/content-types/release-action/schema.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts +7 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/release.d.ts +8 -1
- package/dist/server/src/controllers/release.d.ts.map +1 -1
- package/dist/server/src/controllers/settings.d.ts +11 -0
- package/dist/server/src/controllers/settings.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/release-action.d.ts +7 -1
- package/dist/server/src/controllers/validation/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/release.d.ts +2 -0
- package/dist/server/src/controllers/validation/release.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/settings.d.ts +3 -0
- package/dist/server/src/controllers/validation/settings.d.ts.map +1 -0
- package/dist/server/src/destroy.d.ts +1 -1
- package/dist/server/src/destroy.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +72 -56
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/middlewares/documents.d.ts +6 -0
- package/dist/server/src/middlewares/documents.d.ts.map +1 -0
- package/dist/server/src/migrations/database/5.0.0-document-id-in-actions.d.ts +9 -0
- package/dist/server/src/migrations/database/5.0.0-document-id-in-actions.d.ts.map +1 -0
- package/dist/server/src/migrations/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts +16 -0
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/routes/release.d.ts.map +1 -1
- package/dist/server/src/routes/settings.d.ts +18 -0
- package/dist/server/src/routes/settings.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +39 -41
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts +34 -0
- package/dist/server/src/services/release-action.d.ts.map +1 -0
- package/dist/server/src/services/release.d.ts +7 -42
- package/dist/server/src/services/release.d.ts.map +1 -1
- package/dist/server/src/services/scheduling.d.ts +1 -1
- package/dist/server/src/services/scheduling.d.ts.map +1 -1
- package/dist/server/src/services/settings.d.ts +13 -0
- package/dist/server/src/services/settings.d.ts.map +1 -0
- package/dist/server/src/services/validation.d.ts +2 -2
- package/dist/server/src/services/validation.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +33 -12
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +17 -11
- package/dist/shared/contracts/release-actions.d.ts.map +1 -1
- package/dist/shared/contracts/releases.d.ts +24 -6
- package/dist/shared/contracts/releases.d.ts.map +1 -1
- package/dist/shared/contracts/settings.d.ts +39 -0
- package/dist/shared/contracts/settings.d.ts.map +1 -0
- package/package.json +24 -22
- package/dist/_chunks/App-1LckaIGY.js +0 -1352
- package/dist/_chunks/App-1LckaIGY.js.map +0 -1
- package/dist/_chunks/App-X01LBg5V.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-Clm0iACO.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-YhAPgpG9.js.map +0 -1
- package/dist/_chunks/en-RdapH-9X.mjs.map +0 -1
- package/dist/_chunks/en-faJDuv3q.js.map +0 -1
- package/dist/_chunks/index-OD9AlD-6.mjs +0 -1033
- package/dist/_chunks/index-OD9AlD-6.mjs.map +0 -1
- package/dist/_chunks/index-cYWov2wa.js +0 -1054
- package/dist/_chunks/index-cYWov2wa.js.map +0 -1
- package/dist/admin/src/components/CMReleasesContainer.d.ts +0 -1
- package/dist/admin/src/services/axios.d.ts +0 -29
- package/dist/shared/validation-schemas.d.ts +0 -2
- package/dist/shared/validation-schemas.d.ts.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -1,21 +1,308 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useNotification, useAPIErrorHandler, useQueryParams,
|
|
3
|
-
import { useLocation, useNavigate, useParams, Navigate,
|
|
4
|
-
import { g as
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useNotification, useAPIErrorHandler, useQueryParams, useTracking, useRBAC, Page, Layouts, Pagination, isFetchError, ConfirmDialog, BackButton, useStrapiApp, Table } from "@strapi/admin/strapi-admin";
|
|
3
|
+
import { Link, useLocation, useNavigate, NavLink, useParams, Navigate, Routes, Route } from "react-router-dom";
|
|
4
|
+
import { g as getTimezones, p as pluginId, u as useGetReleasesQuery, a as useGetReleaseSettingsQuery, b as useCreateReleaseMutation, P as PERMISSIONS, c as useGetReleaseQuery, d as useUpdateReleaseMutation, e as useDeleteReleaseMutation, f as usePublishReleaseMutation, h as getTimezoneOffset, i as useGetReleaseActionsQuery, j as useUpdateReleaseActionMutation, R as ReleaseActionOptions, k as ReleaseActionMenu, r as releaseApi } from "./index-BjvFfTtA.mjs";
|
|
5
5
|
import * as React from "react";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import format from "date-fns/format";
|
|
6
|
+
import { Flex, Popover, Button, Typography, LinkButton, Modal, Field, TextInput, Box, Checkbox, DatePicker, TimePicker, Combobox, ComboboxOption, Link as Link$1, Alert, Main, Tabs, Divider, EmptyStateLayout, Grid, Badge, MenuItem, SimpleMenu, Dialog, SingleSelect, SingleSelectOption, Tr, Td } from "@strapi/design-system";
|
|
7
|
+
import { CrossCircle, CaretDown, CheckCircle, ArrowsCounterClockwise, Plus, Pencil, Trash, More } from "@strapi/icons";
|
|
8
|
+
import { EmptyDocuments } from "@strapi/icons/symbols";
|
|
9
|
+
import format$1 from "date-fns/format";
|
|
10
10
|
import { utcToZonedTime, zonedTimeToUtc } from "date-fns-tz";
|
|
11
11
|
import { useIntl } from "react-intl";
|
|
12
|
-
import styled from "styled-components";
|
|
13
|
-
import {
|
|
12
|
+
import { styled } from "styled-components";
|
|
13
|
+
import { unstable_useDocument } from "@strapi/content-manager/strapi-admin";
|
|
14
|
+
import { stringify } from "qs";
|
|
15
|
+
import { intervalToDuration, isPast, formatISO, format } from "date-fns";
|
|
14
16
|
import { Formik, Form, useFormikContext } from "formik";
|
|
15
|
-
import
|
|
17
|
+
import { R as RELEASE_SCHEMA } from "./schemas-DdA2ic2U.mjs";
|
|
16
18
|
import { useDispatch } from "react-redux";
|
|
19
|
+
import { useLicenseLimits } from "@strapi/admin/strapi-admin/ee";
|
|
20
|
+
const StyledPopoverFlex = styled(Flex)`
|
|
21
|
+
width: 100%;
|
|
22
|
+
max-width: 256px;
|
|
23
|
+
|
|
24
|
+
& > * {
|
|
25
|
+
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
& > *:last-child {
|
|
29
|
+
border-bottom: none;
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const EntryStatusTrigger = ({
|
|
33
|
+
action,
|
|
34
|
+
status,
|
|
35
|
+
hasErrors,
|
|
36
|
+
requiredStage,
|
|
37
|
+
entryStage
|
|
38
|
+
}) => {
|
|
39
|
+
const { formatMessage } = useIntl();
|
|
40
|
+
if (action === "publish") {
|
|
41
|
+
if (hasErrors || requiredStage && requiredStage.id !== entryStage?.id) {
|
|
42
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
43
|
+
Button,
|
|
44
|
+
{
|
|
45
|
+
variant: "ghost",
|
|
46
|
+
startIcon: /* @__PURE__ */ jsx(CrossCircle, { fill: "danger600" }),
|
|
47
|
+
endIcon: /* @__PURE__ */ jsx(CaretDown, {}),
|
|
48
|
+
children: /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
49
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.not-ready",
|
|
50
|
+
defaultMessage: "Not ready to publish"
|
|
51
|
+
}) })
|
|
52
|
+
}
|
|
53
|
+
) });
|
|
54
|
+
}
|
|
55
|
+
if (status === "draft") {
|
|
56
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
57
|
+
Button,
|
|
58
|
+
{
|
|
59
|
+
variant: "ghost",
|
|
60
|
+
startIcon: /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }),
|
|
61
|
+
endIcon: /* @__PURE__ */ jsx(CaretDown, {}),
|
|
62
|
+
children: /* @__PURE__ */ jsx(Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
63
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
64
|
+
defaultMessage: "Ready to publish"
|
|
65
|
+
}) })
|
|
66
|
+
}
|
|
67
|
+
) });
|
|
68
|
+
}
|
|
69
|
+
if (status === "modified") {
|
|
70
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
71
|
+
Button,
|
|
72
|
+
{
|
|
73
|
+
variant: "ghost",
|
|
74
|
+
startIcon: /* @__PURE__ */ jsx(ArrowsCounterClockwise, { fill: "alternative600" }),
|
|
75
|
+
endIcon: /* @__PURE__ */ jsx(CaretDown, {}),
|
|
76
|
+
children: /* @__PURE__ */ jsx(Typography, { variant: "omega", fontWeight: "bold", textColor: "alternative600", children: formatMessage({
|
|
77
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.modified",
|
|
78
|
+
defaultMessage: "Ready to publish changes"
|
|
79
|
+
}) })
|
|
80
|
+
}
|
|
81
|
+
) });
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
84
|
+
Button,
|
|
85
|
+
{
|
|
86
|
+
variant: "ghost",
|
|
87
|
+
startIcon: /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }),
|
|
88
|
+
endIcon: /* @__PURE__ */ jsx(CaretDown, {}),
|
|
89
|
+
children: /* @__PURE__ */ jsx(Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
90
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
91
|
+
defaultMessage: "Already published"
|
|
92
|
+
}) })
|
|
93
|
+
}
|
|
94
|
+
) });
|
|
95
|
+
}
|
|
96
|
+
if (status === "published") {
|
|
97
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
|
98
|
+
Button,
|
|
99
|
+
{
|
|
100
|
+
variant: "ghost",
|
|
101
|
+
startIcon: /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }),
|
|
102
|
+
endIcon: /* @__PURE__ */ jsx(CaretDown, {}),
|
|
103
|
+
children: /* @__PURE__ */ jsx(Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
104
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-unpublish",
|
|
105
|
+
defaultMessage: "Ready to unpublish"
|
|
106
|
+
}) })
|
|
107
|
+
}
|
|
108
|
+
) });
|
|
109
|
+
}
|
|
110
|
+
return /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(Button, { variant: "ghost", startIcon: /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" }), endIcon: /* @__PURE__ */ jsx(CaretDown, {}), children: /* @__PURE__ */ jsx(Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
111
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
112
|
+
defaultMessage: "Already unpublished"
|
|
113
|
+
}) }) }) });
|
|
114
|
+
};
|
|
115
|
+
const FieldsValidation = ({
|
|
116
|
+
hasErrors,
|
|
117
|
+
errors,
|
|
118
|
+
kind,
|
|
119
|
+
contentTypeUid,
|
|
120
|
+
documentId,
|
|
121
|
+
locale
|
|
122
|
+
}) => {
|
|
123
|
+
const { formatMessage } = useIntl();
|
|
124
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, width: "100%", padding: 5, children: [
|
|
125
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, width: "100%", children: [
|
|
126
|
+
/* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: formatMessage({
|
|
127
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields",
|
|
128
|
+
defaultMessage: "Fields"
|
|
129
|
+
}) }),
|
|
130
|
+
hasErrors ? /* @__PURE__ */ jsx(CrossCircle, { fill: "danger600" }) : /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" })
|
|
131
|
+
] }),
|
|
132
|
+
/* @__PURE__ */ jsx(Typography, { width: "100%", textColor: "neutral600", children: hasErrors ? formatMessage(
|
|
133
|
+
{
|
|
134
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.error",
|
|
135
|
+
defaultMessage: "{errors} errors on fields."
|
|
136
|
+
},
|
|
137
|
+
{ errors: errors ? Object.keys(errors).length : 0 }
|
|
138
|
+
) : formatMessage({
|
|
139
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.success",
|
|
140
|
+
defaultMessage: "All fields are filled correctly."
|
|
141
|
+
}) }),
|
|
142
|
+
hasErrors && /* @__PURE__ */ jsx(
|
|
143
|
+
LinkButton,
|
|
144
|
+
{
|
|
145
|
+
tag: Link,
|
|
146
|
+
to: {
|
|
147
|
+
pathname: `/content-manager/${kind === "collectionType" ? "collection-types" : "single-types"}/${contentTypeUid}/${documentId}`,
|
|
148
|
+
search: locale ? stringify({
|
|
149
|
+
plugins: {
|
|
150
|
+
i18n: {
|
|
151
|
+
locale
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}) : ""
|
|
155
|
+
},
|
|
156
|
+
variant: "secondary",
|
|
157
|
+
fullWidth: true,
|
|
158
|
+
state: { forceValidation: true },
|
|
159
|
+
children: formatMessage({
|
|
160
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.see-errors",
|
|
161
|
+
defaultMessage: "See errors"
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
] });
|
|
166
|
+
};
|
|
167
|
+
const getReviewStageIcon = ({
|
|
168
|
+
contentTypeHasReviewWorkflow,
|
|
169
|
+
requiredStage,
|
|
170
|
+
entryStage
|
|
171
|
+
}) => {
|
|
172
|
+
if (!contentTypeHasReviewWorkflow) {
|
|
173
|
+
return /* @__PURE__ */ jsx(CheckCircle, { fill: "neutral200" });
|
|
174
|
+
}
|
|
175
|
+
if (requiredStage && requiredStage.id !== entryStage?.id) {
|
|
176
|
+
return /* @__PURE__ */ jsx(CrossCircle, { fill: "danger600" });
|
|
177
|
+
}
|
|
178
|
+
return /* @__PURE__ */ jsx(CheckCircle, { fill: "success600" });
|
|
179
|
+
};
|
|
180
|
+
const getReviewStageMessage = ({
|
|
181
|
+
contentTypeHasReviewWorkflow,
|
|
182
|
+
requiredStage,
|
|
183
|
+
entryStage,
|
|
184
|
+
formatMessage
|
|
185
|
+
}) => {
|
|
186
|
+
if (!contentTypeHasReviewWorkflow) {
|
|
187
|
+
return formatMessage({
|
|
188
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.not-enabled",
|
|
189
|
+
defaultMessage: "This entry is not associated to any workflow."
|
|
190
|
+
});
|
|
191
|
+
}
|
|
192
|
+
if (requiredStage && requiredStage.id !== entryStage?.id) {
|
|
193
|
+
return formatMessage(
|
|
194
|
+
{
|
|
195
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.not-ready",
|
|
196
|
+
defaultMessage: "This entry is not at the required stage for publishing. ({stageName})"
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
stageName: requiredStage?.name ?? ""
|
|
200
|
+
}
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
if (requiredStage && requiredStage.id === entryStage?.id) {
|
|
204
|
+
return formatMessage(
|
|
205
|
+
{
|
|
206
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.ready",
|
|
207
|
+
defaultMessage: "This entry is at the required stage for publishing. ({stageName})"
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
stageName: requiredStage?.name ?? ""
|
|
211
|
+
}
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
return formatMessage({
|
|
215
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.stage-not-required",
|
|
216
|
+
defaultMessage: "No required stage for publication"
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
const ReviewStageValidation = ({
|
|
220
|
+
contentTypeHasReviewWorkflow,
|
|
221
|
+
requiredStage,
|
|
222
|
+
entryStage
|
|
223
|
+
}) => {
|
|
224
|
+
const { formatMessage } = useIntl();
|
|
225
|
+
const Icon = getReviewStageIcon({
|
|
226
|
+
contentTypeHasReviewWorkflow,
|
|
227
|
+
requiredStage,
|
|
228
|
+
entryStage
|
|
229
|
+
});
|
|
230
|
+
return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, width: "100%", padding: 5, children: [
|
|
231
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 2, width: "100%", children: [
|
|
232
|
+
/* @__PURE__ */ jsx(Typography, { fontWeight: "bold", children: formatMessage({
|
|
233
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage",
|
|
234
|
+
defaultMessage: "Review stage"
|
|
235
|
+
}) }),
|
|
236
|
+
Icon
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ jsx(Typography, { textColor: "neutral600", children: getReviewStageMessage({
|
|
239
|
+
contentTypeHasReviewWorkflow,
|
|
240
|
+
requiredStage,
|
|
241
|
+
entryStage,
|
|
242
|
+
formatMessage
|
|
243
|
+
}) })
|
|
244
|
+
] });
|
|
245
|
+
};
|
|
246
|
+
const EntryValidationPopover = ({
|
|
247
|
+
schema,
|
|
248
|
+
entry,
|
|
249
|
+
status,
|
|
250
|
+
action
|
|
251
|
+
}) => {
|
|
252
|
+
const { validate, isLoading } = unstable_useDocument(
|
|
253
|
+
{
|
|
254
|
+
collectionType: schema?.kind ?? "",
|
|
255
|
+
model: schema?.uid ?? ""
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
// useDocument makes a request to get more data about the entry, but we only want to have the validation function so we skip the request
|
|
259
|
+
skip: true
|
|
260
|
+
}
|
|
261
|
+
);
|
|
262
|
+
const errors = isLoading ? null : validate(entry);
|
|
263
|
+
const hasErrors = errors ? Object.keys(errors).length > 0 : false;
|
|
264
|
+
const contentTypeHasReviewWorkflow = schema?.hasReviewWorkflow ?? false;
|
|
265
|
+
const requiredStage = schema?.stageRequiredToPublish;
|
|
266
|
+
const entryStage = entry.strapi_stage;
|
|
267
|
+
if (isLoading) {
|
|
268
|
+
return null;
|
|
269
|
+
}
|
|
270
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { children: [
|
|
271
|
+
/* @__PURE__ */ jsx(
|
|
272
|
+
EntryStatusTrigger,
|
|
273
|
+
{
|
|
274
|
+
action,
|
|
275
|
+
status,
|
|
276
|
+
hasErrors,
|
|
277
|
+
requiredStage,
|
|
278
|
+
entryStage
|
|
279
|
+
}
|
|
280
|
+
),
|
|
281
|
+
/* @__PURE__ */ jsx(Popover.Content, { children: /* @__PURE__ */ jsxs(StyledPopoverFlex, { direction: "column", children: [
|
|
282
|
+
/* @__PURE__ */ jsx(
|
|
283
|
+
FieldsValidation,
|
|
284
|
+
{
|
|
285
|
+
hasErrors,
|
|
286
|
+
errors,
|
|
287
|
+
contentTypeUid: schema?.uid,
|
|
288
|
+
kind: schema?.kind,
|
|
289
|
+
documentId: entry.documentId,
|
|
290
|
+
locale: entry.locale
|
|
291
|
+
}
|
|
292
|
+
),
|
|
293
|
+
/* @__PURE__ */ jsx(
|
|
294
|
+
ReviewStageValidation,
|
|
295
|
+
{
|
|
296
|
+
contentTypeHasReviewWorkflow,
|
|
297
|
+
requiredStage,
|
|
298
|
+
entryStage
|
|
299
|
+
}
|
|
300
|
+
)
|
|
301
|
+
] }) })
|
|
302
|
+
] });
|
|
303
|
+
};
|
|
17
304
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
18
|
-
const RelativeTime = React.forwardRef(
|
|
305
|
+
const RelativeTime$1 = React.forwardRef(
|
|
19
306
|
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
|
20
307
|
const { formatRelativeTime, formatDate, formatTime } = useIntl();
|
|
21
308
|
const interval = intervalToDuration({
|
|
@@ -44,28 +331,9 @@ const RelativeTime = React.forwardRef(
|
|
|
44
331
|
);
|
|
45
332
|
}
|
|
46
333
|
);
|
|
47
|
-
const RELEASE_SCHEMA = yup.object().shape({
|
|
48
|
-
name: yup.string().trim().required(),
|
|
49
|
-
scheduledAt: yup.string().nullable(),
|
|
50
|
-
isScheduled: yup.boolean().optional(),
|
|
51
|
-
time: yup.string().when("isScheduled", {
|
|
52
|
-
is: true,
|
|
53
|
-
then: yup.string().trim().required(),
|
|
54
|
-
otherwise: yup.string().nullable()
|
|
55
|
-
}),
|
|
56
|
-
timezone: yup.string().when("isScheduled", {
|
|
57
|
-
is: true,
|
|
58
|
-
then: yup.string().required().nullable(),
|
|
59
|
-
otherwise: yup.string().nullable()
|
|
60
|
-
}),
|
|
61
|
-
date: yup.string().when("isScheduled", {
|
|
62
|
-
is: true,
|
|
63
|
-
then: yup.string().required().nullable(),
|
|
64
|
-
otherwise: yup.string().nullable()
|
|
65
|
-
})
|
|
66
|
-
}).required().noUnknown();
|
|
67
334
|
const ReleaseModal = ({
|
|
68
335
|
handleClose,
|
|
336
|
+
open,
|
|
69
337
|
handleSubmit,
|
|
70
338
|
initialValues,
|
|
71
339
|
isLoading = false
|
|
@@ -78,11 +346,9 @@ const ReleaseModal = ({
|
|
|
78
346
|
);
|
|
79
347
|
const getScheduledTimestamp = (values) => {
|
|
80
348
|
const { date, time, timezone } = values;
|
|
81
|
-
if (!date || !time || !timezone)
|
|
82
|
-
return null;
|
|
83
|
-
const formattedDate = parse(time, "HH:mm", new Date(date));
|
|
349
|
+
if (!date || !time || !timezone) return null;
|
|
84
350
|
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
85
|
-
return zonedTimeToUtc(
|
|
351
|
+
return zonedTimeToUtc(`${date} ${time}`, timezoneWithoutOffset);
|
|
86
352
|
};
|
|
87
353
|
const getTimezoneWithOffset = () => {
|
|
88
354
|
const currentTimezone = timezoneList.find(
|
|
@@ -90,8 +356,8 @@ const ReleaseModal = ({
|
|
|
90
356
|
);
|
|
91
357
|
return currentTimezone?.value || systemTimezone.value;
|
|
92
358
|
};
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
/* @__PURE__ */ jsx(
|
|
359
|
+
return /* @__PURE__ */ jsx(Modal.Root, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
|
|
360
|
+
/* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: formatMessage(
|
|
95
361
|
{
|
|
96
362
|
id: "content-releases.modal.title",
|
|
97
363
|
defaultMessage: "{isCreatingRelease, select, true {New release} other {Edit release}}"
|
|
@@ -114,133 +380,143 @@ const ReleaseModal = ({
|
|
|
114
380
|
},
|
|
115
381
|
validationSchema: RELEASE_SCHEMA,
|
|
116
382
|
validateOnChange: false,
|
|
117
|
-
children: ({ values, errors, handleChange, setFieldValue }) =>
|
|
118
|
-
|
|
119
|
-
/* @__PURE__ */ jsx(
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
defaultMessage:
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
setFieldValue("
|
|
143
|
-
|
|
144
|
-
} else {
|
|
145
|
-
setFieldValue("date", initialValues.date);
|
|
146
|
-
setFieldValue("time", initialValues.time);
|
|
147
|
-
setFieldValue("timezone", initialValues.timezone ?? systemTimezone?.value);
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
children: /* @__PURE__ */ jsx(
|
|
151
|
-
Typography,
|
|
152
|
-
{
|
|
153
|
-
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
154
|
-
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
155
|
-
children: formatMessage({
|
|
156
|
-
id: "modal.form.input.label.schedule-release",
|
|
157
|
-
defaultMessage: "Schedule release"
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
)
|
|
161
|
-
}
|
|
162
|
-
) }),
|
|
163
|
-
values.isScheduled && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
164
|
-
/* @__PURE__ */ jsxs(Flex, { gap: 4, alignItems: "start", children: [
|
|
165
|
-
/* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsx(
|
|
166
|
-
DatePicker,
|
|
167
|
-
{
|
|
168
|
-
label: formatMessage({
|
|
169
|
-
id: "content-releases.modal.form.input.label.date",
|
|
170
|
-
defaultMessage: "Date"
|
|
171
|
-
}),
|
|
172
|
-
name: "date",
|
|
173
|
-
error: errors.date,
|
|
174
|
-
onChange: (date) => {
|
|
175
|
-
const isoFormatDate = date ? formatISO(date, { representation: "date" }) : null;
|
|
176
|
-
setFieldValue("date", isoFormatDate);
|
|
177
|
-
},
|
|
178
|
-
clearLabel: formatMessage({
|
|
179
|
-
id: "content-releases.modal.form.input.clearLabel",
|
|
180
|
-
defaultMessage: "Clear"
|
|
181
|
-
}),
|
|
182
|
-
onClear: () => {
|
|
383
|
+
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
384
|
+
return /* @__PURE__ */ jsxs(Form, { children: [
|
|
385
|
+
/* @__PURE__ */ jsx(Modal.Body, { children: /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
386
|
+
/* @__PURE__ */ jsxs(
|
|
387
|
+
Field.Root,
|
|
388
|
+
{
|
|
389
|
+
name: "name",
|
|
390
|
+
error: errors.name && formatMessage({ id: errors.name, defaultMessage: errors.name }),
|
|
391
|
+
required: true,
|
|
392
|
+
children: [
|
|
393
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
394
|
+
id: "content-releases.modal.form.input.label.release-name",
|
|
395
|
+
defaultMessage: "Name"
|
|
396
|
+
}) }),
|
|
397
|
+
/* @__PURE__ */ jsx(TextInput, { value: values.name, onChange: handleChange }),
|
|
398
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
399
|
+
]
|
|
400
|
+
}
|
|
401
|
+
),
|
|
402
|
+
/* @__PURE__ */ jsx(Box, { width: "max-content", children: /* @__PURE__ */ jsx(
|
|
403
|
+
Checkbox,
|
|
404
|
+
{
|
|
405
|
+
name: "isScheduled",
|
|
406
|
+
checked: values.isScheduled,
|
|
407
|
+
onCheckedChange: (checked) => {
|
|
408
|
+
setFieldValue("isScheduled", checked);
|
|
409
|
+
if (!checked) {
|
|
183
410
|
setFieldValue("date", null);
|
|
184
|
-
},
|
|
185
|
-
selectedDate: values.date || void 0,
|
|
186
|
-
required: true,
|
|
187
|
-
minDate: utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
188
|
-
}
|
|
189
|
-
) }),
|
|
190
|
-
/* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsx(
|
|
191
|
-
TimePicker,
|
|
192
|
-
{
|
|
193
|
-
label: formatMessage({
|
|
194
|
-
id: "content-releases.modal.form.input.label.time",
|
|
195
|
-
defaultMessage: "Time"
|
|
196
|
-
}),
|
|
197
|
-
name: "time",
|
|
198
|
-
error: errors.time,
|
|
199
|
-
onChange: (time) => {
|
|
200
|
-
setFieldValue("time", time);
|
|
201
|
-
},
|
|
202
|
-
clearLabel: formatMessage({
|
|
203
|
-
id: "content-releases.modal.form.input.clearLabel",
|
|
204
|
-
defaultMessage: "Clear"
|
|
205
|
-
}),
|
|
206
|
-
onClear: () => {
|
|
207
411
|
setFieldValue("time", "");
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
412
|
+
setFieldValue("timezone", null);
|
|
413
|
+
} else {
|
|
414
|
+
setFieldValue("date", initialValues.date);
|
|
415
|
+
setFieldValue("time", initialValues.time);
|
|
416
|
+
setFieldValue(
|
|
417
|
+
"timezone",
|
|
418
|
+
initialValues.timezone ?? systemTimezone?.value
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
},
|
|
422
|
+
children: /* @__PURE__ */ jsx(
|
|
423
|
+
Typography,
|
|
424
|
+
{
|
|
425
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
426
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
427
|
+
children: formatMessage({
|
|
428
|
+
id: "modal.form.input.label.schedule-release",
|
|
429
|
+
defaultMessage: "Schedule release"
|
|
430
|
+
})
|
|
431
|
+
}
|
|
432
|
+
)
|
|
433
|
+
}
|
|
434
|
+
) }),
|
|
435
|
+
values.isScheduled && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
436
|
+
/* @__PURE__ */ jsxs(Flex, { gap: 4, alignItems: "start", children: [
|
|
437
|
+
/* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(
|
|
438
|
+
Field.Root,
|
|
439
|
+
{
|
|
440
|
+
name: "date",
|
|
441
|
+
error: errors.date && formatMessage({ id: errors.date, defaultMessage: errors.date }),
|
|
442
|
+
required: true,
|
|
443
|
+
children: [
|
|
444
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
445
|
+
id: "content-releases.modal.form.input.label.date",
|
|
446
|
+
defaultMessage: "Date"
|
|
447
|
+
}) }),
|
|
448
|
+
/* @__PURE__ */ jsx(
|
|
449
|
+
DatePicker,
|
|
450
|
+
{
|
|
451
|
+
onChange: (date) => {
|
|
452
|
+
const isoFormatDate = date ? formatISO(date, { representation: "date" }) : null;
|
|
453
|
+
setFieldValue("date", isoFormatDate);
|
|
454
|
+
},
|
|
455
|
+
clearLabel: formatMessage({
|
|
456
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
457
|
+
defaultMessage: "Clear"
|
|
458
|
+
}),
|
|
459
|
+
onClear: () => {
|
|
460
|
+
setFieldValue("date", null);
|
|
461
|
+
},
|
|
462
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
463
|
+
minDate: utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
464
|
+
}
|
|
465
|
+
),
|
|
466
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
467
|
+
]
|
|
468
|
+
}
|
|
469
|
+
) }),
|
|
470
|
+
/* @__PURE__ */ jsx(Box, { width: "100%", children: /* @__PURE__ */ jsxs(
|
|
471
|
+
Field.Root,
|
|
472
|
+
{
|
|
473
|
+
name: "time",
|
|
474
|
+
error: errors.time && formatMessage({ id: errors.time, defaultMessage: errors.time }),
|
|
475
|
+
required: true,
|
|
476
|
+
children: [
|
|
477
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
478
|
+
id: "content-releases.modal.form.input.label.time",
|
|
479
|
+
defaultMessage: "Time"
|
|
480
|
+
}) }),
|
|
481
|
+
/* @__PURE__ */ jsx(
|
|
482
|
+
TimePicker,
|
|
483
|
+
{
|
|
484
|
+
onChange: (time) => {
|
|
485
|
+
setFieldValue("time", time);
|
|
486
|
+
},
|
|
487
|
+
clearLabel: formatMessage({
|
|
488
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
489
|
+
defaultMessage: "Clear"
|
|
490
|
+
}),
|
|
491
|
+
onClear: () => {
|
|
492
|
+
setFieldValue("time", "");
|
|
493
|
+
},
|
|
494
|
+
value: values.time || void 0
|
|
495
|
+
}
|
|
496
|
+
),
|
|
497
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
498
|
+
]
|
|
499
|
+
}
|
|
500
|
+
) })
|
|
501
|
+
] }),
|
|
502
|
+
/* @__PURE__ */ jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
503
|
+
] })
|
|
504
|
+
] }) }),
|
|
505
|
+
/* @__PURE__ */ jsxs(Modal.Footer, { children: [
|
|
506
|
+
/* @__PURE__ */ jsx(Modal.Close, { children: /* @__PURE__ */ jsx(Button, { variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }) }),
|
|
507
|
+
/* @__PURE__ */ jsx(Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
222
508
|
{
|
|
223
509
|
id: "content-releases.modal.form.button.submit",
|
|
224
510
|
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
225
511
|
},
|
|
226
512
|
{ isCreatingRelease }
|
|
227
513
|
) })
|
|
228
|
-
}
|
|
229
|
-
)
|
|
230
|
-
|
|
514
|
+
] })
|
|
515
|
+
] });
|
|
516
|
+
}
|
|
231
517
|
}
|
|
232
518
|
)
|
|
233
|
-
] });
|
|
234
|
-
};
|
|
235
|
-
const getTimezones = (selectedDate) => {
|
|
236
|
-
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
237
|
-
const utcOffset = getTimezoneOffset(timezone, selectedDate);
|
|
238
|
-
return { offset: utcOffset, value: `${utcOffset}&${timezone}` };
|
|
239
|
-
});
|
|
240
|
-
const systemTimezone = timezoneList.find(
|
|
241
|
-
(timezone) => timezone.value.split("&")[1] === Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
242
|
-
);
|
|
243
|
-
return { timezoneList, systemTimezone };
|
|
519
|
+
] }) });
|
|
244
520
|
};
|
|
245
521
|
const TimezoneComponent = ({ timezoneOptions }) => {
|
|
246
522
|
const { values, errors, setFieldValue } = useFormikContext();
|
|
@@ -256,38 +532,52 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
256
532
|
}
|
|
257
533
|
}
|
|
258
534
|
}, [setFieldValue, values.date, values.timezone]);
|
|
259
|
-
return /* @__PURE__ */
|
|
260
|
-
|
|
535
|
+
return /* @__PURE__ */ jsxs(
|
|
536
|
+
Field.Root,
|
|
261
537
|
{
|
|
262
|
-
label: formatMessage({
|
|
263
|
-
id: "content-releases.modal.form.input.label.timezone",
|
|
264
|
-
defaultMessage: "Timezone"
|
|
265
|
-
}),
|
|
266
|
-
autocomplete: { type: "list", filter: "contains" },
|
|
267
538
|
name: "timezone",
|
|
268
|
-
|
|
269
|
-
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
270
|
-
onChange: (timezone) => {
|
|
271
|
-
setFieldValue("timezone", timezone);
|
|
272
|
-
},
|
|
273
|
-
onTextValueChange: (timezone) => {
|
|
274
|
-
setFieldValue("timezone", timezone);
|
|
275
|
-
},
|
|
276
|
-
onClear: () => {
|
|
277
|
-
setFieldValue("timezone", "");
|
|
278
|
-
},
|
|
279
|
-
error: errors.timezone,
|
|
539
|
+
error: errors.timezone && formatMessage({ id: errors.timezone, defaultMessage: errors.timezone }),
|
|
280
540
|
required: true,
|
|
281
|
-
children:
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
|
543
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
544
|
+
defaultMessage: "Timezone"
|
|
545
|
+
}) }),
|
|
546
|
+
/* @__PURE__ */ jsx(
|
|
547
|
+
Combobox,
|
|
548
|
+
{
|
|
549
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
550
|
+
value: values.timezone || void 0,
|
|
551
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
552
|
+
onChange: (timezone) => {
|
|
553
|
+
setFieldValue("timezone", timezone);
|
|
554
|
+
},
|
|
555
|
+
onTextValueChange: (timezone) => {
|
|
556
|
+
setFieldValue("timezone", timezone);
|
|
557
|
+
},
|
|
558
|
+
onClear: () => {
|
|
559
|
+
setFieldValue("timezone", "");
|
|
560
|
+
},
|
|
561
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsx(ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
562
|
+
}
|
|
563
|
+
),
|
|
564
|
+
/* @__PURE__ */ jsx(Field.Error, {})
|
|
565
|
+
]
|
|
282
566
|
}
|
|
283
567
|
);
|
|
284
568
|
};
|
|
285
569
|
const useTypedDispatch = useDispatch;
|
|
286
|
-
const
|
|
570
|
+
const isBaseQueryError = (error) => {
|
|
571
|
+
return typeof error !== "undefined" && error.name !== void 0;
|
|
572
|
+
};
|
|
573
|
+
const LinkCard = styled(Link$1)`
|
|
287
574
|
display: block;
|
|
288
575
|
`;
|
|
289
|
-
const
|
|
290
|
-
|
|
576
|
+
const RelativeTime = styled(RelativeTime$1)`
|
|
577
|
+
display: inline-block;
|
|
578
|
+
&::first-letter {
|
|
579
|
+
text-transform: uppercase;
|
|
580
|
+
}
|
|
291
581
|
`;
|
|
292
582
|
const getBadgeProps = (status) => {
|
|
293
583
|
let color;
|
|
@@ -332,11 +622,11 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
332
622
|
target: sectionTitle
|
|
333
623
|
}
|
|
334
624
|
),
|
|
335
|
-
icon: /* @__PURE__ */ jsx(EmptyDocuments, { width: "
|
|
625
|
+
icon: /* @__PURE__ */ jsx(EmptyDocuments, { width: "16rem" })
|
|
336
626
|
}
|
|
337
627
|
);
|
|
338
628
|
}
|
|
339
|
-
return /* @__PURE__ */ jsx(Grid, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsx(
|
|
629
|
+
return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsx(Grid.Item, { col: 3, s: 6, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(LinkCard, { tag: NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxs(
|
|
340
630
|
Flex,
|
|
341
631
|
{
|
|
342
632
|
direction: "column",
|
|
@@ -351,8 +641,8 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
351
641
|
gap: 4,
|
|
352
642
|
children: [
|
|
353
643
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "start", gap: 1, children: [
|
|
354
|
-
/* @__PURE__ */ jsx(Typography, {
|
|
355
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsx(
|
|
644
|
+
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", tag: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
645
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
356
646
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
357
647
|
defaultMessage: "Not scheduled"
|
|
358
648
|
}) })
|
|
@@ -372,14 +662,13 @@ const StyledAlert = styled(Alert)`
|
|
|
372
662
|
`;
|
|
373
663
|
const INITIAL_FORM_VALUES = {
|
|
374
664
|
name: "",
|
|
375
|
-
date:
|
|
665
|
+
date: format(/* @__PURE__ */ new Date(), "yyyy-MM-dd"),
|
|
376
666
|
time: "",
|
|
377
667
|
isScheduled: true,
|
|
378
668
|
scheduledAt: null,
|
|
379
669
|
timezone: null
|
|
380
670
|
};
|
|
381
671
|
const ReleasesPage = () => {
|
|
382
|
-
const tabRef = React.useRef(null);
|
|
383
672
|
const location = useLocation();
|
|
384
673
|
const [releaseModalShown, setReleaseModalShown] = React.useState(false);
|
|
385
674
|
const { toggleNotification } = useNotification();
|
|
@@ -388,6 +677,7 @@ const ReleasesPage = () => {
|
|
|
388
677
|
const { formatAPIError } = useAPIErrorHandler();
|
|
389
678
|
const [{ query }, setQuery] = useQueryParams();
|
|
390
679
|
const response = useGetReleasesQuery(query);
|
|
680
|
+
const { data, isLoading: isLoadingSettings } = useGetReleaseSettingsQuery();
|
|
391
681
|
const [createRelease, { isLoading: isSubmittingForm }] = useCreateReleaseMutation();
|
|
392
682
|
const { getFeature } = useLicenseLimits();
|
|
393
683
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
@@ -395,9 +685,8 @@ const ReleasesPage = () => {
|
|
|
395
685
|
const {
|
|
396
686
|
allowedActions: { canCreate }
|
|
397
687
|
} = useRBAC(PERMISSIONS);
|
|
398
|
-
const { isLoading, isSuccess, isError } = response;
|
|
688
|
+
const { isLoading: isLoadingReleases, isSuccess, isError } = response;
|
|
399
689
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
400
|
-
const activeTabIndex = ["pending", "done"].indexOf(activeTab);
|
|
401
690
|
React.useEffect(() => {
|
|
402
691
|
if (location?.state?.errors) {
|
|
403
692
|
toggleNotification({
|
|
@@ -414,27 +703,22 @@ const ReleasesPage = () => {
|
|
|
414
703
|
navigate("", { replace: true, state: null });
|
|
415
704
|
}
|
|
416
705
|
}, [formatMessage, location?.state?.errors, navigate, toggleNotification]);
|
|
417
|
-
React.useEffect(() => {
|
|
418
|
-
if (tabRef.current) {
|
|
419
|
-
tabRef.current._handlers.setSelectedTabIndex(activeTabIndex);
|
|
420
|
-
}
|
|
421
|
-
}, [activeTabIndex]);
|
|
422
706
|
const toggleAddReleaseModal = () => {
|
|
423
707
|
setReleaseModalShown((prev) => !prev);
|
|
424
708
|
};
|
|
425
|
-
if (
|
|
709
|
+
if (isLoadingReleases || isLoadingSettings) {
|
|
426
710
|
return /* @__PURE__ */ jsx(Page.Loading, {});
|
|
427
711
|
}
|
|
428
712
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
429
713
|
const hasReachedMaximumPendingReleases = totalPendingReleases >= maximumReleases;
|
|
430
|
-
const handleTabChange = (
|
|
714
|
+
const handleTabChange = (tabValue) => {
|
|
431
715
|
setQuery({
|
|
432
716
|
...query,
|
|
433
717
|
page: 1,
|
|
434
718
|
pageSize: response?.currentData?.meta?.pagination?.pageSize || 16,
|
|
435
719
|
filters: {
|
|
436
720
|
releasedAt: {
|
|
437
|
-
$notNull:
|
|
721
|
+
$notNull: tabValue !== "pending"
|
|
438
722
|
}
|
|
439
723
|
}
|
|
440
724
|
});
|
|
@@ -455,7 +739,7 @@ const ReleasesPage = () => {
|
|
|
455
739
|
});
|
|
456
740
|
trackUsage("didCreateRelease");
|
|
457
741
|
navigate(response2.data.data.id.toString());
|
|
458
|
-
} else if (
|
|
742
|
+
} else if (isFetchError(response2.error)) {
|
|
459
743
|
toggleNotification({
|
|
460
744
|
type: "danger",
|
|
461
745
|
message: formatAPIError(response2.error)
|
|
@@ -467,9 +751,9 @@ const ReleasesPage = () => {
|
|
|
467
751
|
});
|
|
468
752
|
}
|
|
469
753
|
};
|
|
470
|
-
return /* @__PURE__ */ jsxs(Main, { "aria-busy":
|
|
754
|
+
return /* @__PURE__ */ jsxs(Main, { "aria-busy": isLoadingReleases || isLoadingSettings, children: [
|
|
471
755
|
/* @__PURE__ */ jsx(
|
|
472
|
-
|
|
756
|
+
Layouts.Header,
|
|
473
757
|
{
|
|
474
758
|
title: formatMessage({
|
|
475
759
|
id: "content-releases.pages.Releases.title",
|
|
@@ -493,12 +777,12 @@ const ReleasesPage = () => {
|
|
|
493
777
|
) : null
|
|
494
778
|
}
|
|
495
779
|
),
|
|
496
|
-
/* @__PURE__ */ jsx(
|
|
780
|
+
/* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
497
781
|
hasReachedMaximumPendingReleases && /* @__PURE__ */ jsx(
|
|
498
782
|
StyledAlert,
|
|
499
783
|
{
|
|
500
784
|
marginBottom: 6,
|
|
501
|
-
action: /* @__PURE__ */ jsx(Link, { href: "https://strapi.io/pricing-cloud", isExternal: true, children: formatMessage({
|
|
785
|
+
action: /* @__PURE__ */ jsx(Link$1, { href: "https://strapi.io/pricing-cloud", isExternal: true, children: formatMessage({
|
|
502
786
|
id: "content-releases.pages.Releases.max-limit-reached.action",
|
|
503
787
|
defaultMessage: "Explore plans"
|
|
504
788
|
}) }),
|
|
@@ -518,21 +802,17 @@ const ReleasesPage = () => {
|
|
|
518
802
|
})
|
|
519
803
|
}
|
|
520
804
|
),
|
|
521
|
-
/* @__PURE__ */ jsxs(
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
children: [
|
|
533
|
-
/* @__PURE__ */ jsxs(Box, { paddingBottom: 8, children: [
|
|
534
|
-
/* @__PURE__ */ jsxs(Tabs, { children: [
|
|
535
|
-
/* @__PURE__ */ jsx(Tab, { children: formatMessage(
|
|
805
|
+
/* @__PURE__ */ jsxs(Tabs.Root, { variant: "simple", onValueChange: handleTabChange, value: activeTab, children: [
|
|
806
|
+
/* @__PURE__ */ jsxs(Box, { paddingBottom: 8, children: [
|
|
807
|
+
/* @__PURE__ */ jsxs(
|
|
808
|
+
Tabs.List,
|
|
809
|
+
{
|
|
810
|
+
"aria-label": formatMessage({
|
|
811
|
+
id: "content-releases.pages.Releases.tab-group.label",
|
|
812
|
+
defaultMessage: "Releases list"
|
|
813
|
+
}),
|
|
814
|
+
children: [
|
|
815
|
+
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "pending", children: formatMessage(
|
|
536
816
|
{
|
|
537
817
|
id: "content-releases.pages.Releases.tab.pending",
|
|
538
818
|
defaultMessage: "Pending ({count})"
|
|
@@ -541,34 +821,32 @@ const ReleasesPage = () => {
|
|
|
541
821
|
count: totalPendingReleases
|
|
542
822
|
}
|
|
543
823
|
) }),
|
|
544
|
-
/* @__PURE__ */ jsx(
|
|
824
|
+
/* @__PURE__ */ jsx(Tabs.Trigger, { value: "done", children: formatMessage({
|
|
545
825
|
id: "content-releases.pages.Releases.tab.done",
|
|
546
826
|
defaultMessage: "Done"
|
|
547
827
|
}) })
|
|
548
|
-
]
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
}
|
|
571
|
-
),
|
|
828
|
+
]
|
|
829
|
+
}
|
|
830
|
+
),
|
|
831
|
+
/* @__PURE__ */ jsx(Divider, {})
|
|
832
|
+
] }),
|
|
833
|
+
/* @__PURE__ */ jsx(Tabs.Content, { value: "pending", children: /* @__PURE__ */ jsx(
|
|
834
|
+
ReleasesGrid,
|
|
835
|
+
{
|
|
836
|
+
sectionTitle: "pending",
|
|
837
|
+
releases: response?.currentData?.data,
|
|
838
|
+
isError
|
|
839
|
+
}
|
|
840
|
+
) }),
|
|
841
|
+
/* @__PURE__ */ jsx(Tabs.Content, { value: "done", children: /* @__PURE__ */ jsx(
|
|
842
|
+
ReleasesGrid,
|
|
843
|
+
{
|
|
844
|
+
sectionTitle: "done",
|
|
845
|
+
releases: response?.currentData?.data,
|
|
846
|
+
isError
|
|
847
|
+
}
|
|
848
|
+
) })
|
|
849
|
+
] }),
|
|
572
850
|
/* @__PURE__ */ jsxs(
|
|
573
851
|
Pagination.Root,
|
|
574
852
|
{
|
|
@@ -581,13 +859,17 @@ const ReleasesPage = () => {
|
|
|
581
859
|
}
|
|
582
860
|
)
|
|
583
861
|
] }) }),
|
|
584
|
-
|
|
862
|
+
/* @__PURE__ */ jsx(
|
|
585
863
|
ReleaseModal,
|
|
586
864
|
{
|
|
865
|
+
open: releaseModalShown,
|
|
587
866
|
handleClose: toggleAddReleaseModal,
|
|
588
867
|
handleSubmit: handleAddRelease,
|
|
589
868
|
isLoading: isSubmittingForm,
|
|
590
|
-
initialValues:
|
|
869
|
+
initialValues: {
|
|
870
|
+
...INITIAL_FORM_VALUES,
|
|
871
|
+
timezone: data?.data.defaultTimezone ? data.data.defaultTimezone.split("&")[1] : null
|
|
872
|
+
}
|
|
591
873
|
}
|
|
592
874
|
)
|
|
593
875
|
] });
|
|
@@ -598,7 +880,7 @@ const ReleaseInfoWrapper = styled(Flex)`
|
|
|
598
880
|
border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
|
|
599
881
|
border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
600
882
|
`;
|
|
601
|
-
const StyledMenuItem = styled(
|
|
883
|
+
const StyledMenuItem = styled(MenuItem)`
|
|
602
884
|
svg path {
|
|
603
885
|
fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
|
|
604
886
|
}
|
|
@@ -607,73 +889,23 @@ const StyledMenuItem = styled(Menu.Item)`
|
|
|
607
889
|
}
|
|
608
890
|
|
|
609
891
|
&:hover {
|
|
610
|
-
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
892
|
+
background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
|
|
611
893
|
}
|
|
612
894
|
`;
|
|
613
895
|
const PencilIcon = styled(Pencil)`
|
|
614
|
-
width: ${({ theme }) => theme.spaces[
|
|
615
|
-
height: ${({ theme }) => theme.spaces[
|
|
896
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
897
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
616
898
|
path {
|
|
617
899
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
618
900
|
}
|
|
619
901
|
`;
|
|
620
902
|
const TrashIcon = styled(Trash)`
|
|
621
|
-
width: ${({ theme }) => theme.spaces[
|
|
622
|
-
height: ${({ theme }) => theme.spaces[
|
|
903
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
904
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
623
905
|
path {
|
|
624
906
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
625
907
|
}
|
|
626
908
|
`;
|
|
627
|
-
const TypographyMaxWidth = styled(Typography)`
|
|
628
|
-
max-width: 300px;
|
|
629
|
-
`;
|
|
630
|
-
const EntryValidationText = ({ action, schema, entry }) => {
|
|
631
|
-
const { formatMessage } = useIntl();
|
|
632
|
-
const { validate } = unstable_useDocument(
|
|
633
|
-
{
|
|
634
|
-
collectionType: schema?.kind ?? "",
|
|
635
|
-
model: schema?.uid ?? ""
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
skip: !schema
|
|
639
|
-
}
|
|
640
|
-
);
|
|
641
|
-
const errors = validate(entry) ?? {};
|
|
642
|
-
if (Object.keys(errors).length > 0) {
|
|
643
|
-
const validationErrorsMessages = Object.entries(errors).map(
|
|
644
|
-
([key, value]) => formatMessage(
|
|
645
|
-
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
646
|
-
{ field: key }
|
|
647
|
-
)
|
|
648
|
-
).join(" ");
|
|
649
|
-
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
650
|
-
/* @__PURE__ */ jsx(Icon, { color: "danger600", as: CrossCircle }),
|
|
651
|
-
/* @__PURE__ */ jsx(Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsx(TypographyMaxWidth, { textColor: "danger600", variant: "omega", fontWeight: "semiBold", ellipsis: true, children: validationErrorsMessages }) })
|
|
652
|
-
] });
|
|
653
|
-
}
|
|
654
|
-
if (action == "publish") {
|
|
655
|
-
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
656
|
-
/* @__PURE__ */ jsx(Icon, { color: "success600", as: CheckCircle }),
|
|
657
|
-
entry.publishedAt ? /* @__PURE__ */ jsx(Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
658
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
659
|
-
defaultMessage: "Already published"
|
|
660
|
-
}) }) : /* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
|
661
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
662
|
-
defaultMessage: "Ready to publish"
|
|
663
|
-
}) })
|
|
664
|
-
] });
|
|
665
|
-
}
|
|
666
|
-
return /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
667
|
-
/* @__PURE__ */ jsx(Icon, { color: "success600", as: CheckCircle }),
|
|
668
|
-
!entry.publishedAt ? /* @__PURE__ */ jsx(Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
669
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
670
|
-
defaultMessage: "Already unpublished"
|
|
671
|
-
}) }) : /* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
|
672
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-unpublish",
|
|
673
|
-
defaultMessage: "Ready to unpublish"
|
|
674
|
-
}) })
|
|
675
|
-
] });
|
|
676
|
-
};
|
|
677
909
|
const ReleaseDetailsLayout = ({
|
|
678
910
|
toggleEditReleaseModal,
|
|
679
911
|
toggleWarningSubmit,
|
|
@@ -684,7 +916,6 @@ const ReleaseDetailsLayout = ({
|
|
|
684
916
|
const {
|
|
685
917
|
data,
|
|
686
918
|
isLoading: isLoadingDetails,
|
|
687
|
-
isError,
|
|
688
919
|
error
|
|
689
920
|
} = useGetReleaseQuery(
|
|
690
921
|
{ id: releaseId },
|
|
@@ -716,7 +947,7 @@ const ReleaseDetailsLayout = ({
|
|
|
716
947
|
totalPublishedEntries,
|
|
717
948
|
totalUnpublishedEntries
|
|
718
949
|
});
|
|
719
|
-
} else if (
|
|
950
|
+
} else if (isFetchError(response.error)) {
|
|
720
951
|
toggleNotification({
|
|
721
952
|
type: "danger",
|
|
722
953
|
message: formatAPIError(response.error)
|
|
@@ -751,7 +982,7 @@ const ReleaseDetailsLayout = ({
|
|
|
751
982
|
if (isLoadingDetails) {
|
|
752
983
|
return /* @__PURE__ */ jsx(Page.Loading, {});
|
|
753
984
|
}
|
|
754
|
-
if (
|
|
985
|
+
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
755
986
|
return /* @__PURE__ */ jsx(
|
|
756
987
|
Navigate,
|
|
757
988
|
{
|
|
@@ -759,6 +990,7 @@ const ReleaseDetailsLayout = ({
|
|
|
759
990
|
state: {
|
|
760
991
|
errors: [
|
|
761
992
|
{
|
|
993
|
+
// @ts-expect-error – TODO: fix this weird error flow
|
|
762
994
|
code: error?.code
|
|
763
995
|
}
|
|
764
996
|
]
|
|
@@ -798,93 +1030,80 @@ const ReleaseDetailsLayout = ({
|
|
|
798
1030
|
) : "";
|
|
799
1031
|
return /* @__PURE__ */ jsxs(Main, { "aria-busy": isLoadingDetails, children: [
|
|
800
1032
|
/* @__PURE__ */ jsx(
|
|
801
|
-
|
|
1033
|
+
Layouts.Header,
|
|
802
1034
|
{
|
|
803
1035
|
title: release.name,
|
|
804
1036
|
subtitle: /* @__PURE__ */ jsxs(Flex, { gap: 2, lineHeight: 6, children: [
|
|
805
1037
|
/* @__PURE__ */ jsx(Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (isScheduled ? ` - ${scheduledText}` : "") }),
|
|
806
1038
|
/* @__PURE__ */ jsx(Badge, { ...getBadgeProps(release.status), children: release.status })
|
|
807
1039
|
] }),
|
|
808
|
-
navigationAction: /* @__PURE__ */ jsx(BackButton, {}),
|
|
1040
|
+
navigationAction: /* @__PURE__ */ jsx(BackButton, { fallback: ".." }),
|
|
809
1041
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
|
810
|
-
/* @__PURE__ */ jsxs(
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
{
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
1042
|
+
/* @__PURE__ */ jsxs(
|
|
1043
|
+
SimpleMenuButton,
|
|
1044
|
+
{
|
|
1045
|
+
label: /* @__PURE__ */ jsx(More, {}),
|
|
1046
|
+
variant: "tertiary",
|
|
1047
|
+
endIcon: null,
|
|
1048
|
+
paddingLeft: "7px",
|
|
1049
|
+
paddingRight: "7px",
|
|
1050
|
+
"aria-label": formatMessage({
|
|
1051
|
+
id: "content-releases.header.actions.open-release-actions",
|
|
1052
|
+
defaultMessage: "Release edit and delete menu"
|
|
1053
|
+
}),
|
|
1054
|
+
popoverPlacement: "bottom-end",
|
|
1055
|
+
children: [
|
|
1056
|
+
/* @__PURE__ */ jsx(StyledMenuItem, { disabled: !canUpdate, onSelect: toggleEditReleaseModal, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
1057
|
+
/* @__PURE__ */ jsx(PencilIcon, {}),
|
|
1058
|
+
/* @__PURE__ */ jsx(Typography, { ellipsis: true, children: formatMessage({
|
|
1059
|
+
id: "content-releases.header.actions.edit",
|
|
1060
|
+
defaultMessage: "Edit"
|
|
1061
|
+
}) })
|
|
1062
|
+
] }) }),
|
|
1063
|
+
/* @__PURE__ */ jsx(
|
|
1064
|
+
StyledMenuItem,
|
|
1065
|
+
{
|
|
1066
|
+
disabled: !canDelete,
|
|
1067
|
+
onSelect: toggleWarningSubmit,
|
|
1068
|
+
$variant: "danger",
|
|
1069
|
+
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
1070
|
+
/* @__PURE__ */ jsx(TrashIcon, {}),
|
|
1071
|
+
/* @__PURE__ */ jsx(Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
1072
|
+
id: "content-releases.header.actions.delete",
|
|
1073
|
+
defaultMessage: "Delete"
|
|
840
1074
|
}) })
|
|
841
|
-
] }) }),
|
|
842
|
-
/* @__PURE__ */ jsx(
|
|
843
|
-
StyledMenuItem,
|
|
844
|
-
{
|
|
845
|
-
disabled: !canDelete,
|
|
846
|
-
onSelect: toggleWarningSubmit,
|
|
847
|
-
variant: "danger",
|
|
848
|
-
children: /* @__PURE__ */ jsxs(Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
849
|
-
/* @__PURE__ */ jsx(TrashIcon, {}),
|
|
850
|
-
/* @__PURE__ */ jsx(Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
851
|
-
id: "content-releases.header.actions.delete",
|
|
852
|
-
defaultMessage: "Delete"
|
|
853
|
-
}) })
|
|
854
|
-
] })
|
|
855
|
-
}
|
|
856
|
-
)
|
|
857
|
-
]
|
|
858
|
-
}
|
|
859
|
-
),
|
|
860
|
-
/* @__PURE__ */ jsxs(
|
|
861
|
-
ReleaseInfoWrapper,
|
|
862
|
-
{
|
|
863
|
-
direction: "column",
|
|
864
|
-
justifyContent: "center",
|
|
865
|
-
alignItems: "flex-start",
|
|
866
|
-
gap: 1,
|
|
867
|
-
padding: 5,
|
|
868
|
-
children: [
|
|
869
|
-
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
870
|
-
id: "content-releases.header.actions.created",
|
|
871
|
-
defaultMessage: "Created"
|
|
872
|
-
}) }),
|
|
873
|
-
/* @__PURE__ */ jsxs(Typography, { variant: "pi", color: "neutral300", children: [
|
|
874
|
-
/* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
875
|
-
formatMessage(
|
|
876
|
-
{
|
|
877
|
-
id: "content-releases.header.actions.created.description",
|
|
878
|
-
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
879
|
-
},
|
|
880
|
-
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
881
|
-
)
|
|
882
1075
|
] })
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
1076
|
+
}
|
|
1077
|
+
),
|
|
1078
|
+
/* @__PURE__ */ jsxs(
|
|
1079
|
+
ReleaseInfoWrapper,
|
|
1080
|
+
{
|
|
1081
|
+
direction: "column",
|
|
1082
|
+
justifyContent: "center",
|
|
1083
|
+
alignItems: "flex-start",
|
|
1084
|
+
gap: 1,
|
|
1085
|
+
padding: 4,
|
|
1086
|
+
children: [
|
|
1087
|
+
/* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
1088
|
+
id: "content-releases.header.actions.created",
|
|
1089
|
+
defaultMessage: "Created"
|
|
1090
|
+
}) }),
|
|
1091
|
+
/* @__PURE__ */ jsxs(Typography, { variant: "pi", color: "neutral300", children: [
|
|
1092
|
+
/* @__PURE__ */ jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
1093
|
+
formatMessage(
|
|
1094
|
+
{
|
|
1095
|
+
id: "content-releases.header.actions.created.description",
|
|
1096
|
+
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
1097
|
+
},
|
|
1098
|
+
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
1099
|
+
)
|
|
1100
|
+
] })
|
|
1101
|
+
]
|
|
1102
|
+
}
|
|
1103
|
+
)
|
|
1104
|
+
]
|
|
1105
|
+
}
|
|
1106
|
+
),
|
|
888
1107
|
/* @__PURE__ */ jsx(Button, { size: "S", variant: "tertiary", onClick: handleRefresh, children: formatMessage({
|
|
889
1108
|
id: "content-releases.header.actions.refresh",
|
|
890
1109
|
defaultMessage: "Refresh"
|
|
@@ -909,7 +1128,13 @@ const ReleaseDetailsLayout = ({
|
|
|
909
1128
|
children
|
|
910
1129
|
] });
|
|
911
1130
|
};
|
|
1131
|
+
const SimpleMenuButton = styled(SimpleMenu)`
|
|
1132
|
+
& > span {
|
|
1133
|
+
display: flex;
|
|
1134
|
+
}
|
|
1135
|
+
`;
|
|
912
1136
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
1137
|
+
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
913
1138
|
const getGroupByOptionLabel = (value) => {
|
|
914
1139
|
if (value === "locale") {
|
|
915
1140
|
return {
|
|
@@ -936,12 +1161,24 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
936
1161
|
const {
|
|
937
1162
|
data: releaseData,
|
|
938
1163
|
isLoading: isReleaseLoading,
|
|
939
|
-
isError: isReleaseError,
|
|
940
1164
|
error: releaseError
|
|
941
1165
|
} = useGetReleaseQuery({ id: releaseId });
|
|
942
1166
|
const {
|
|
943
1167
|
allowedActions: { canUpdate }
|
|
944
1168
|
} = useRBAC(PERMISSIONS);
|
|
1169
|
+
const runHookWaterfall = useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
1170
|
+
const { displayedHeaders, hasI18nEnabled } = runHookWaterfall("ContentReleases/pages/ReleaseDetails/add-locale-in-releases", {
|
|
1171
|
+
displayedHeaders: [
|
|
1172
|
+
{
|
|
1173
|
+
label: {
|
|
1174
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1175
|
+
defaultMessage: "name"
|
|
1176
|
+
},
|
|
1177
|
+
name: "name"
|
|
1178
|
+
}
|
|
1179
|
+
],
|
|
1180
|
+
hasI18nEnabled: false
|
|
1181
|
+
});
|
|
945
1182
|
const release = releaseData?.data;
|
|
946
1183
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
947
1184
|
const {
|
|
@@ -970,7 +1207,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
970
1207
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
971
1208
|
});
|
|
972
1209
|
if ("error" in response) {
|
|
973
|
-
if (
|
|
1210
|
+
if (isFetchError(response.error)) {
|
|
974
1211
|
toggleNotification({
|
|
975
1212
|
type: "danger",
|
|
976
1213
|
message: formatAPIError(response.error)
|
|
@@ -989,15 +1226,15 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
989
1226
|
const releaseActions = data?.data;
|
|
990
1227
|
const releaseMeta = data?.meta;
|
|
991
1228
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
992
|
-
|
|
993
|
-
if (
|
|
1229
|
+
releaseMeta?.components || {};
|
|
1230
|
+
if (isBaseQueryError(releaseError) || !release) {
|
|
994
1231
|
const errorsArray = [];
|
|
995
|
-
if (releaseError) {
|
|
1232
|
+
if (releaseError && "code" in releaseError) {
|
|
996
1233
|
errorsArray.push({
|
|
997
1234
|
code: releaseError.code
|
|
998
1235
|
});
|
|
999
1236
|
}
|
|
1000
|
-
if (releaseActionsError) {
|
|
1237
|
+
if (releaseActionsError && "code" in releaseActionsError) {
|
|
1001
1238
|
errorsArray.push({
|
|
1002
1239
|
code: releaseActionsError.code
|
|
1003
1240
|
});
|
|
@@ -1016,13 +1253,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1016
1253
|
return /* @__PURE__ */ jsx(Page.Error, {});
|
|
1017
1254
|
}
|
|
1018
1255
|
if (Object.keys(releaseActions).length === 0) {
|
|
1019
|
-
return /* @__PURE__ */ jsx(
|
|
1256
|
+
return /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsx(
|
|
1020
1257
|
EmptyStateLayout,
|
|
1021
1258
|
{
|
|
1022
1259
|
action: /* @__PURE__ */ jsx(
|
|
1023
1260
|
LinkButton,
|
|
1024
1261
|
{
|
|
1025
|
-
|
|
1262
|
+
tag: Link,
|
|
1026
1263
|
to: {
|
|
1027
1264
|
pathname: "/content-manager"
|
|
1028
1265
|
},
|
|
@@ -1034,7 +1271,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1034
1271
|
})
|
|
1035
1272
|
}
|
|
1036
1273
|
),
|
|
1037
|
-
icon: /* @__PURE__ */ jsx(EmptyDocuments, { width: "
|
|
1274
|
+
icon: /* @__PURE__ */ jsx(EmptyDocuments, { width: "16rem" }),
|
|
1038
1275
|
content: formatMessage({
|
|
1039
1276
|
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1040
1277
|
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
@@ -1047,45 +1284,33 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1047
1284
|
defaultMessage: "Group by"
|
|
1048
1285
|
});
|
|
1049
1286
|
const headers = [
|
|
1287
|
+
...displayedHeaders,
|
|
1050
1288
|
{
|
|
1051
|
-
label:
|
|
1052
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1053
|
-
defaultMessage: "name"
|
|
1054
|
-
}),
|
|
1055
|
-
name: "name"
|
|
1056
|
-
},
|
|
1057
|
-
{
|
|
1058
|
-
label: formatMessage({
|
|
1059
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1060
|
-
defaultMessage: "locale"
|
|
1061
|
-
}),
|
|
1062
|
-
name: "locale"
|
|
1063
|
-
},
|
|
1064
|
-
{
|
|
1065
|
-
label: formatMessage({
|
|
1289
|
+
label: {
|
|
1066
1290
|
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
1067
1291
|
defaultMessage: "content-type"
|
|
1068
|
-
}
|
|
1292
|
+
},
|
|
1069
1293
|
name: "content-type"
|
|
1070
1294
|
},
|
|
1071
1295
|
{
|
|
1072
|
-
label:
|
|
1296
|
+
label: {
|
|
1073
1297
|
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
1074
1298
|
defaultMessage: "action"
|
|
1075
|
-
}
|
|
1299
|
+
},
|
|
1076
1300
|
name: "action"
|
|
1077
1301
|
},
|
|
1078
1302
|
...!release.releasedAt ? [
|
|
1079
1303
|
{
|
|
1080
|
-
label:
|
|
1304
|
+
label: {
|
|
1081
1305
|
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
1082
1306
|
defaultMessage: "status"
|
|
1083
|
-
}
|
|
1307
|
+
},
|
|
1084
1308
|
name: "status"
|
|
1085
1309
|
}
|
|
1086
1310
|
] : []
|
|
1087
1311
|
];
|
|
1088
|
-
|
|
1312
|
+
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1313
|
+
return /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1089
1314
|
/* @__PURE__ */ jsx(Flex, { children: /* @__PURE__ */ jsx(
|
|
1090
1315
|
SingleSelect,
|
|
1091
1316
|
{
|
|
@@ -1102,7 +1327,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1102
1327
|
),
|
|
1103
1328
|
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
1104
1329
|
onChange: (value) => setQuery({ groupBy: value }),
|
|
1105
|
-
children:
|
|
1330
|
+
children: options.map((option) => /* @__PURE__ */ jsx(SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
1106
1331
|
}
|
|
1107
1332
|
) }),
|
|
1108
1333
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
@@ -1117,12 +1342,12 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1117
1342
|
headers,
|
|
1118
1343
|
isLoading: isLoading || isFetching,
|
|
1119
1344
|
children: /* @__PURE__ */ jsxs(Table.Content, { children: [
|
|
1120
|
-
/* @__PURE__ */ jsx(Table.Head, { children: headers.map((
|
|
1345
|
+
/* @__PURE__ */ jsx(Table.Head, { children: headers.map(({ label, name }) => /* @__PURE__ */ jsx(Table.HeaderCell, { label: formatMessage(label), name }, name)) }),
|
|
1121
1346
|
/* @__PURE__ */ jsx(Table.Loading, {}),
|
|
1122
1347
|
/* @__PURE__ */ jsx(Table.Body, { children: releaseActions[key].map(
|
|
1123
|
-
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxs(Tr, { children: [
|
|
1348
|
+
({ id, contentType, locale, type, entry, status }, actionIndex) => /* @__PURE__ */ jsxs(Tr, { children: [
|
|
1124
1349
|
/* @__PURE__ */ jsx(Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsx(Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1125
|
-
/* @__PURE__ */ jsx(Td, { width: "10%", children: /* @__PURE__ */ jsx(Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1350
|
+
hasI18nEnabled && /* @__PURE__ */ jsx(Td, { width: "10%", children: /* @__PURE__ */ jsx(Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1126
1351
|
/* @__PURE__ */ jsx(Td, { width: "10%", children: /* @__PURE__ */ jsx(Typography, { children: contentType.displayName || "" }) }),
|
|
1127
1352
|
/* @__PURE__ */ jsx(Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsx(Typography, { children: formatMessage(
|
|
1128
1353
|
{
|
|
@@ -1144,12 +1369,12 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1144
1369
|
) }),
|
|
1145
1370
|
!release.releasedAt && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
1146
1371
|
/* @__PURE__ */ jsx(Td, { width: "20%", minWidth: "200px", children: /* @__PURE__ */ jsx(
|
|
1147
|
-
|
|
1372
|
+
EntryValidationPopover,
|
|
1148
1373
|
{
|
|
1149
1374
|
action: type,
|
|
1150
1375
|
schema: contentTypes?.[contentType.uid],
|
|
1151
|
-
|
|
1152
|
-
|
|
1376
|
+
entry,
|
|
1377
|
+
status
|
|
1153
1378
|
}
|
|
1154
1379
|
) }),
|
|
1155
1380
|
/* @__PURE__ */ jsx(Td, { children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxs(ReleaseActionMenu.Root, { children: [
|
|
@@ -1157,7 +1382,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1157
1382
|
ReleaseActionMenu.ReleaseActionEntryLinkItem,
|
|
1158
1383
|
{
|
|
1159
1384
|
contentTypeUid: contentType.uid,
|
|
1160
|
-
|
|
1385
|
+
documentId: entry.documentId,
|
|
1161
1386
|
locale: locale?.code
|
|
1162
1387
|
}
|
|
1163
1388
|
),
|
|
@@ -1207,13 +1432,24 @@ const ReleaseDetailsPage = () => {
|
|
|
1207
1432
|
skip: !releaseId
|
|
1208
1433
|
}
|
|
1209
1434
|
);
|
|
1435
|
+
const { data: dataTimezone, isLoading: isLoadingTimezone } = useGetReleaseSettingsQuery();
|
|
1210
1436
|
const [updateRelease, { isLoading: isSubmittingForm }] = useUpdateReleaseMutation();
|
|
1211
1437
|
const [deleteRelease] = useDeleteReleaseMutation();
|
|
1212
1438
|
const toggleEditReleaseModal = () => {
|
|
1213
1439
|
setReleaseModalShown((prev) => !prev);
|
|
1214
1440
|
};
|
|
1441
|
+
const getTimezoneValue = () => {
|
|
1442
|
+
if (releaseData?.timezone) {
|
|
1443
|
+
return releaseData.timezone;
|
|
1444
|
+
} else {
|
|
1445
|
+
if (dataTimezone?.data.defaultTimezone) {
|
|
1446
|
+
return dataTimezone.data.defaultTimezone;
|
|
1447
|
+
}
|
|
1448
|
+
return null;
|
|
1449
|
+
}
|
|
1450
|
+
};
|
|
1215
1451
|
const toggleWarningSubmit = () => setWarningSubmit((prevState) => !prevState);
|
|
1216
|
-
if (isLoadingDetails) {
|
|
1452
|
+
if (isLoadingDetails || isLoadingTimezone) {
|
|
1217
1453
|
return /* @__PURE__ */ jsx(
|
|
1218
1454
|
ReleaseDetailsLayout,
|
|
1219
1455
|
{
|
|
@@ -1228,10 +1464,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1228
1464
|
}
|
|
1229
1465
|
const releaseData = isSuccessDetails && data?.data || null;
|
|
1230
1466
|
const title = releaseData?.name || "";
|
|
1231
|
-
const timezone =
|
|
1467
|
+
const timezone = getTimezoneValue();
|
|
1232
1468
|
const scheduledAt = releaseData?.scheduledAt && timezone ? utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1233
|
-
const date = scheduledAt ?
|
|
1234
|
-
const time = scheduledAt ? format(scheduledAt, "HH:mm") : "";
|
|
1469
|
+
const date = scheduledAt ? format$1(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1470
|
+
const time = scheduledAt ? format$1(scheduledAt, "HH:mm") : "";
|
|
1235
1471
|
const handleEditRelease = async (values) => {
|
|
1236
1472
|
const response = await updateRelease({
|
|
1237
1473
|
id: releaseId,
|
|
@@ -1247,7 +1483,8 @@ const ReleaseDetailsPage = () => {
|
|
|
1247
1483
|
defaultMessage: "Release updated."
|
|
1248
1484
|
})
|
|
1249
1485
|
});
|
|
1250
|
-
|
|
1486
|
+
toggleEditReleaseModal();
|
|
1487
|
+
} else if (isFetchError(response.error)) {
|
|
1251
1488
|
toggleNotification({
|
|
1252
1489
|
type: "danger",
|
|
1253
1490
|
message: formatAPIError(response.error)
|
|
@@ -1258,7 +1495,6 @@ const ReleaseDetailsPage = () => {
|
|
|
1258
1495
|
message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
|
|
1259
1496
|
});
|
|
1260
1497
|
}
|
|
1261
|
-
toggleEditReleaseModal();
|
|
1262
1498
|
};
|
|
1263
1499
|
const handleDeleteRelease = async () => {
|
|
1264
1500
|
const response = await deleteRelease({
|
|
@@ -1266,7 +1502,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1266
1502
|
});
|
|
1267
1503
|
if ("data" in response) {
|
|
1268
1504
|
navigate("..");
|
|
1269
|
-
} else if (
|
|
1505
|
+
} else if (isFetchError(response.error)) {
|
|
1270
1506
|
toggleNotification({
|
|
1271
1507
|
type: "danger",
|
|
1272
1508
|
message: formatAPIError(response.error)
|
|
@@ -1285,9 +1521,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1285
1521
|
toggleWarningSubmit,
|
|
1286
1522
|
children: [
|
|
1287
1523
|
/* @__PURE__ */ jsx(ReleaseDetailsBody, { releaseId }),
|
|
1288
|
-
|
|
1524
|
+
/* @__PURE__ */ jsx(
|
|
1289
1525
|
ReleaseModal,
|
|
1290
1526
|
{
|
|
1527
|
+
open: releaseModalShown,
|
|
1291
1528
|
handleClose: toggleEditReleaseModal,
|
|
1292
1529
|
handleSubmit: handleEditRelease,
|
|
1293
1530
|
isLoading: isLoadingDetails || isSubmittingForm,
|
|
@@ -1301,18 +1538,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1301
1538
|
}
|
|
1302
1539
|
}
|
|
1303
1540
|
),
|
|
1304
|
-
/* @__PURE__ */ jsx(
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
onClose: toggleWarningSubmit,
|
|
1309
|
-
onConfirm: handleDeleteRelease,
|
|
1310
|
-
children: formatMessage({
|
|
1311
|
-
id: "content-releases.dialog.confirmation-message",
|
|
1312
|
-
defaultMessage: "Are you sure you want to delete this release?"
|
|
1313
|
-
})
|
|
1314
|
-
}
|
|
1315
|
-
)
|
|
1541
|
+
/* @__PURE__ */ jsx(Dialog.Root, { open: showWarningSubmit, onOpenChange: toggleWarningSubmit, children: /* @__PURE__ */ jsx(ConfirmDialog, { onConfirm: handleDeleteRelease, children: formatMessage({
|
|
1542
|
+
id: "content-releases.dialog.confirmation-message",
|
|
1543
|
+
defaultMessage: "Are you sure you want to delete this release?"
|
|
1544
|
+
}) }) })
|
|
1316
1545
|
]
|
|
1317
1546
|
}
|
|
1318
1547
|
);
|
|
@@ -1326,4 +1555,4 @@ const App = () => {
|
|
|
1326
1555
|
export {
|
|
1327
1556
|
App
|
|
1328
1557
|
};
|
|
1329
|
-
//# sourceMappingURL=App-
|
|
1558
|
+
//# sourceMappingURL=App-CiZCkScI.mjs.map
|