@strapi/content-releases 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4 → 0.0.0-experimental.ee7402bacc4656d268ab76aa9c334a7b7a951201
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-UQxgTJY5.mjs → App-CiZCkScI.mjs} +314 -107
- package/dist/_chunks/App-CiZCkScI.mjs.map +1 -0
- package/dist/_chunks/{App-D-lWdVb2.js → App-SGjO5UPV.js} +354 -148
- package/dist/_chunks/App-SGjO5UPV.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Be3acS2L.js → PurchaseContentReleases--qQepXpP.js} +2 -2
- package/dist/_chunks/PurchaseContentReleases--qQepXpP.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-_MxP6-Dt.mjs → PurchaseContentReleases-D-n-w-st.mjs} +2 -2
- package/dist/_chunks/{PurchaseContentReleases-_MxP6-Dt.mjs.map → PurchaseContentReleases-D-n-w-st.mjs.map} +1 -1
- package/dist/_chunks/{ReleasesSettingsPage-xfAoY8N3.js → ReleasesSettingsPage-Cto_NLUd.js} +4 -4
- package/dist/_chunks/ReleasesSettingsPage-Cto_NLUd.js.map +1 -0
- package/dist/_chunks/{ReleasesSettingsPage-CuUXvABk.mjs → ReleasesSettingsPage-DQT8N3A-.mjs} +4 -4
- package/dist/_chunks/ReleasesSettingsPage-DQT8N3A-.mjs.map +1 -0
- package/dist/_chunks/{en-BCDLTJn3.js → en-BWPPsSH-.js} +12 -2
- package/dist/_chunks/en-BWPPsSH-.js.map +1 -0
- package/dist/_chunks/{en-CGXIF4vQ.mjs → en-D9Q4YW03.mjs} +12 -2
- package/dist/_chunks/en-D9Q4YW03.mjs.map +1 -0
- package/dist/_chunks/{index-b3Ej95H7.mjs → index-BjvFfTtA.mjs} +316 -29
- package/dist/_chunks/index-BjvFfTtA.mjs.map +1 -0
- package/dist/_chunks/{index-jnv9zdcE.js → index-CyU534vL.js} +314 -28
- package/dist/_chunks/index-CyU534vL.js.map +1 -0
- package/dist/_chunks/{schemas-z5zp-_Gd.js → schemas-DBYv9gK8.js} +3 -4
- package/dist/_chunks/schemas-DBYv9gK8.js.map +1 -0
- package/dist/_chunks/{schemas-63pFihNF.mjs → schemas-DdA2ic2U.mjs} +2 -2
- package/dist/_chunks/schemas-DdA2ic2U.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/EntryValidationPopover.d.ts +13 -0
- package/dist/admin/src/components/ReleaseListCell.d.ts +28 -0
- package/dist/admin/src/services/release.d.ts +34 -32
- package/dist/server/index.js +192 -90
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +191 -88
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/index.d.ts +2 -0
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/release-action.d.ts +1 -0
- package/dist/server/src/controllers/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/release.d.ts +1 -0
- package/dist/server/src/controllers/release.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +6 -6
- package/dist/server/src/middlewares/documents.d.ts.map +1 -1
- package/dist/server/src/migrations/database/5.0.0-document-id-in-actions.d.ts.map +1 -1
- package/dist/server/src/routes/release-action.d.ts.map +1 -1
- package/dist/server/src/routes/release.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -6
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts +6 -8
- package/dist/server/src/services/release-action.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +11 -6
- package/dist/shared/contracts/release-actions.d.ts.map +1 -1
- package/dist/shared/contracts/releases.d.ts +3 -2
- package/dist/shared/contracts/releases.d.ts.map +1 -1
- package/package.json +18 -16
- package/dist/_chunks/App-D-lWdVb2.js.map +0 -1
- package/dist/_chunks/App-UQxgTJY5.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-Be3acS2L.js.map +0 -1
- package/dist/_chunks/ReleasesSettingsPage-CuUXvABk.mjs.map +0 -1
- package/dist/_chunks/ReleasesSettingsPage-xfAoY8N3.js.map +0 -1
- package/dist/_chunks/en-BCDLTJn3.js.map +0 -1
- package/dist/_chunks/en-CGXIF4vQ.mjs.map +0 -1
- package/dist/_chunks/index-b3Ej95H7.mjs.map +0 -1
- package/dist/_chunks/index-jnv9zdcE.js.map +0 -1
- package/dist/_chunks/schemas-63pFihNF.mjs.map +0 -1
- package/dist/_chunks/schemas-z5zp-_Gd.js.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
4
|
+
const strapiAdmin$1 = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-CyU534vL.js");
|
|
7
7
|
const React = require("react");
|
|
8
|
-
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
|
9
8
|
const designSystem = require("@strapi/design-system");
|
|
10
9
|
const icons = require("@strapi/icons");
|
|
11
10
|
const symbols = require("@strapi/icons/symbols");
|
|
@@ -13,15 +12,16 @@ const format = require("date-fns/format");
|
|
|
13
12
|
const dateFnsTz = require("date-fns-tz");
|
|
14
13
|
const reactIntl = require("react-intl");
|
|
15
14
|
const styledComponents = require("styled-components");
|
|
15
|
+
const strapiAdmin = require("@strapi/content-manager/strapi-admin");
|
|
16
|
+
const qs = require("qs");
|
|
16
17
|
const dateFns = require("date-fns");
|
|
17
18
|
const formik = require("formik");
|
|
18
|
-
const schemas = require("./schemas-
|
|
19
|
+
const schemas = require("./schemas-DBYv9gK8.js");
|
|
19
20
|
const reactRedux = require("react-redux");
|
|
20
21
|
const ee = require("@strapi/admin/strapi-admin/ee");
|
|
21
22
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
22
23
|
function _interopNamespace(e) {
|
|
23
|
-
if (e && e.__esModule)
|
|
24
|
-
return e;
|
|
24
|
+
if (e && e.__esModule) return e;
|
|
25
25
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
26
26
|
if (e) {
|
|
27
27
|
for (const k in e) {
|
|
@@ -39,6 +39,290 @@ function _interopNamespace(e) {
|
|
|
39
39
|
}
|
|
40
40
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
41
41
|
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
42
|
+
const StyledPopoverFlex = styledComponents.styled(designSystem.Flex)`
|
|
43
|
+
width: 100%;
|
|
44
|
+
max-width: 256px;
|
|
45
|
+
|
|
46
|
+
& > * {
|
|
47
|
+
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
& > *:last-child {
|
|
51
|
+
border-bottom: none;
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const EntryStatusTrigger = ({
|
|
55
|
+
action,
|
|
56
|
+
status,
|
|
57
|
+
hasErrors,
|
|
58
|
+
requiredStage,
|
|
59
|
+
entryStage
|
|
60
|
+
}) => {
|
|
61
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
62
|
+
if (action === "publish") {
|
|
63
|
+
if (hasErrors || requiredStage && requiredStage.id !== entryStage?.id) {
|
|
64
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
65
|
+
designSystem.Button,
|
|
66
|
+
{
|
|
67
|
+
variant: "ghost",
|
|
68
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
69
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}),
|
|
70
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
71
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.not-ready",
|
|
72
|
+
defaultMessage: "Not ready to publish"
|
|
73
|
+
}) })
|
|
74
|
+
}
|
|
75
|
+
) });
|
|
76
|
+
}
|
|
77
|
+
if (status === "draft") {
|
|
78
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
+
designSystem.Button,
|
|
80
|
+
{
|
|
81
|
+
variant: "ghost",
|
|
82
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
83
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}),
|
|
84
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
85
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
86
|
+
defaultMessage: "Ready to publish"
|
|
87
|
+
}) })
|
|
88
|
+
}
|
|
89
|
+
) });
|
|
90
|
+
}
|
|
91
|
+
if (status === "modified") {
|
|
92
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
93
|
+
designSystem.Button,
|
|
94
|
+
{
|
|
95
|
+
variant: "ghost",
|
|
96
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowsCounterClockwise, { fill: "alternative600" }),
|
|
97
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}),
|
|
98
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", fontWeight: "bold", textColor: "alternative600", children: formatMessage({
|
|
99
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.modified",
|
|
100
|
+
defaultMessage: "Ready to publish changes"
|
|
101
|
+
}) })
|
|
102
|
+
}
|
|
103
|
+
) });
|
|
104
|
+
}
|
|
105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
106
|
+
designSystem.Button,
|
|
107
|
+
{
|
|
108
|
+
variant: "ghost",
|
|
109
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
110
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}),
|
|
111
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
112
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
113
|
+
defaultMessage: "Already published"
|
|
114
|
+
}) })
|
|
115
|
+
}
|
|
116
|
+
) });
|
|
117
|
+
}
|
|
118
|
+
if (status === "published") {
|
|
119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
+
designSystem.Button,
|
|
121
|
+
{
|
|
122
|
+
variant: "ghost",
|
|
123
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
124
|
+
endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}),
|
|
125
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
126
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-unpublish",
|
|
127
|
+
defaultMessage: "Ready to unpublish"
|
|
128
|
+
}) })
|
|
129
|
+
}
|
|
130
|
+
) });
|
|
131
|
+
}
|
|
132
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "ghost", startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }), endIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", variant: "omega", fontWeight: "bold", children: formatMessage({
|
|
133
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
134
|
+
defaultMessage: "Already unpublished"
|
|
135
|
+
}) }) }) });
|
|
136
|
+
};
|
|
137
|
+
const FieldsValidation = ({
|
|
138
|
+
hasErrors,
|
|
139
|
+
errors,
|
|
140
|
+
kind,
|
|
141
|
+
contentTypeUid,
|
|
142
|
+
documentId,
|
|
143
|
+
locale
|
|
144
|
+
}) => {
|
|
145
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
146
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, width: "100%", padding: 5, children: [
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, width: "100%", children: [
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: formatMessage({
|
|
149
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields",
|
|
150
|
+
defaultMessage: "Fields"
|
|
151
|
+
}) }),
|
|
152
|
+
hasErrors ? /* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }) : /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" })
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { width: "100%", textColor: "neutral600", children: hasErrors ? formatMessage(
|
|
155
|
+
{
|
|
156
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.error",
|
|
157
|
+
defaultMessage: "{errors} errors on fields."
|
|
158
|
+
},
|
|
159
|
+
{ errors: errors ? Object.keys(errors).length : 0 }
|
|
160
|
+
) : formatMessage({
|
|
161
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.success",
|
|
162
|
+
defaultMessage: "All fields are filled correctly."
|
|
163
|
+
}) }),
|
|
164
|
+
hasErrors && /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
+
designSystem.LinkButton,
|
|
166
|
+
{
|
|
167
|
+
tag: reactRouterDom.Link,
|
|
168
|
+
to: {
|
|
169
|
+
pathname: `/content-manager/${kind === "collectionType" ? "collection-types" : "single-types"}/${contentTypeUid}/${documentId}`,
|
|
170
|
+
search: locale ? qs.stringify({
|
|
171
|
+
plugins: {
|
|
172
|
+
i18n: {
|
|
173
|
+
locale
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
}) : ""
|
|
177
|
+
},
|
|
178
|
+
variant: "secondary",
|
|
179
|
+
fullWidth: true,
|
|
180
|
+
state: { forceValidation: true },
|
|
181
|
+
children: formatMessage({
|
|
182
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.fields.see-errors",
|
|
183
|
+
defaultMessage: "See errors"
|
|
184
|
+
})
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
] });
|
|
188
|
+
};
|
|
189
|
+
const getReviewStageIcon = ({
|
|
190
|
+
contentTypeHasReviewWorkflow,
|
|
191
|
+
requiredStage,
|
|
192
|
+
entryStage
|
|
193
|
+
}) => {
|
|
194
|
+
if (!contentTypeHasReviewWorkflow) {
|
|
195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "neutral200" });
|
|
196
|
+
}
|
|
197
|
+
if (requiredStage && requiredStage.id !== entryStage?.id) {
|
|
198
|
+
return /* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" });
|
|
199
|
+
}
|
|
200
|
+
return /* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" });
|
|
201
|
+
};
|
|
202
|
+
const getReviewStageMessage = ({
|
|
203
|
+
contentTypeHasReviewWorkflow,
|
|
204
|
+
requiredStage,
|
|
205
|
+
entryStage,
|
|
206
|
+
formatMessage
|
|
207
|
+
}) => {
|
|
208
|
+
if (!contentTypeHasReviewWorkflow) {
|
|
209
|
+
return formatMessage({
|
|
210
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.not-enabled",
|
|
211
|
+
defaultMessage: "This entry is not associated to any workflow."
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
if (requiredStage && requiredStage.id !== entryStage?.id) {
|
|
215
|
+
return formatMessage(
|
|
216
|
+
{
|
|
217
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.not-ready",
|
|
218
|
+
defaultMessage: "This entry is not at the required stage for publishing. ({stageName})"
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
stageName: requiredStage?.name ?? ""
|
|
222
|
+
}
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
if (requiredStage && requiredStage.id === entryStage?.id) {
|
|
226
|
+
return formatMessage(
|
|
227
|
+
{
|
|
228
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.ready",
|
|
229
|
+
defaultMessage: "This entry is at the required stage for publishing. ({stageName})"
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
stageName: requiredStage?.name ?? ""
|
|
233
|
+
}
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
return formatMessage({
|
|
237
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage.stage-not-required",
|
|
238
|
+
defaultMessage: "No required stage for publication"
|
|
239
|
+
});
|
|
240
|
+
};
|
|
241
|
+
const ReviewStageValidation = ({
|
|
242
|
+
contentTypeHasReviewWorkflow,
|
|
243
|
+
requiredStage,
|
|
244
|
+
entryStage
|
|
245
|
+
}) => {
|
|
246
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
247
|
+
const Icon = getReviewStageIcon({
|
|
248
|
+
contentTypeHasReviewWorkflow,
|
|
249
|
+
requiredStage,
|
|
250
|
+
entryStage
|
|
251
|
+
});
|
|
252
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, width: "100%", padding: 5, children: [
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, width: "100%", children: [
|
|
254
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: formatMessage({
|
|
255
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.review-stage",
|
|
256
|
+
defaultMessage: "Review stage"
|
|
257
|
+
}) }),
|
|
258
|
+
Icon
|
|
259
|
+
] }),
|
|
260
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", children: getReviewStageMessage({
|
|
261
|
+
contentTypeHasReviewWorkflow,
|
|
262
|
+
requiredStage,
|
|
263
|
+
entryStage,
|
|
264
|
+
formatMessage
|
|
265
|
+
}) })
|
|
266
|
+
] });
|
|
267
|
+
};
|
|
268
|
+
const EntryValidationPopover = ({
|
|
269
|
+
schema,
|
|
270
|
+
entry,
|
|
271
|
+
status,
|
|
272
|
+
action
|
|
273
|
+
}) => {
|
|
274
|
+
const { validate, isLoading } = strapiAdmin.unstable_useDocument(
|
|
275
|
+
{
|
|
276
|
+
collectionType: schema?.kind ?? "",
|
|
277
|
+
model: schema?.uid ?? ""
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
// 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
|
|
281
|
+
skip: true
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
const errors = isLoading ? null : validate(entry);
|
|
285
|
+
const hasErrors = errors ? Object.keys(errors).length > 0 : false;
|
|
286
|
+
const contentTypeHasReviewWorkflow = schema?.hasReviewWorkflow ?? false;
|
|
287
|
+
const requiredStage = schema?.stageRequiredToPublish;
|
|
288
|
+
const entryStage = entry.strapi_stage;
|
|
289
|
+
if (isLoading) {
|
|
290
|
+
return null;
|
|
291
|
+
}
|
|
292
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
|
|
293
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
294
|
+
EntryStatusTrigger,
|
|
295
|
+
{
|
|
296
|
+
action,
|
|
297
|
+
status,
|
|
298
|
+
hasErrors,
|
|
299
|
+
requiredStage,
|
|
300
|
+
entryStage
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(StyledPopoverFlex, { direction: "column", children: [
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
305
|
+
FieldsValidation,
|
|
306
|
+
{
|
|
307
|
+
hasErrors,
|
|
308
|
+
errors,
|
|
309
|
+
contentTypeUid: schema?.uid,
|
|
310
|
+
kind: schema?.kind,
|
|
311
|
+
documentId: entry.documentId,
|
|
312
|
+
locale: entry.locale
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
316
|
+
ReviewStageValidation,
|
|
317
|
+
{
|
|
318
|
+
contentTypeHasReviewWorkflow,
|
|
319
|
+
requiredStage,
|
|
320
|
+
entryStage
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }) })
|
|
324
|
+
] });
|
|
325
|
+
};
|
|
42
326
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
43
327
|
const RelativeTime$1 = React__namespace.forwardRef(
|
|
44
328
|
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
|
@@ -84,8 +368,7 @@ const ReleaseModal = ({
|
|
|
84
368
|
);
|
|
85
369
|
const getScheduledTimestamp = (values) => {
|
|
86
370
|
const { date, time, timezone } = values;
|
|
87
|
-
if (!date || !time || !timezone)
|
|
88
|
-
return null;
|
|
371
|
+
if (!date || !time || !timezone) return null;
|
|
89
372
|
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
90
373
|
return dateFnsTz.zonedTimeToUtc(`${date} ${time}`, timezoneWithoutOffset);
|
|
91
374
|
};
|
|
@@ -346,7 +629,7 @@ const getBadgeProps = (status) => {
|
|
|
346
629
|
const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
347
630
|
const { formatMessage } = reactIntl.useIntl();
|
|
348
631
|
if (isError) {
|
|
349
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
632
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Error, {});
|
|
350
633
|
}
|
|
351
634
|
if (releases?.length === 0) {
|
|
352
635
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -365,7 +648,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
365
648
|
}
|
|
366
649
|
);
|
|
367
650
|
}
|
|
368
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
651
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
369
652
|
designSystem.Flex,
|
|
370
653
|
{
|
|
371
654
|
direction: "column",
|
|
@@ -410,20 +693,20 @@ const INITIAL_FORM_VALUES = {
|
|
|
410
693
|
const ReleasesPage = () => {
|
|
411
694
|
const location = reactRouterDom.useLocation();
|
|
412
695
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
413
|
-
const { toggleNotification } = strapiAdmin.useNotification();
|
|
696
|
+
const { toggleNotification } = strapiAdmin$1.useNotification();
|
|
414
697
|
const { formatMessage } = reactIntl.useIntl();
|
|
415
698
|
const navigate = reactRouterDom.useNavigate();
|
|
416
|
-
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
417
|
-
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
699
|
+
const { formatAPIError } = strapiAdmin$1.useAPIErrorHandler();
|
|
700
|
+
const [{ query }, setQuery] = strapiAdmin$1.useQueryParams();
|
|
418
701
|
const response = index.useGetReleasesQuery(query);
|
|
419
702
|
const { data, isLoading: isLoadingSettings } = index.useGetReleaseSettingsQuery();
|
|
420
703
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
421
704
|
const { getFeature } = ee.useLicenseLimits();
|
|
422
705
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
423
|
-
const { trackUsage } = strapiAdmin.useTracking();
|
|
706
|
+
const { trackUsage } = strapiAdmin$1.useTracking();
|
|
424
707
|
const {
|
|
425
708
|
allowedActions: { canCreate }
|
|
426
|
-
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
709
|
+
} = strapiAdmin$1.useRBAC(index.PERMISSIONS);
|
|
427
710
|
const { isLoading: isLoadingReleases, isSuccess, isError } = response;
|
|
428
711
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
429
712
|
React__namespace.useEffect(() => {
|
|
@@ -446,7 +729,7 @@ const ReleasesPage = () => {
|
|
|
446
729
|
setReleaseModalShown((prev) => !prev);
|
|
447
730
|
};
|
|
448
731
|
if (isLoadingReleases || isLoadingSettings) {
|
|
449
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
732
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Loading, {});
|
|
450
733
|
}
|
|
451
734
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
452
735
|
const hasReachedMaximumPendingReleases = totalPendingReleases >= maximumReleases;
|
|
@@ -478,7 +761,7 @@ const ReleasesPage = () => {
|
|
|
478
761
|
});
|
|
479
762
|
trackUsage("didCreateRelease");
|
|
480
763
|
navigate(response2.data.data.id.toString());
|
|
481
|
-
} else if (strapiAdmin.isFetchError(response2.error)) {
|
|
764
|
+
} else if (strapiAdmin$1.isFetchError(response2.error)) {
|
|
482
765
|
toggleNotification({
|
|
483
766
|
type: "danger",
|
|
484
767
|
message: formatAPIError(response2.error)
|
|
@@ -492,7 +775,7 @@ const ReleasesPage = () => {
|
|
|
492
775
|
};
|
|
493
776
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingReleases || isLoadingSettings, children: [
|
|
494
777
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
495
|
-
strapiAdmin.Layouts.Header,
|
|
778
|
+
strapiAdmin$1.Layouts.Header,
|
|
496
779
|
{
|
|
497
780
|
title: formatMessage({
|
|
498
781
|
id: "content-releases.pages.Releases.title",
|
|
@@ -516,7 +799,7 @@ const ReleasesPage = () => {
|
|
|
516
799
|
) : null
|
|
517
800
|
}
|
|
518
801
|
),
|
|
519
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
520
803
|
hasReachedMaximumPendingReleases && /* @__PURE__ */ jsxRuntime.jsx(
|
|
521
804
|
StyledAlert,
|
|
522
805
|
{
|
|
@@ -587,13 +870,13 @@ const ReleasesPage = () => {
|
|
|
587
870
|
) })
|
|
588
871
|
] }),
|
|
589
872
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
590
|
-
strapiAdmin.Pagination.Root,
|
|
873
|
+
strapiAdmin$1.Pagination.Root,
|
|
591
874
|
{
|
|
592
875
|
...response?.currentData?.meta?.pagination,
|
|
593
876
|
defaultPageSize: response?.currentData?.meta?.pagination?.pageSize,
|
|
594
877
|
children: [
|
|
595
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.PageSize, { options: ["8", "16", "32", "64"] }),
|
|
596
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.Links, {})
|
|
878
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Pagination.PageSize, { options: ["8", "16", "32", "64"] }),
|
|
879
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Pagination.Links, {})
|
|
597
880
|
]
|
|
598
881
|
}
|
|
599
882
|
)
|
|
@@ -632,100 +915,19 @@ const StyledMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
|
632
915
|
}
|
|
633
916
|
`;
|
|
634
917
|
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
635
|
-
width: ${({ theme }) => theme.spaces[
|
|
636
|
-
height: ${({ theme }) => theme.spaces[
|
|
918
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
919
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
637
920
|
path {
|
|
638
921
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
639
922
|
}
|
|
640
923
|
`;
|
|
641
924
|
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
642
|
-
width: ${({ theme }) => theme.spaces[
|
|
643
|
-
height: ${({ theme }) => theme.spaces[
|
|
925
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
926
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
644
927
|
path {
|
|
645
928
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
646
929
|
}
|
|
647
930
|
`;
|
|
648
|
-
const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
|
|
649
|
-
max-width: 300px;
|
|
650
|
-
`;
|
|
651
|
-
const EntryValidationText = ({ action, schema, entry, status }) => {
|
|
652
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
653
|
-
const { validate, isLoading } = strapiAdmin$1.unstable_useDocument(
|
|
654
|
-
{
|
|
655
|
-
collectionType: schema?.kind ?? "",
|
|
656
|
-
model: schema?.uid ?? ""
|
|
657
|
-
},
|
|
658
|
-
{
|
|
659
|
-
// 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
|
|
660
|
-
skip: true
|
|
661
|
-
}
|
|
662
|
-
);
|
|
663
|
-
if (isLoading) {
|
|
664
|
-
return null;
|
|
665
|
-
}
|
|
666
|
-
const errors = validate(entry) ?? {};
|
|
667
|
-
if (action === "publish") {
|
|
668
|
-
if (Object.keys(errors).length > 0) {
|
|
669
|
-
const validationErrorsMessages = Object.entries(errors).map(
|
|
670
|
-
([key, value]) => formatMessage(
|
|
671
|
-
// @ts-expect-error – TODO: fix this will better checks
|
|
672
|
-
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
673
|
-
{ field: key }
|
|
674
|
-
)
|
|
675
|
-
).join(" ");
|
|
676
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
677
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
678
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
679
|
-
TypographyMaxWidth,
|
|
680
|
-
{
|
|
681
|
-
textColor: "danger600",
|
|
682
|
-
variant: "omega",
|
|
683
|
-
fontWeight: "semiBold",
|
|
684
|
-
ellipsis: true,
|
|
685
|
-
children: validationErrorsMessages
|
|
686
|
-
}
|
|
687
|
-
) })
|
|
688
|
-
] });
|
|
689
|
-
}
|
|
690
|
-
if (status === "draft") {
|
|
691
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
692
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
693
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
694
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
695
|
-
defaultMessage: "Ready to publish"
|
|
696
|
-
}) })
|
|
697
|
-
] });
|
|
698
|
-
}
|
|
699
|
-
if (status === "modified") {
|
|
700
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
701
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.ArrowsCounterClockwise, { fill: "alternative600" }),
|
|
702
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
703
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.modified",
|
|
704
|
-
defaultMessage: "Ready to publish changes"
|
|
705
|
-
}) })
|
|
706
|
-
] });
|
|
707
|
-
}
|
|
708
|
-
if (status === "published") {
|
|
709
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
710
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
711
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
712
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
713
|
-
defaultMessage: "Already published"
|
|
714
|
-
}) })
|
|
715
|
-
] });
|
|
716
|
-
}
|
|
717
|
-
}
|
|
718
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
719
|
-
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
720
|
-
!entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
721
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
722
|
-
defaultMessage: "Already unpublished"
|
|
723
|
-
}) }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
724
|
-
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-unpublish",
|
|
725
|
-
defaultMessage: "Ready to unpublish"
|
|
726
|
-
}) })
|
|
727
|
-
] });
|
|
728
|
-
};
|
|
729
931
|
const ReleaseDetailsLayout = ({
|
|
730
932
|
toggleEditReleaseModal,
|
|
731
933
|
toggleWarningSubmit,
|
|
@@ -744,12 +946,12 @@ const ReleaseDetailsLayout = ({
|
|
|
744
946
|
}
|
|
745
947
|
);
|
|
746
948
|
const [publishRelease, { isLoading: isPublishing }] = index.usePublishReleaseMutation();
|
|
747
|
-
const { toggleNotification } = strapiAdmin.useNotification();
|
|
748
|
-
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
749
|
-
const { allowedActions } = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
949
|
+
const { toggleNotification } = strapiAdmin$1.useNotification();
|
|
950
|
+
const { formatAPIError } = strapiAdmin$1.useAPIErrorHandler();
|
|
951
|
+
const { allowedActions } = strapiAdmin$1.useRBAC(index.PERMISSIONS);
|
|
750
952
|
const { canUpdate, canDelete, canPublish } = allowedActions;
|
|
751
953
|
const dispatch = useTypedDispatch();
|
|
752
|
-
const { trackUsage } = strapiAdmin.useTracking();
|
|
954
|
+
const { trackUsage } = strapiAdmin$1.useTracking();
|
|
753
955
|
const release = data?.data;
|
|
754
956
|
const handlePublishRelease = (id) => async () => {
|
|
755
957
|
const response = await publishRelease({ id });
|
|
@@ -767,7 +969,7 @@ const ReleaseDetailsLayout = ({
|
|
|
767
969
|
totalPublishedEntries,
|
|
768
970
|
totalUnpublishedEntries
|
|
769
971
|
});
|
|
770
|
-
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
972
|
+
} else if (strapiAdmin$1.isFetchError(response.error)) {
|
|
771
973
|
toggleNotification({
|
|
772
974
|
type: "danger",
|
|
773
975
|
message: formatAPIError(response.error)
|
|
@@ -800,7 +1002,7 @@ const ReleaseDetailsLayout = ({
|
|
|
800
1002
|
return release.createdBy.email;
|
|
801
1003
|
};
|
|
802
1004
|
if (isLoadingDetails) {
|
|
803
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
1005
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Loading, {});
|
|
804
1006
|
}
|
|
805
1007
|
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
806
1008
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -850,23 +1052,23 @@ const ReleaseDetailsLayout = ({
|
|
|
850
1052
|
) : "";
|
|
851
1053
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
852
1054
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
853
|
-
strapiAdmin.Layouts.Header,
|
|
1055
|
+
strapiAdmin$1.Layouts.Header,
|
|
854
1056
|
{
|
|
855
1057
|
title: release.name,
|
|
856
1058
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
857
1059
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (isScheduled ? ` - ${scheduledText}` : "") }),
|
|
858
1060
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { ...getBadgeProps(release.status), children: release.status })
|
|
859
1061
|
] }),
|
|
860
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
1062
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.BackButton, { fallback: ".." }),
|
|
861
1063
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
862
1064
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
863
|
-
|
|
1065
|
+
SimpleMenuButton,
|
|
864
1066
|
{
|
|
865
1067
|
label: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {}),
|
|
866
1068
|
variant: "tertiary",
|
|
867
1069
|
endIcon: null,
|
|
868
|
-
paddingLeft:
|
|
869
|
-
paddingRight:
|
|
1070
|
+
paddingLeft: "7px",
|
|
1071
|
+
paddingRight: "7px",
|
|
870
1072
|
"aria-label": formatMessage({
|
|
871
1073
|
id: "content-releases.header.actions.open-release-actions",
|
|
872
1074
|
defaultMessage: "Release edit and delete menu"
|
|
@@ -902,7 +1104,7 @@ const ReleaseDetailsLayout = ({
|
|
|
902
1104
|
justifyContent: "center",
|
|
903
1105
|
alignItems: "flex-start",
|
|
904
1106
|
gap: 1,
|
|
905
|
-
padding:
|
|
1107
|
+
padding: 4,
|
|
906
1108
|
children: [
|
|
907
1109
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
908
1110
|
id: "content-releases.header.actions.created",
|
|
@@ -948,6 +1150,11 @@ const ReleaseDetailsLayout = ({
|
|
|
948
1150
|
children
|
|
949
1151
|
] });
|
|
950
1152
|
};
|
|
1153
|
+
const SimpleMenuButton = styledComponents.styled(designSystem.SimpleMenu)`
|
|
1154
|
+
& > span {
|
|
1155
|
+
display: flex;
|
|
1156
|
+
}
|
|
1157
|
+
`;
|
|
951
1158
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
952
1159
|
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
953
1160
|
const getGroupByOptionLabel = (value) => {
|
|
@@ -970,9 +1177,9 @@ const getGroupByOptionLabel = (value) => {
|
|
|
970
1177
|
};
|
|
971
1178
|
const ReleaseDetailsBody = ({ releaseId }) => {
|
|
972
1179
|
const { formatMessage } = reactIntl.useIntl();
|
|
973
|
-
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
974
|
-
const { toggleNotification } = strapiAdmin.useNotification();
|
|
975
|
-
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
1180
|
+
const [{ query }, setQuery] = strapiAdmin$1.useQueryParams();
|
|
1181
|
+
const { toggleNotification } = strapiAdmin$1.useNotification();
|
|
1182
|
+
const { formatAPIError } = strapiAdmin$1.useAPIErrorHandler();
|
|
976
1183
|
const {
|
|
977
1184
|
data: releaseData,
|
|
978
1185
|
isLoading: isReleaseLoading,
|
|
@@ -980,8 +1187,8 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
980
1187
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
981
1188
|
const {
|
|
982
1189
|
allowedActions: { canUpdate }
|
|
983
|
-
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
984
|
-
const runHookWaterfall = strapiAdmin.useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
1190
|
+
} = strapiAdmin$1.useRBAC(index.PERMISSIONS);
|
|
1191
|
+
const runHookWaterfall = strapiAdmin$1.useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
985
1192
|
const { displayedHeaders, hasI18nEnabled } = runHookWaterfall("ContentReleases/pages/ReleaseDetails/add-locale-in-releases", {
|
|
986
1193
|
displayedHeaders: [
|
|
987
1194
|
{
|
|
@@ -1022,7 +1229,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1022
1229
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
1023
1230
|
});
|
|
1024
1231
|
if ("error" in response) {
|
|
1025
|
-
if (strapiAdmin.isFetchError(response.error)) {
|
|
1232
|
+
if (strapiAdmin$1.isFetchError(response.error)) {
|
|
1026
1233
|
toggleNotification({
|
|
1027
1234
|
type: "danger",
|
|
1028
1235
|
message: formatAPIError(response.error)
|
|
@@ -1036,12 +1243,12 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1036
1243
|
}
|
|
1037
1244
|
};
|
|
1038
1245
|
if (isLoading || isReleaseLoading) {
|
|
1039
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
1246
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Loading, {});
|
|
1040
1247
|
}
|
|
1041
1248
|
const releaseActions = data?.data;
|
|
1042
1249
|
const releaseMeta = data?.meta;
|
|
1043
1250
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
1044
|
-
|
|
1251
|
+
releaseMeta?.components || {};
|
|
1045
1252
|
if (isBaseQueryError(releaseError) || !release) {
|
|
1046
1253
|
const errorsArray = [];
|
|
1047
1254
|
if (releaseError && "code" in releaseError) {
|
|
@@ -1065,10 +1272,10 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1065
1272
|
);
|
|
1066
1273
|
}
|
|
1067
1274
|
if (isError || !releaseActions) {
|
|
1068
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
1275
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Error, {});
|
|
1069
1276
|
}
|
|
1070
1277
|
if (Object.keys(releaseActions).length === 0) {
|
|
1071
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1278
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1072
1279
|
designSystem.EmptyStateLayout,
|
|
1073
1280
|
{
|
|
1074
1281
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1125,7 +1332,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1125
1332
|
] : []
|
|
1126
1333
|
];
|
|
1127
1334
|
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1128
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1335
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1129
1336
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1130
1337
|
designSystem.SingleSelect,
|
|
1131
1338
|
{
|
|
@@ -1148,7 +1355,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1148
1355
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
1149
1356
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { role: "separator", "aria-label": key, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: key }) }),
|
|
1150
1357
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1151
|
-
strapiAdmin.Table.Root,
|
|
1358
|
+
strapiAdmin$1.Table.Root,
|
|
1152
1359
|
{
|
|
1153
1360
|
rows: releaseActions[key].map((item) => ({
|
|
1154
1361
|
...item,
|
|
@@ -1156,10 +1363,10 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1156
1363
|
})),
|
|
1157
1364
|
headers,
|
|
1158
1365
|
isLoading: isLoading || isFetching,
|
|
1159
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
|
|
1160
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Head, { children: headers.map(({ label, name }) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { label: formatMessage(label), name }, name)) }),
|
|
1161
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Loading, {}),
|
|
1162
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: releaseActions[key].map(
|
|
1366
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin$1.Table.Content, { children: [
|
|
1367
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Table.Head, { children: headers.map(({ label, name }) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Table.HeaderCell, { label: formatMessage(label), name }, name)) }),
|
|
1368
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Table.Loading, {}),
|
|
1369
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Table.Body, { children: releaseActions[key].map(
|
|
1163
1370
|
({ id, contentType, locale, type, entry, status }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1164
1371
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1165
1372
|
hasI18nEnabled && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
@@ -1184,11 +1391,10 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1184
1391
|
) }),
|
|
1185
1392
|
!release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1186
1393
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", minWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1187
|
-
|
|
1394
|
+
EntryValidationPopover,
|
|
1188
1395
|
{
|
|
1189
1396
|
action: type,
|
|
1190
1397
|
schema: contentTypes?.[contentType.uid],
|
|
1191
|
-
components,
|
|
1192
1398
|
entry,
|
|
1193
1399
|
status
|
|
1194
1400
|
}
|
|
@@ -1218,13 +1424,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1218
1424
|
)
|
|
1219
1425
|
] }, `releases-group-${key}`)),
|
|
1220
1426
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1221
|
-
strapiAdmin.Pagination.Root,
|
|
1427
|
+
strapiAdmin$1.Pagination.Root,
|
|
1222
1428
|
{
|
|
1223
1429
|
...releaseMeta?.pagination,
|
|
1224
1430
|
defaultPageSize: releaseMeta?.pagination?.pageSize,
|
|
1225
1431
|
children: [
|
|
1226
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.PageSize, {}),
|
|
1227
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.Links, {})
|
|
1432
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Pagination.PageSize, {}),
|
|
1433
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Pagination.Links, {})
|
|
1228
1434
|
]
|
|
1229
1435
|
}
|
|
1230
1436
|
)
|
|
@@ -1233,8 +1439,8 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1233
1439
|
const ReleaseDetailsPage = () => {
|
|
1234
1440
|
const { formatMessage } = reactIntl.useIntl();
|
|
1235
1441
|
const { releaseId } = reactRouterDom.useParams();
|
|
1236
|
-
const { toggleNotification } = strapiAdmin.useNotification();
|
|
1237
|
-
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
1442
|
+
const { toggleNotification } = strapiAdmin$1.useNotification();
|
|
1443
|
+
const { formatAPIError } = strapiAdmin$1.useAPIErrorHandler();
|
|
1238
1444
|
const navigate = reactRouterDom.useNavigate();
|
|
1239
1445
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
1240
1446
|
const [showWarningSubmit, setWarningSubmit] = React__namespace.useState(false);
|
|
@@ -1271,7 +1477,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1271
1477
|
{
|
|
1272
1478
|
toggleEditReleaseModal,
|
|
1273
1479
|
toggleWarningSubmit,
|
|
1274
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {})
|
|
1480
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Loading, {})
|
|
1275
1481
|
}
|
|
1276
1482
|
);
|
|
1277
1483
|
}
|
|
@@ -1300,7 +1506,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1300
1506
|
})
|
|
1301
1507
|
});
|
|
1302
1508
|
toggleEditReleaseModal();
|
|
1303
|
-
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1509
|
+
} else if (strapiAdmin$1.isFetchError(response.error)) {
|
|
1304
1510
|
toggleNotification({
|
|
1305
1511
|
type: "danger",
|
|
1306
1512
|
message: formatAPIError(response.error)
|
|
@@ -1318,7 +1524,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1318
1524
|
});
|
|
1319
1525
|
if ("data" in response) {
|
|
1320
1526
|
navigate("..");
|
|
1321
|
-
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1527
|
+
} else if (strapiAdmin$1.isFetchError(response.error)) {
|
|
1322
1528
|
toggleNotification({
|
|
1323
1529
|
type: "danger",
|
|
1324
1530
|
message: formatAPIError(response.error)
|
|
@@ -1354,7 +1560,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1354
1560
|
}
|
|
1355
1561
|
}
|
|
1356
1562
|
),
|
|
1357
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarningSubmit, onOpenChange: toggleWarningSubmit, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleDeleteRelease, children: formatMessage({
|
|
1563
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarningSubmit, onOpenChange: toggleWarningSubmit, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.ConfirmDialog, { onConfirm: handleDeleteRelease, children: formatMessage({
|
|
1358
1564
|
id: "content-releases.dialog.confirmation-message",
|
|
1359
1565
|
defaultMessage: "Are you sure you want to delete this release?"
|
|
1360
1566
|
}) }) })
|
|
@@ -1363,10 +1569,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1363
1569
|
);
|
|
1364
1570
|
};
|
|
1365
1571
|
const App = () => {
|
|
1366
|
-
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
1572
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin$1.Page.Protect, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Routes, { children: [
|
|
1367
1573
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { index: true, element: /* @__PURE__ */ jsxRuntime.jsx(ReleasesPage, {}) }),
|
|
1368
1574
|
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { path: ":releaseId", element: /* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsPage, {}) })
|
|
1369
1575
|
] }) });
|
|
1370
1576
|
};
|
|
1371
1577
|
exports.App = App;
|
|
1372
|
-
//# sourceMappingURL=App-
|
|
1578
|
+
//# sourceMappingURL=App-SGjO5UPV.js.map
|