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