@strapi/content-releases 5.0.0-beta.6 → 5.0.0-beta.8
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-CbOy9Yd2.js → App-DUmziQ17.js} +170 -170
- package/dist/_chunks/App-DUmziQ17.js.map +1 -0
- package/dist/_chunks/{App-CVlffj0R.mjs → App-D_6Y9N2F.mjs} +165 -164
- package/dist/_chunks/App-D_6Y9N2F.mjs.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-DAHdUpAA.js → PurchaseContentReleases-Be3acS2L.js} +4 -3
- package/dist/_chunks/PurchaseContentReleases-Be3acS2L.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Ex09YpKR.mjs → PurchaseContentReleases-_MxP6-Dt.mjs} +5 -4
- package/dist/_chunks/PurchaseContentReleases-_MxP6-Dt.mjs.map +1 -0
- package/dist/_chunks/{index-B7mc1tVq.mjs → index-BomF0-yY.mjs} +86 -307
- package/dist/_chunks/index-BomF0-yY.mjs.map +1 -0
- package/dist/_chunks/{index-Bwn36oqx.js → index-C5Hc767q.js} +83 -306
- package/dist/_chunks/index-C5Hc767q.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +1 -1
- package/dist/admin/src/components/ReleaseModal.d.ts +1 -1
- package/dist/admin/src/services/release.d.ts +36 -360
- package/dist/admin/src/utils/api.d.ts +6 -0
- package/package.json +15 -17
- package/dist/_chunks/App-CVlffj0R.mjs.map +0 -1
- package/dist/_chunks/App-CbOy9Yd2.js.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-DAHdUpAA.js.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-Ex09YpKR.mjs.map +0 -1
- package/dist/_chunks/index-B7mc1tVq.mjs.map +0 -1
- package/dist/_chunks/index-Bwn36oqx.js.map +0 -1
- package/dist/admin/src/services/axios.d.ts +0 -29
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-C5Hc767q.js");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
|
9
9
|
const designSystem = require("@strapi/design-system");
|
|
@@ -12,7 +12,7 @@ const symbols = require("@strapi/icons/symbols");
|
|
|
12
12
|
const format = require("date-fns/format");
|
|
13
13
|
const dateFnsTz = require("date-fns-tz");
|
|
14
14
|
const reactIntl = require("react-intl");
|
|
15
|
-
const
|
|
15
|
+
const styledComponents = require("styled-components");
|
|
16
16
|
const dateFns = require("date-fns");
|
|
17
17
|
const formik = require("formik");
|
|
18
18
|
const yup = require("yup");
|
|
@@ -39,7 +39,6 @@ function _interopNamespace(e) {
|
|
|
39
39
|
}
|
|
40
40
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
41
41
|
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
42
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
43
42
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
44
43
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
45
44
|
const RelativeTime$1 = React__namespace.forwardRef(
|
|
@@ -140,120 +139,119 @@ const ReleaseModal = ({
|
|
|
140
139
|
},
|
|
141
140
|
validationSchema: RELEASE_SCHEMA,
|
|
142
141
|
validateOnChange: false,
|
|
143
|
-
children: ({ values, errors, handleChange, setFieldValue }) =>
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
146
|
-
designSystem.
|
|
147
|
-
|
|
148
|
-
label: formatMessage({
|
|
142
|
+
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
143
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
145
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
|
|
146
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
149
147
|
id: "content-releases.modal.form.input.label.release-name",
|
|
150
148
|
defaultMessage: "Name"
|
|
151
|
-
}),
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
designSystem.DatePicker,
|
|
193
|
-
{
|
|
194
|
-
label: formatMessage({
|
|
149
|
+
}) }),
|
|
150
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
152
|
+
] }),
|
|
153
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
154
|
+
designSystem.Checkbox,
|
|
155
|
+
{
|
|
156
|
+
name: "isScheduled",
|
|
157
|
+
value: values.isScheduled,
|
|
158
|
+
onChange: (event) => {
|
|
159
|
+
setFieldValue("isScheduled", event.target.checked);
|
|
160
|
+
if (!event.target.checked) {
|
|
161
|
+
setFieldValue("date", null);
|
|
162
|
+
setFieldValue("time", "");
|
|
163
|
+
setFieldValue("timezone", null);
|
|
164
|
+
} else {
|
|
165
|
+
setFieldValue("date", initialValues.date);
|
|
166
|
+
setFieldValue("time", initialValues.time);
|
|
167
|
+
setFieldValue(
|
|
168
|
+
"timezone",
|
|
169
|
+
initialValues.timezone ?? systemTimezone?.value
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
174
|
+
designSystem.Typography,
|
|
175
|
+
{
|
|
176
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
177
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
178
|
+
children: formatMessage({
|
|
179
|
+
id: "modal.form.input.label.schedule-release",
|
|
180
|
+
defaultMessage: "Schedule release"
|
|
181
|
+
})
|
|
182
|
+
}
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
) }),
|
|
186
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
188
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "date", error: errors.date, required: true, children: [
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
195
190
|
id: "content-releases.modal.form.input.label.date",
|
|
196
191
|
defaultMessage: "Date"
|
|
197
|
-
}),
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
{
|
|
219
|
-
|
|
192
|
+
}) }),
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
+
designSystem.DatePicker,
|
|
195
|
+
{
|
|
196
|
+
onChange: (date) => {
|
|
197
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
198
|
+
setFieldValue("date", isoFormatDate);
|
|
199
|
+
},
|
|
200
|
+
clearLabel: formatMessage({
|
|
201
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
202
|
+
defaultMessage: "Clear"
|
|
203
|
+
}),
|
|
204
|
+
onClear: () => {
|
|
205
|
+
setFieldValue("date", null);
|
|
206
|
+
},
|
|
207
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
208
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
209
|
+
}
|
|
210
|
+
),
|
|
211
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
212
|
+
] }) }),
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "time", error: errors.time, required: true, children: [
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
220
215
|
id: "content-releases.modal.form.input.label.time",
|
|
221
216
|
defaultMessage: "Time"
|
|
222
|
-
}),
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
217
|
+
}) }),
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
219
|
+
designSystem.TimePicker,
|
|
220
|
+
{
|
|
221
|
+
onChange: (time) => {
|
|
222
|
+
setFieldValue("time", time);
|
|
223
|
+
},
|
|
224
|
+
clearLabel: formatMessage({
|
|
225
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
226
|
+
defaultMessage: "Clear"
|
|
227
|
+
}),
|
|
228
|
+
onClear: () => {
|
|
229
|
+
setFieldValue("time", "");
|
|
230
|
+
},
|
|
231
|
+
value: values.time || void 0
|
|
232
|
+
}
|
|
233
|
+
),
|
|
234
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
235
|
+
] }) })
|
|
236
|
+
] }),
|
|
237
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
238
|
+
] })
|
|
239
|
+
] }) }),
|
|
240
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
241
|
+
designSystem.ModalFooter,
|
|
242
|
+
{
|
|
243
|
+
startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }),
|
|
244
|
+
endActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
245
|
+
{
|
|
246
|
+
id: "content-releases.modal.form.button.submit",
|
|
247
|
+
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
248
|
+
},
|
|
249
|
+
{ isCreatingRelease }
|
|
238
250
|
) })
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
244
|
-
designSystem.ModalFooter,
|
|
245
|
-
{
|
|
246
|
-
startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }),
|
|
247
|
-
endActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
248
|
-
{
|
|
249
|
-
id: "content-releases.modal.form.button.submit",
|
|
250
|
-
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
251
|
-
},
|
|
252
|
-
{ isCreatingRelease }
|
|
253
|
-
) })
|
|
254
|
-
}
|
|
255
|
-
)
|
|
256
|
-
] })
|
|
251
|
+
}
|
|
252
|
+
)
|
|
253
|
+
] });
|
|
254
|
+
}
|
|
257
255
|
}
|
|
258
256
|
)
|
|
259
257
|
] });
|
|
@@ -282,37 +280,40 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
282
280
|
}
|
|
283
281
|
}
|
|
284
282
|
}, [setFieldValue, values.date, values.timezone]);
|
|
285
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
286
|
-
designSystem.
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
}
|
|
309
|
-
);
|
|
283
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "timezone", error: errors.timezone, required: true, children: [
|
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
285
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
286
|
+
defaultMessage: "Timezone"
|
|
287
|
+
}) }),
|
|
288
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
289
|
+
designSystem.Combobox,
|
|
290
|
+
{
|
|
291
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
292
|
+
value: values.timezone || void 0,
|
|
293
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
294
|
+
onChange: (timezone) => {
|
|
295
|
+
setFieldValue("timezone", timezone);
|
|
296
|
+
},
|
|
297
|
+
onTextValueChange: (timezone) => {
|
|
298
|
+
setFieldValue("timezone", timezone);
|
|
299
|
+
},
|
|
300
|
+
onClear: () => {
|
|
301
|
+
setFieldValue("timezone", "");
|
|
302
|
+
},
|
|
303
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
304
|
+
}
|
|
305
|
+
),
|
|
306
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
307
|
+
] });
|
|
310
308
|
};
|
|
311
309
|
const useTypedDispatch = reactRedux.useDispatch;
|
|
312
|
-
const
|
|
310
|
+
const isBaseQueryError = (error) => {
|
|
311
|
+
return typeof error !== "undefined" && error.name !== void 0;
|
|
312
|
+
};
|
|
313
|
+
const LinkCard = styledComponents.styled(designSystem.Link)`
|
|
313
314
|
display: block;
|
|
314
315
|
`;
|
|
315
|
-
const RelativeTime =
|
|
316
|
+
const RelativeTime = styledComponents.styled(RelativeTime$1)`
|
|
316
317
|
display: inline-block;
|
|
317
318
|
&::first-letter {
|
|
318
319
|
text-transform: uppercase;
|
|
@@ -365,7 +366,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
365
366
|
}
|
|
366
367
|
);
|
|
367
368
|
}
|
|
368
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, {
|
|
369
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
369
370
|
designSystem.Flex,
|
|
370
371
|
{
|
|
371
372
|
direction: "column",
|
|
@@ -380,7 +381,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
380
381
|
gap: 4,
|
|
381
382
|
children: [
|
|
382
383
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "start", gap: 1, children: [
|
|
383
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
|
384
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
384
385
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
385
386
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
386
387
|
defaultMessage: "Not scheduled"
|
|
@@ -391,7 +392,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
391
392
|
}
|
|
392
393
|
) }) }, id)) });
|
|
393
394
|
};
|
|
394
|
-
const StyledAlert =
|
|
395
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
395
396
|
button {
|
|
396
397
|
display: none;
|
|
397
398
|
}
|
|
@@ -401,7 +402,7 @@ const StyledAlert = styled__default.default(designSystem.Alert)`
|
|
|
401
402
|
`;
|
|
402
403
|
const INITIAL_FORM_VALUES = {
|
|
403
404
|
name: "",
|
|
404
|
-
date:
|
|
405
|
+
date: void 0,
|
|
405
406
|
time: "",
|
|
406
407
|
isScheduled: true,
|
|
407
408
|
scheduledAt: null,
|
|
@@ -484,7 +485,7 @@ const ReleasesPage = () => {
|
|
|
484
485
|
});
|
|
485
486
|
trackUsage("didCreateRelease");
|
|
486
487
|
navigate(response2.data.data.id.toString());
|
|
487
|
-
} else if (
|
|
488
|
+
} else if (strapiAdmin.isFetchError(response2.error)) {
|
|
488
489
|
toggleNotification({
|
|
489
490
|
type: "danger",
|
|
490
491
|
message: formatAPIError(response2.error)
|
|
@@ -498,7 +499,7 @@ const ReleasesPage = () => {
|
|
|
498
499
|
};
|
|
499
500
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoading, children: [
|
|
500
501
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
501
|
-
|
|
502
|
+
strapiAdmin.Layouts.Header,
|
|
502
503
|
{
|
|
503
504
|
title: formatMessage({
|
|
504
505
|
id: "content-releases.pages.Releases.title",
|
|
@@ -522,7 +523,7 @@ const ReleasesPage = () => {
|
|
|
522
523
|
) : null
|
|
523
524
|
}
|
|
524
525
|
),
|
|
525
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
526
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
526
527
|
hasReachedMaximumPendingReleases && /* @__PURE__ */ jsxRuntime.jsx(
|
|
527
528
|
StyledAlert,
|
|
528
529
|
{
|
|
@@ -621,13 +622,13 @@ const ReleasesPage = () => {
|
|
|
621
622
|
)
|
|
622
623
|
] });
|
|
623
624
|
};
|
|
624
|
-
const ReleaseInfoWrapper =
|
|
625
|
+
const ReleaseInfoWrapper = styledComponents.styled(designSystem.Flex)`
|
|
625
626
|
align-self: stretch;
|
|
626
627
|
border-bottom-right-radius: ${({ theme }) => theme.borderRadius};
|
|
627
628
|
border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
|
|
628
629
|
border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
629
630
|
`;
|
|
630
|
-
const StyledMenuItem =
|
|
631
|
+
const StyledMenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
|
631
632
|
svg path {
|
|
632
633
|
fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
|
|
633
634
|
}
|
|
@@ -636,24 +637,24 @@ const StyledMenuItem = styled__default.default(designSystem.Menu.Item)`
|
|
|
636
637
|
}
|
|
637
638
|
|
|
638
639
|
&:hover {
|
|
639
|
-
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
640
|
+
background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
|
|
640
641
|
}
|
|
641
642
|
`;
|
|
642
|
-
const PencilIcon =
|
|
643
|
+
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
643
644
|
width: ${({ theme }) => theme.spaces[3]};
|
|
644
645
|
height: ${({ theme }) => theme.spaces[3]};
|
|
645
646
|
path {
|
|
646
647
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
647
648
|
}
|
|
648
649
|
`;
|
|
649
|
-
const TrashIcon =
|
|
650
|
+
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
650
651
|
width: ${({ theme }) => theme.spaces[3]};
|
|
651
652
|
height: ${({ theme }) => theme.spaces[3]};
|
|
652
653
|
path {
|
|
653
654
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
654
655
|
}
|
|
655
656
|
`;
|
|
656
|
-
const TypographyMaxWidth =
|
|
657
|
+
const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
|
|
657
658
|
max-width: 300px;
|
|
658
659
|
`;
|
|
659
660
|
const EntryValidationText = ({ action, schema, entry }) => {
|
|
@@ -671,6 +672,7 @@ const EntryValidationText = ({ action, schema, entry }) => {
|
|
|
671
672
|
if (Object.keys(errors).length > 0) {
|
|
672
673
|
const validationErrorsMessages = Object.entries(errors).map(
|
|
673
674
|
([key, value]) => formatMessage(
|
|
675
|
+
// @ts-expect-error – TODO: fix this will better checks
|
|
674
676
|
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
675
677
|
{ field: key }
|
|
676
678
|
)
|
|
@@ -713,7 +715,6 @@ const ReleaseDetailsLayout = ({
|
|
|
713
715
|
const {
|
|
714
716
|
data,
|
|
715
717
|
isLoading: isLoadingDetails,
|
|
716
|
-
isError,
|
|
717
718
|
error
|
|
718
719
|
} = index.useGetReleaseQuery(
|
|
719
720
|
{ id: releaseId },
|
|
@@ -745,7 +746,7 @@ const ReleaseDetailsLayout = ({
|
|
|
745
746
|
totalPublishedEntries,
|
|
746
747
|
totalUnpublishedEntries
|
|
747
748
|
});
|
|
748
|
-
} else if (
|
|
749
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
749
750
|
toggleNotification({
|
|
750
751
|
type: "danger",
|
|
751
752
|
message: formatAPIError(response.error)
|
|
@@ -780,7 +781,7 @@ const ReleaseDetailsLayout = ({
|
|
|
780
781
|
if (isLoadingDetails) {
|
|
781
782
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
782
783
|
}
|
|
783
|
-
if (
|
|
784
|
+
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
784
785
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
785
786
|
reactRouterDom.Navigate,
|
|
786
787
|
{
|
|
@@ -788,6 +789,7 @@ const ReleaseDetailsLayout = ({
|
|
|
788
789
|
state: {
|
|
789
790
|
errors: [
|
|
790
791
|
{
|
|
792
|
+
// @ts-expect-error – TODO: fix this weird error flow
|
|
791
793
|
code: error?.code
|
|
792
794
|
}
|
|
793
795
|
]
|
|
@@ -827,7 +829,7 @@ const ReleaseDetailsLayout = ({
|
|
|
827
829
|
) : "";
|
|
828
830
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
829
831
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
830
|
-
|
|
832
|
+
strapiAdmin.Layouts.Header,
|
|
831
833
|
{
|
|
832
834
|
title: release.name,
|
|
833
835
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
@@ -840,15 +842,14 @@ const ReleaseDetailsLayout = ({
|
|
|
840
842
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
841
843
|
designSystem.Menu.Trigger,
|
|
842
844
|
{
|
|
843
|
-
as: designSystem.IconButton,
|
|
844
845
|
paddingLeft: 2,
|
|
845
846
|
paddingRight: 2,
|
|
846
847
|
"aria-label": formatMessage({
|
|
847
848
|
id: "content-releases.header.actions.open-release-actions",
|
|
848
849
|
defaultMessage: "Release edit and delete menu"
|
|
849
850
|
}),
|
|
850
|
-
|
|
851
|
-
|
|
851
|
+
variant: "tertiary",
|
|
852
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
852
853
|
}
|
|
853
854
|
),
|
|
854
855
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { top: 1, popoverPlacement: "bottom-end", maxHeight: void 0, children: [
|
|
@@ -873,7 +874,7 @@ const ReleaseDetailsLayout = ({
|
|
|
873
874
|
{
|
|
874
875
|
disabled: !canDelete,
|
|
875
876
|
onSelect: toggleWarningSubmit,
|
|
876
|
-
variant: "danger",
|
|
877
|
+
$variant: "danger",
|
|
877
878
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
878
879
|
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
879
880
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
@@ -966,7 +967,6 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
966
967
|
const {
|
|
967
968
|
data: releaseData,
|
|
968
969
|
isLoading: isReleaseLoading,
|
|
969
|
-
isError: isReleaseError,
|
|
970
970
|
error: releaseError
|
|
971
971
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
972
972
|
const {
|
|
@@ -1014,7 +1014,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1014
1014
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
1015
1015
|
});
|
|
1016
1016
|
if ("error" in response) {
|
|
1017
|
-
if (
|
|
1017
|
+
if (strapiAdmin.isFetchError(response.error)) {
|
|
1018
1018
|
toggleNotification({
|
|
1019
1019
|
type: "danger",
|
|
1020
1020
|
message: formatAPIError(response.error)
|
|
@@ -1034,14 +1034,14 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1034
1034
|
const releaseMeta = data?.meta;
|
|
1035
1035
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
1036
1036
|
const components = releaseMeta?.components || {};
|
|
1037
|
-
if (
|
|
1037
|
+
if (isBaseQueryError(releaseError) || !release) {
|
|
1038
1038
|
const errorsArray = [];
|
|
1039
|
-
if (releaseError) {
|
|
1039
|
+
if (releaseError && "code" in releaseError) {
|
|
1040
1040
|
errorsArray.push({
|
|
1041
1041
|
code: releaseError.code
|
|
1042
1042
|
});
|
|
1043
1043
|
}
|
|
1044
|
-
if (releaseActionsError) {
|
|
1044
|
+
if (releaseActionsError && "code" in releaseActionsError) {
|
|
1045
1045
|
errorsArray.push({
|
|
1046
1046
|
code: releaseActionsError.code
|
|
1047
1047
|
});
|
|
@@ -1060,13 +1060,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1060
1060
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
1061
1061
|
}
|
|
1062
1062
|
if (Object.keys(releaseActions).length === 0) {
|
|
1063
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1063
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1064
1064
|
designSystem.EmptyStateLayout,
|
|
1065
1065
|
{
|
|
1066
1066
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1067
1067
|
designSystem.LinkButton,
|
|
1068
1068
|
{
|
|
1069
|
-
|
|
1069
|
+
tag: reactRouterDom.Link,
|
|
1070
1070
|
to: {
|
|
1071
1071
|
pathname: "/content-manager"
|
|
1072
1072
|
},
|
|
@@ -1124,7 +1124,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1124
1124
|
] : []
|
|
1125
1125
|
];
|
|
1126
1126
|
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1127
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1127
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1128
1128
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1129
1129
|
designSystem.SingleSelect,
|
|
1130
1130
|
{
|
|
@@ -1269,7 +1269,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1269
1269
|
const title = releaseData?.name || "";
|
|
1270
1270
|
const timezone = releaseData?.timezone ?? null;
|
|
1271
1271
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1272
|
-
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") :
|
|
1272
|
+
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1273
1273
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
1274
1274
|
const handleEditRelease = async (values) => {
|
|
1275
1275
|
const response = await updateRelease({
|
|
@@ -1287,7 +1287,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1287
1287
|
})
|
|
1288
1288
|
});
|
|
1289
1289
|
toggleEditReleaseModal();
|
|
1290
|
-
} else if (
|
|
1290
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1291
1291
|
toggleNotification({
|
|
1292
1292
|
type: "danger",
|
|
1293
1293
|
message: formatAPIError(response.error)
|
|
@@ -1305,7 +1305,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1305
1305
|
});
|
|
1306
1306
|
if ("data" in response) {
|
|
1307
1307
|
navigate("..");
|
|
1308
|
-
} else if (
|
|
1308
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1309
1309
|
toggleNotification({
|
|
1310
1310
|
type: "danger",
|
|
1311
1311
|
message: formatAPIError(response.error)
|
|
@@ -1363,4 +1363,4 @@ const App = () => {
|
|
|
1363
1363
|
] }) });
|
|
1364
1364
|
};
|
|
1365
1365
|
exports.App = App;
|
|
1366
|
-
//# sourceMappingURL=App-
|
|
1366
|
+
//# sourceMappingURL=App-DUmziQ17.js.map
|