@strapi/content-releases 0.0.0-experimental.bd712ad3930045f4a5d2144c119e0b7856e97fc4 → 0.0.0-experimental.c222e1c4de12dd05c26938a605a1128fb3481d1d
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-zzUitryC.js → App-BKB1esYS.js} +178 -108
- package/dist/_chunks/App-BKB1esYS.js.map +1 -0
- package/dist/_chunks/{App-6gbM0io-.mjs → App-Cne--1Z8.mjs} +182 -112
- package/dist/_chunks/App-Cne--1Z8.mjs.map +1 -0
- package/dist/_chunks/{SettingsPage-CuSH193e.mjs → ReleasesSettingsPage-C1WwGWIH.mjs} +35 -14
- package/dist/_chunks/ReleasesSettingsPage-C1WwGWIH.mjs.map +1 -0
- package/dist/_chunks/{SettingsPage-CTOl3Qtw.js → ReleasesSettingsPage-kuXIwpWp.js} +35 -14
- package/dist/_chunks/ReleasesSettingsPage-kuXIwpWp.js.map +1 -0
- package/dist/_chunks/{en-1_1re1mc.js → en-CmYoEnA7.js} +3 -1
- package/dist/_chunks/en-CmYoEnA7.js.map +1 -0
- package/dist/_chunks/{en-C3sq5KNP.mjs → en-D0yVZFqf.mjs} +3 -1
- package/dist/_chunks/en-D0yVZFqf.mjs.map +1 -0
- package/dist/_chunks/{index-BxRiXenX.js → index-5Odi61vw.js} +289 -26
- package/dist/_chunks/index-5Odi61vw.js.map +1 -0
- package/dist/_chunks/{index-CuchqQ4_.mjs → index-Cy7qwpaU.mjs} +303 -40
- package/dist/_chunks/index-Cy7qwpaU.mjs.map +1 -0
- package/dist/_chunks/{validation-schemas-bib1fBc7.js → schemas-BE1LxE9J.js} +21 -6
- package/dist/_chunks/schemas-BE1LxE9J.js.map +1 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs +44 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/components/ReleaseListCell.d.ts +28 -0
- package/dist/admin/src/constants.d.ts +18 -0
- package/dist/admin/src/modules/hooks.d.ts +7 -0
- package/dist/admin/src/pages/ReleasesSettingsPage.d.ts +1 -0
- package/dist/admin/src/services/release.d.ts +34 -32
- package/dist/admin/src/validation/schemas.d.ts +6 -0
- package/dist/server/index.js +129 -103
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +129 -103
- 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/controllers/validation/release.d.ts +1 -0
- package/dist/server/src/controllers/validation/release.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/settings.d.ts +1 -0
- package/dist/server/src/controllers/validation/settings.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -0
- package/dist/server/src/index.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 +2 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts +3 -1
- 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 +3 -5
- 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/dist/shared/contracts/settings.d.ts +1 -1
- package/dist/shared/contracts/settings.d.ts.map +1 -1
- package/package.json +16 -15
- package/dist/_chunks/App-6gbM0io-.mjs.map +0 -1
- package/dist/_chunks/App-zzUitryC.js.map +0 -1
- package/dist/_chunks/SettingsPage-CTOl3Qtw.js.map +0 -1
- package/dist/_chunks/SettingsPage-CuSH193e.mjs.map +0 -1
- package/dist/_chunks/en-1_1re1mc.js.map +0 -1
- package/dist/_chunks/en-C3sq5KNP.mjs.map +0 -1
- package/dist/_chunks/index-BxRiXenX.js.map +0 -1
- package/dist/_chunks/index-CuchqQ4_.mjs.map +0 -1
- package/dist/_chunks/validation-schemas-C7P2rhPu.mjs +0 -29
- package/dist/_chunks/validation-schemas-C7P2rhPu.mjs.map +0 -1
- package/dist/_chunks/validation-schemas-bib1fBc7.js.map +0 -1
- package/dist/admin/src/pages/SettingsPage.d.ts +0 -1
- package/dist/shared/validation-schemas.d.ts +0 -3
- package/dist/shared/validation-schemas.d.ts.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -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-5Odi61vw.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");
|
|
@@ -15,7 +15,7 @@ const reactIntl = require("react-intl");
|
|
|
15
15
|
const styledComponents = require("styled-components");
|
|
16
16
|
const dateFns = require("date-fns");
|
|
17
17
|
const formik = require("formik");
|
|
18
|
-
const
|
|
18
|
+
const schemas = require("./schemas-BE1LxE9J.js");
|
|
19
19
|
const reactRedux = require("react-redux");
|
|
20
20
|
const ee = require("@strapi/admin/strapi-admin/ee");
|
|
21
21
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -117,19 +117,27 @@ const ReleaseModal = ({
|
|
|
117
117
|
...initialValues,
|
|
118
118
|
timezone: initialValues.timezone ? getTimezoneWithOffset() : systemTimezone.value
|
|
119
119
|
},
|
|
120
|
-
validationSchema:
|
|
120
|
+
validationSchema: schemas.RELEASE_SCHEMA,
|
|
121
121
|
validateOnChange: false,
|
|
122
122
|
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
123
123
|
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
124
124
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
125
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
126
|
+
designSystem.Field.Root,
|
|
127
|
+
{
|
|
128
|
+
name: "name",
|
|
129
|
+
error: errors.name && formatMessage({ id: errors.name, defaultMessage: errors.name }),
|
|
130
|
+
required: true,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
133
|
+
id: "content-releases.modal.form.input.label.release-name",
|
|
134
|
+
defaultMessage: "Name"
|
|
135
|
+
}) }),
|
|
136
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
133
141
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
142
|
designSystem.Checkbox,
|
|
135
143
|
{
|
|
@@ -165,54 +173,70 @@ const ReleaseModal = ({
|
|
|
165
173
|
) }),
|
|
166
174
|
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
167
175
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
168
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
177
|
+
designSystem.Field.Root,
|
|
178
|
+
{
|
|
179
|
+
name: "date",
|
|
180
|
+
error: errors.date && formatMessage({ id: errors.date, defaultMessage: errors.date }),
|
|
181
|
+
required: true,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
184
|
+
id: "content-releases.modal.form.input.label.date",
|
|
185
|
+
defaultMessage: "Date"
|
|
186
|
+
}) }),
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
designSystem.DatePicker,
|
|
189
|
+
{
|
|
190
|
+
onChange: (date) => {
|
|
191
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
192
|
+
setFieldValue("date", isoFormatDate);
|
|
193
|
+
},
|
|
194
|
+
clearLabel: formatMessage({
|
|
195
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
196
|
+
defaultMessage: "Clear"
|
|
197
|
+
}),
|
|
198
|
+
onClear: () => {
|
|
199
|
+
setFieldValue("date", null);
|
|
200
|
+
},
|
|
201
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
202
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
) }),
|
|
209
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
210
|
+
designSystem.Field.Root,
|
|
211
|
+
{
|
|
212
|
+
name: "time",
|
|
213
|
+
error: errors.time && formatMessage({ id: errors.time, defaultMessage: errors.time }),
|
|
214
|
+
required: true,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
217
|
+
id: "content-releases.modal.form.input.label.time",
|
|
218
|
+
defaultMessage: "Time"
|
|
219
|
+
}) }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
designSystem.TimePicker,
|
|
222
|
+
{
|
|
223
|
+
onChange: (time) => {
|
|
224
|
+
setFieldValue("time", time);
|
|
225
|
+
},
|
|
226
|
+
clearLabel: formatMessage({
|
|
227
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
228
|
+
defaultMessage: "Clear"
|
|
229
|
+
}),
|
|
230
|
+
onClear: () => {
|
|
231
|
+
setFieldValue("time", "");
|
|
232
|
+
},
|
|
233
|
+
value: values.time || void 0
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
) })
|
|
216
240
|
] }),
|
|
217
241
|
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
218
242
|
] })
|
|
@@ -247,31 +271,39 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
247
271
|
}
|
|
248
272
|
}
|
|
249
273
|
}, [setFieldValue, values.date, values.timezone]);
|
|
250
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
274
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
275
|
+
designSystem.Field.Root,
|
|
276
|
+
{
|
|
277
|
+
name: "timezone",
|
|
278
|
+
error: errors.timezone && formatMessage({ id: errors.timezone, defaultMessage: errors.timezone }),
|
|
279
|
+
required: true,
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
282
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
283
|
+
defaultMessage: "Timezone"
|
|
284
|
+
}) }),
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
+
designSystem.Combobox,
|
|
287
|
+
{
|
|
288
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
289
|
+
value: values.timezone || void 0,
|
|
290
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
291
|
+
onChange: (timezone) => {
|
|
292
|
+
setFieldValue("timezone", timezone);
|
|
293
|
+
},
|
|
294
|
+
onTextValueChange: (timezone) => {
|
|
295
|
+
setFieldValue("timezone", timezone);
|
|
296
|
+
},
|
|
297
|
+
onClear: () => {
|
|
298
|
+
setFieldValue("timezone", "");
|
|
299
|
+
},
|
|
300
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
275
307
|
};
|
|
276
308
|
const useTypedDispatch = reactRedux.useDispatch;
|
|
277
309
|
const isBaseQueryError = (error) => {
|
|
@@ -333,7 +365,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
333
365
|
}
|
|
334
366
|
);
|
|
335
367
|
}
|
|
336
|
-
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(
|
|
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, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
337
369
|
designSystem.Flex,
|
|
338
370
|
{
|
|
339
371
|
direction: "column",
|
|
@@ -369,7 +401,7 @@ const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
|
369
401
|
`;
|
|
370
402
|
const INITIAL_FORM_VALUES = {
|
|
371
403
|
name: "",
|
|
372
|
-
date:
|
|
404
|
+
date: dateFns.format(/* @__PURE__ */ new Date(), "yyyy-MM-dd"),
|
|
373
405
|
time: "",
|
|
374
406
|
isScheduled: true,
|
|
375
407
|
scheduledAt: null,
|
|
@@ -384,6 +416,7 @@ const ReleasesPage = () => {
|
|
|
384
416
|
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
385
417
|
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
386
418
|
const response = index.useGetReleasesQuery(query);
|
|
419
|
+
const { data, isLoading: isLoadingSettings } = index.useGetReleaseSettingsQuery();
|
|
387
420
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
388
421
|
const { getFeature } = ee.useLicenseLimits();
|
|
389
422
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
@@ -391,7 +424,7 @@ const ReleasesPage = () => {
|
|
|
391
424
|
const {
|
|
392
425
|
allowedActions: { canCreate }
|
|
393
426
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
394
|
-
const { isLoading, isSuccess, isError } = response;
|
|
427
|
+
const { isLoading: isLoadingReleases, isSuccess, isError } = response;
|
|
395
428
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
396
429
|
React__namespace.useEffect(() => {
|
|
397
430
|
if (location?.state?.errors) {
|
|
@@ -412,7 +445,7 @@ const ReleasesPage = () => {
|
|
|
412
445
|
const toggleAddReleaseModal = () => {
|
|
413
446
|
setReleaseModalShown((prev) => !prev);
|
|
414
447
|
};
|
|
415
|
-
if (
|
|
448
|
+
if (isLoadingReleases || isLoadingSettings) {
|
|
416
449
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
417
450
|
}
|
|
418
451
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
@@ -457,7 +490,7 @@ const ReleasesPage = () => {
|
|
|
457
490
|
});
|
|
458
491
|
}
|
|
459
492
|
};
|
|
460
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy":
|
|
493
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingReleases || isLoadingSettings, children: [
|
|
461
494
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
462
495
|
strapiAdmin.Layouts.Header,
|
|
463
496
|
{
|
|
@@ -572,7 +605,10 @@ const ReleasesPage = () => {
|
|
|
572
605
|
handleClose: toggleAddReleaseModal,
|
|
573
606
|
handleSubmit: handleAddRelease,
|
|
574
607
|
isLoading: isSubmittingForm,
|
|
575
|
-
initialValues:
|
|
608
|
+
initialValues: {
|
|
609
|
+
...INITIAL_FORM_VALUES,
|
|
610
|
+
timezone: data?.data.defaultTimezone ? data.data.defaultTimezone.split("&")[1] : null
|
|
611
|
+
}
|
|
576
612
|
}
|
|
577
613
|
)
|
|
578
614
|
] });
|
|
@@ -596,15 +632,15 @@ const StyledMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
|
596
632
|
}
|
|
597
633
|
`;
|
|
598
634
|
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
599
|
-
width: ${({ theme }) => theme.spaces[
|
|
600
|
-
height: ${({ theme }) => theme.spaces[
|
|
635
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
636
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
601
637
|
path {
|
|
602
638
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
603
639
|
}
|
|
604
640
|
`;
|
|
605
641
|
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
606
|
-
width: ${({ theme }) => theme.spaces[
|
|
607
|
-
height: ${({ theme }) => theme.spaces[
|
|
642
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
643
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
608
644
|
path {
|
|
609
645
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
610
646
|
}
|
|
@@ -624,19 +660,37 @@ const EntryValidationText = ({ action, schema, entry, status }) => {
|
|
|
624
660
|
skip: true
|
|
625
661
|
}
|
|
626
662
|
);
|
|
663
|
+
const errorsToString = (errors2, prefix = "") => {
|
|
664
|
+
if (Object.keys(errors2).length === 0) {
|
|
665
|
+
return "";
|
|
666
|
+
}
|
|
667
|
+
return Object.entries(errors2).map(([key, value]) => {
|
|
668
|
+
if (value === void 0 || value === null) {
|
|
669
|
+
return "";
|
|
670
|
+
}
|
|
671
|
+
if (typeof value === "string") {
|
|
672
|
+
return formatMessage(
|
|
673
|
+
{ id: value, defaultMessage: value },
|
|
674
|
+
{ field: prefix ? `${prefix}.${key}` : key }
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
if (typeof value === "object" && value !== null && "id" in value && "defaultMessage" in value) {
|
|
678
|
+
return formatMessage(
|
|
679
|
+
// @ts-expect-error – TODO: default message will be a string
|
|
680
|
+
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
681
|
+
{ field: prefix ? `${prefix}.${key}` : key }
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
return errorsToString(value, key);
|
|
685
|
+
}).join(" ");
|
|
686
|
+
};
|
|
627
687
|
if (isLoading) {
|
|
628
688
|
return null;
|
|
629
689
|
}
|
|
630
690
|
const errors = validate(entry) ?? {};
|
|
631
691
|
if (action === "publish") {
|
|
632
692
|
if (Object.keys(errors).length > 0) {
|
|
633
|
-
const validationErrorsMessages =
|
|
634
|
-
([key, value]) => formatMessage(
|
|
635
|
-
// @ts-expect-error – TODO: fix this will better checks
|
|
636
|
-
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
637
|
-
{ field: key }
|
|
638
|
-
)
|
|
639
|
-
).join(" ");
|
|
693
|
+
const validationErrorsMessages = errorsToString(errors);
|
|
640
694
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
641
695
|
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
642
696
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -824,13 +878,13 @@ const ReleaseDetailsLayout = ({
|
|
|
824
878
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
825
879
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
826
880
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
827
|
-
|
|
881
|
+
SimpleMenuButton,
|
|
828
882
|
{
|
|
829
883
|
label: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {}),
|
|
830
884
|
variant: "tertiary",
|
|
831
885
|
endIcon: null,
|
|
832
|
-
paddingLeft:
|
|
833
|
-
paddingRight:
|
|
886
|
+
paddingLeft: "7px",
|
|
887
|
+
paddingRight: "7px",
|
|
834
888
|
"aria-label": formatMessage({
|
|
835
889
|
id: "content-releases.header.actions.open-release-actions",
|
|
836
890
|
defaultMessage: "Release edit and delete menu"
|
|
@@ -866,7 +920,7 @@ const ReleaseDetailsLayout = ({
|
|
|
866
920
|
justifyContent: "center",
|
|
867
921
|
alignItems: "flex-start",
|
|
868
922
|
gap: 1,
|
|
869
|
-
padding:
|
|
923
|
+
padding: 4,
|
|
870
924
|
children: [
|
|
871
925
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
872
926
|
id: "content-releases.header.actions.created",
|
|
@@ -912,6 +966,11 @@ const ReleaseDetailsLayout = ({
|
|
|
912
966
|
children
|
|
913
967
|
] });
|
|
914
968
|
};
|
|
969
|
+
const SimpleMenuButton = styledComponents.styled(designSystem.SimpleMenu)`
|
|
970
|
+
& > span {
|
|
971
|
+
display: flex;
|
|
972
|
+
}
|
|
973
|
+
`;
|
|
915
974
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
916
975
|
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
917
976
|
const getGroupByOptionLabel = (value) => {
|
|
@@ -1212,13 +1271,24 @@ const ReleaseDetailsPage = () => {
|
|
|
1212
1271
|
skip: !releaseId
|
|
1213
1272
|
}
|
|
1214
1273
|
);
|
|
1274
|
+
const { data: dataTimezone, isLoading: isLoadingTimezone } = index.useGetReleaseSettingsQuery();
|
|
1215
1275
|
const [updateRelease, { isLoading: isSubmittingForm }] = index.useUpdateReleaseMutation();
|
|
1216
1276
|
const [deleteRelease] = index.useDeleteReleaseMutation();
|
|
1217
1277
|
const toggleEditReleaseModal = () => {
|
|
1218
1278
|
setReleaseModalShown((prev) => !prev);
|
|
1219
1279
|
};
|
|
1280
|
+
const getTimezoneValue = () => {
|
|
1281
|
+
if (releaseData?.timezone) {
|
|
1282
|
+
return releaseData.timezone;
|
|
1283
|
+
} else {
|
|
1284
|
+
if (dataTimezone?.data.defaultTimezone) {
|
|
1285
|
+
return dataTimezone.data.defaultTimezone;
|
|
1286
|
+
}
|
|
1287
|
+
return null;
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1220
1290
|
const toggleWarningSubmit = () => setWarningSubmit((prevState) => !prevState);
|
|
1221
|
-
if (isLoadingDetails) {
|
|
1291
|
+
if (isLoadingDetails || isLoadingTimezone) {
|
|
1222
1292
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1223
1293
|
ReleaseDetailsLayout,
|
|
1224
1294
|
{
|
|
@@ -1233,7 +1303,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1233
1303
|
}
|
|
1234
1304
|
const releaseData = isSuccessDetails && data?.data || null;
|
|
1235
1305
|
const title = releaseData?.name || "";
|
|
1236
|
-
const timezone =
|
|
1306
|
+
const timezone = getTimezoneValue();
|
|
1237
1307
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1238
1308
|
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1239
1309
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
@@ -1322,4 +1392,4 @@ const App = () => {
|
|
|
1322
1392
|
] }) });
|
|
1323
1393
|
};
|
|
1324
1394
|
exports.App = App;
|
|
1325
|
-
//# sourceMappingURL=App-
|
|
1395
|
+
//# sourceMappingURL=App-BKB1esYS.js.map
|