@strapi/content-releases 4.20.1 → 4.20.3
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-1hHIqUoZ.js → App-C_iroyIu.js} +271 -55
- package/dist/_chunks/App-C_iroyIu.js.map +1 -0
- package/dist/_chunks/{App-U6GbyLIE.mjs → App-hWBsb1nt.mjs} +272 -57
- package/dist/_chunks/App-hWBsb1nt.mjs.map +1 -0
- package/dist/_chunks/{en-GqXgfmzl.mjs → en-UyU8mm8l.mjs} +11 -2
- package/dist/_chunks/en-UyU8mm8l.mjs.map +1 -0
- package/dist/_chunks/{en-bDhIlw-B.js → en-oj7ZfWI3.js} +11 -2
- package/dist/_chunks/en-oj7ZfWI3.js.map +1 -0
- package/dist/_chunks/{index-l-FvkQlQ.js → index-SDpSekBU.js} +73 -10
- package/dist/_chunks/index-SDpSekBU.js.map +1 -0
- package/dist/_chunks/{index-gkExFBa0.mjs → index-rEfNT9PC.mjs} +77 -14
- package/dist/_chunks/index-rEfNT9PC.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/server/index.js +470 -414
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +470 -414
- package/dist/server/index.mjs.map +1 -1
- package/package.json +11 -9
- package/dist/_chunks/App-1hHIqUoZ.js.map +0 -1
- package/dist/_chunks/App-U6GbyLIE.mjs.map +0 -1
- package/dist/_chunks/en-GqXgfmzl.mjs.map +0 -1
- package/dist/_chunks/en-bDhIlw-B.js.map +0 -1
- package/dist/_chunks/index-gkExFBa0.mjs.map +0 -1
- package/dist/_chunks/index-l-FvkQlQ.js.map +0 -1
|
@@ -3,14 +3,17 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const helperPlugin = require("@strapi/helper-plugin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-SDpSekBU.js");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
9
9
|
const designSystem = require("@strapi/design-system");
|
|
10
10
|
const v2 = require("@strapi/design-system/v2");
|
|
11
11
|
const icons = require("@strapi/icons");
|
|
12
|
+
const format = require("date-fns/format");
|
|
13
|
+
const dateFnsTz = require("date-fns-tz");
|
|
12
14
|
const reactIntl = require("react-intl");
|
|
13
15
|
const styled = require("styled-components");
|
|
16
|
+
const dateFns = require("date-fns");
|
|
14
17
|
const formik = require("formik");
|
|
15
18
|
const yup = require("yup");
|
|
16
19
|
require("@reduxjs/toolkit/query");
|
|
@@ -37,15 +40,26 @@ function _interopNamespace(e) {
|
|
|
37
40
|
return Object.freeze(n);
|
|
38
41
|
}
|
|
39
42
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
43
|
+
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
40
44
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
41
45
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
42
46
|
const RELEASE_SCHEMA = yup__namespace.object().shape({
|
|
43
47
|
name: yup__namespace.string().trim().required(),
|
|
44
|
-
// scheduledAt is a date, but we always receive strings from the client
|
|
45
48
|
scheduledAt: yup__namespace.string().nullable(),
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
+
isScheduled: yup__namespace.boolean().optional(),
|
|
50
|
+
time: yup__namespace.string().when("isScheduled", {
|
|
51
|
+
is: true,
|
|
52
|
+
then: yup__namespace.string().trim().required(),
|
|
53
|
+
otherwise: yup__namespace.string().nullable()
|
|
54
|
+
}),
|
|
55
|
+
timezone: yup__namespace.string().when("isScheduled", {
|
|
56
|
+
is: true,
|
|
57
|
+
then: yup__namespace.string().required().nullable(),
|
|
58
|
+
otherwise: yup__namespace.string().nullable()
|
|
59
|
+
}),
|
|
60
|
+
date: yup__namespace.string().when("isScheduled", {
|
|
61
|
+
is: true,
|
|
62
|
+
then: yup__namespace.string().required().nullable(),
|
|
49
63
|
otherwise: yup__namespace.string().nullable()
|
|
50
64
|
})
|
|
51
65
|
}).required().noUnknown();
|
|
@@ -58,6 +72,24 @@ const ReleaseModal = ({
|
|
|
58
72
|
const { formatMessage } = reactIntl.useIntl();
|
|
59
73
|
const { pathname } = reactRouterDom.useLocation();
|
|
60
74
|
const isCreatingRelease = pathname === `/plugins/${index.pluginId}`;
|
|
75
|
+
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
76
|
+
const { timezoneList, systemTimezone = { value: "UTC+00:00-Africa/Abidjan " } } = getTimezones(
|
|
77
|
+
initialValues.scheduledAt ? new Date(initialValues.scheduledAt) : /* @__PURE__ */ new Date()
|
|
78
|
+
);
|
|
79
|
+
const getScheduledTimestamp = (values) => {
|
|
80
|
+
const { date, time, timezone } = values;
|
|
81
|
+
if (!date || !time || !timezone)
|
|
82
|
+
return null;
|
|
83
|
+
const formattedDate = dateFns.parse(time, "HH:mm", new Date(date));
|
|
84
|
+
const timezoneWithoutOffset = timezone.split("_")[1];
|
|
85
|
+
return dateFnsTz.zonedTimeToUtc(formattedDate, timezoneWithoutOffset);
|
|
86
|
+
};
|
|
87
|
+
const getTimezoneWithOffset = () => {
|
|
88
|
+
const currentTimezone = timezoneList.find(
|
|
89
|
+
(timezone) => timezone.value.split("_")[1] === initialValues.timezone
|
|
90
|
+
);
|
|
91
|
+
return currentTimezone?.value || systemTimezone.value;
|
|
92
|
+
};
|
|
61
93
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy: "title", children: [
|
|
62
94
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "title", fontWeight: "bold", textColor: "neutral800", children: formatMessage(
|
|
63
95
|
{
|
|
@@ -69,45 +101,134 @@ const ReleaseModal = ({
|
|
|
69
101
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
70
102
|
formik.Formik,
|
|
71
103
|
{
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
104
|
+
onSubmit: (values) => {
|
|
105
|
+
handleSubmit({
|
|
106
|
+
...values,
|
|
107
|
+
timezone: values.timezone ? values.timezone.split("_")[1] : null,
|
|
108
|
+
scheduledAt: values.isScheduled ? getScheduledTimestamp(values) : null
|
|
109
|
+
});
|
|
110
|
+
},
|
|
111
|
+
initialValues: {
|
|
112
|
+
...initialValues,
|
|
113
|
+
timezone: initialValues.timezone ? getTimezoneWithOffset() : systemTimezone.value
|
|
114
|
+
},
|
|
75
115
|
validationSchema: RELEASE_SCHEMA,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
116
|
+
validateOnChange: false,
|
|
117
|
+
children: ({ values, errors, handleChange, setFieldValue }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
118
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
119
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
120
|
+
designSystem.TextInput,
|
|
121
|
+
{
|
|
122
|
+
label: formatMessage({
|
|
123
|
+
id: "content-releases.modal.form.input.label.release-name",
|
|
124
|
+
defaultMessage: "Name"
|
|
125
|
+
}),
|
|
126
|
+
name: "name",
|
|
127
|
+
value: values.name,
|
|
128
|
+
error: errors.name,
|
|
129
|
+
onChange: handleChange,
|
|
130
|
+
required: true
|
|
131
|
+
}
|
|
132
|
+
),
|
|
133
|
+
IsSchedulingEnabled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
134
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
135
|
+
designSystem.Checkbox,
|
|
136
|
+
{
|
|
137
|
+
name: "isScheduled",
|
|
138
|
+
value: values.isScheduled,
|
|
139
|
+
onChange: (event) => {
|
|
140
|
+
setFieldValue("isScheduled", event.target.checked);
|
|
141
|
+
if (!event.target.checked) {
|
|
142
|
+
setFieldValue("date", null);
|
|
143
|
+
setFieldValue("time", "");
|
|
144
|
+
setFieldValue("timezone", null);
|
|
145
|
+
} else {
|
|
146
|
+
setFieldValue("date", initialValues.date);
|
|
147
|
+
setFieldValue("time", initialValues.time);
|
|
148
|
+
setFieldValue(
|
|
149
|
+
"timezone",
|
|
150
|
+
initialValues.timezone ?? systemTimezone?.value
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
+
designSystem.Typography,
|
|
156
|
+
{
|
|
157
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
158
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
159
|
+
children: formatMessage({
|
|
160
|
+
id: "modal.form.input.label.schedule-release",
|
|
161
|
+
defaultMessage: "Schedule release"
|
|
162
|
+
})
|
|
163
|
+
}
|
|
164
|
+
)
|
|
165
|
+
}
|
|
166
|
+
) }),
|
|
167
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
168
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
169
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
170
|
+
designSystem.DatePicker,
|
|
171
|
+
{
|
|
172
|
+
label: formatMessage({
|
|
173
|
+
id: "content-releases.modal.form.input.label.date",
|
|
174
|
+
defaultMessage: "Date"
|
|
175
|
+
}),
|
|
176
|
+
name: "date",
|
|
177
|
+
error: errors.date,
|
|
178
|
+
onChange: (date) => {
|
|
179
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
180
|
+
setFieldValue("date", isoFormatDate);
|
|
181
|
+
},
|
|
182
|
+
clearLabel: formatMessage({
|
|
183
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
184
|
+
defaultMessage: "Clear"
|
|
185
|
+
}),
|
|
186
|
+
onClear: () => {
|
|
187
|
+
setFieldValue("date", null);
|
|
188
|
+
},
|
|
189
|
+
selectedDate: values.date || void 0,
|
|
190
|
+
required: true
|
|
191
|
+
}
|
|
192
|
+
) }),
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
194
|
+
designSystem.TimePicker,
|
|
195
|
+
{
|
|
196
|
+
label: formatMessage({
|
|
197
|
+
id: "content-releases.modal.form.input.label.time",
|
|
198
|
+
defaultMessage: "Time"
|
|
199
|
+
}),
|
|
200
|
+
name: "time",
|
|
201
|
+
error: errors.time,
|
|
202
|
+
onChange: (time) => {
|
|
203
|
+
setFieldValue("time", time);
|
|
204
|
+
},
|
|
205
|
+
clearLabel: formatMessage({
|
|
206
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
207
|
+
defaultMessage: "Clear"
|
|
208
|
+
}),
|
|
209
|
+
onClear: () => {
|
|
210
|
+
setFieldValue("time", "");
|
|
211
|
+
},
|
|
212
|
+
value: values.time || void 0,
|
|
213
|
+
required: true
|
|
214
|
+
}
|
|
215
|
+
) })
|
|
216
|
+
] }),
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
218
|
+
] })
|
|
219
|
+
] })
|
|
220
|
+
] }) }),
|
|
91
221
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
92
222
|
designSystem.ModalFooter,
|
|
93
223
|
{
|
|
94
224
|
startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }),
|
|
95
|
-
endActions: /* @__PURE__ */ jsxRuntime.jsx(
|
|
96
|
-
designSystem.Button,
|
|
225
|
+
endActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
97
226
|
{
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
{
|
|
104
|
-
id: "content-releases.modal.form.button.submit",
|
|
105
|
-
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
106
|
-
},
|
|
107
|
-
{ isCreatingRelease }
|
|
108
|
-
)
|
|
109
|
-
}
|
|
110
|
-
)
|
|
227
|
+
id: "content-releases.modal.form.button.submit",
|
|
228
|
+
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
229
|
+
},
|
|
230
|
+
{ isCreatingRelease }
|
|
231
|
+
) })
|
|
111
232
|
}
|
|
112
233
|
)
|
|
113
234
|
] })
|
|
@@ -115,6 +236,52 @@ const ReleaseModal = ({
|
|
|
115
236
|
)
|
|
116
237
|
] });
|
|
117
238
|
};
|
|
239
|
+
const getTimezones = (selectedDate) => {
|
|
240
|
+
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
241
|
+
const utcOffset = index.getTimezoneOffset(timezone, selectedDate);
|
|
242
|
+
return { offset: utcOffset, value: `${utcOffset}_${timezone}` };
|
|
243
|
+
});
|
|
244
|
+
const systemTimezone = timezoneList.find(
|
|
245
|
+
(timezone) => timezone.value.split("_")[1] === Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
246
|
+
);
|
|
247
|
+
return { timezoneList, systemTimezone };
|
|
248
|
+
};
|
|
249
|
+
const TimezoneComponent = ({ timezoneOptions }) => {
|
|
250
|
+
const { values, errors, setFieldValue } = formik.useFormikContext();
|
|
251
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
252
|
+
const [timezoneList, setTimezoneList] = React__namespace.useState(timezoneOptions);
|
|
253
|
+
React__namespace.useEffect(() => {
|
|
254
|
+
if (values.date) {
|
|
255
|
+
const { timezoneList: timezoneList2 } = getTimezones(new Date(values.date));
|
|
256
|
+
setTimezoneList(timezoneList2);
|
|
257
|
+
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("_")[1] === values.timezone.split("_")[1]);
|
|
258
|
+
if (updatedTimezone) {
|
|
259
|
+
setFieldValue("timezone", updatedTimezone.value);
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
}, [setFieldValue, values.date, values.timezone]);
|
|
263
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
264
|
+
designSystem.Combobox,
|
|
265
|
+
{
|
|
266
|
+
label: formatMessage({
|
|
267
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
268
|
+
defaultMessage: "Timezone"
|
|
269
|
+
}),
|
|
270
|
+
name: "timezone",
|
|
271
|
+
value: values.timezone || void 0,
|
|
272
|
+
textValue: values.timezone ? values.timezone.replace("_", " ") : void 0,
|
|
273
|
+
onChange: (timezone) => {
|
|
274
|
+
setFieldValue("timezone", timezone);
|
|
275
|
+
},
|
|
276
|
+
onClear: () => {
|
|
277
|
+
setFieldValue("timezone", "");
|
|
278
|
+
},
|
|
279
|
+
error: errors.timezone,
|
|
280
|
+
required: true,
|
|
281
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace("_", " ") }, timezone.value))
|
|
282
|
+
}
|
|
283
|
+
);
|
|
284
|
+
};
|
|
118
285
|
const ReleaseInfoWrapper = styled__default.default(designSystem.Flex)`
|
|
119
286
|
align-self: stretch;
|
|
120
287
|
border-bottom-right-radius: ${({ theme }) => theme.borderRadius};
|
|
@@ -194,7 +361,7 @@ const ReleaseDetailsLayout = ({
|
|
|
194
361
|
toggleWarningSubmit,
|
|
195
362
|
children
|
|
196
363
|
}) => {
|
|
197
|
-
const { formatMessage } = reactIntl.useIntl();
|
|
364
|
+
const { formatMessage, formatDate, formatTime } = reactIntl.useIntl();
|
|
198
365
|
const { releaseId } = reactRouterDom.useParams();
|
|
199
366
|
const {
|
|
200
367
|
data,
|
|
@@ -276,18 +443,41 @@ const ReleaseDetailsLayout = ({
|
|
|
276
443
|
}
|
|
277
444
|
const totalEntries = release.actions.meta.count || 0;
|
|
278
445
|
const hasCreatedByUser = Boolean(getCreatedByUser());
|
|
446
|
+
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
447
|
+
const isScheduled = release.scheduledAt && release.timezone;
|
|
448
|
+
const numberOfEntriesText = formatMessage(
|
|
449
|
+
{
|
|
450
|
+
id: "content-releases.pages.Details.header-subtitle",
|
|
451
|
+
defaultMessage: "{number, plural, =0 {No entries} one {# entry} other {# entries}}"
|
|
452
|
+
},
|
|
453
|
+
{ number: totalEntries }
|
|
454
|
+
);
|
|
455
|
+
const scheduledText = isScheduled ? formatMessage(
|
|
456
|
+
{
|
|
457
|
+
id: "content-releases.pages.ReleaseDetails.header-subtitle.scheduled",
|
|
458
|
+
defaultMessage: "Scheduled for {date} at {time} ({offset})"
|
|
459
|
+
},
|
|
460
|
+
{
|
|
461
|
+
date: formatDate(new Date(release.scheduledAt), {
|
|
462
|
+
weekday: "long",
|
|
463
|
+
day: "numeric",
|
|
464
|
+
month: "long",
|
|
465
|
+
year: "numeric",
|
|
466
|
+
timeZone: release.timezone
|
|
467
|
+
}),
|
|
468
|
+
time: formatTime(new Date(release.scheduledAt), {
|
|
469
|
+
timeZone: release.timezone,
|
|
470
|
+
hourCycle: "h23"
|
|
471
|
+
}),
|
|
472
|
+
offset: index.getTimezoneOffset(release.timezone, new Date(release.scheduledAt))
|
|
473
|
+
}
|
|
474
|
+
) : "";
|
|
279
475
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
280
476
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
281
477
|
designSystem.HeaderLayout,
|
|
282
478
|
{
|
|
283
479
|
title: release.name,
|
|
284
|
-
subtitle:
|
|
285
|
-
{
|
|
286
|
-
id: "content-releases.pages.Details.header-subtitle",
|
|
287
|
-
defaultMessage: "{number, plural, =0 {No entries} one {# entry} other {# entries}}"
|
|
288
|
-
},
|
|
289
|
-
{ number: totalEntries }
|
|
290
|
-
),
|
|
480
|
+
subtitle: numberOfEntriesText + (IsSchedulingEnabled && isScheduled ? ` - ${scheduledText}` : ""),
|
|
291
481
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}), to: "/plugins/content-releases", children: formatMessage({
|
|
292
482
|
id: "global.back",
|
|
293
483
|
defaultMessage: "Back"
|
|
@@ -736,11 +926,18 @@ const ReleaseDetailsPage = () => {
|
|
|
736
926
|
}
|
|
737
927
|
);
|
|
738
928
|
}
|
|
739
|
-
const
|
|
929
|
+
const releaseData = isSuccessDetails && data?.data || null;
|
|
930
|
+
const title = releaseData?.name || "";
|
|
931
|
+
const timezone = releaseData?.timezone ?? null;
|
|
932
|
+
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
933
|
+
const date = scheduledAt ? new Date(format__default.default(scheduledAt, "yyyy-MM-dd")) : null;
|
|
934
|
+
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
740
935
|
const handleEditRelease = async (values) => {
|
|
741
936
|
const response = await updateRelease({
|
|
742
937
|
id: releaseId,
|
|
743
|
-
name: values.name
|
|
938
|
+
name: values.name,
|
|
939
|
+
scheduledAt: values.scheduledAt,
|
|
940
|
+
timezone: values.timezone
|
|
744
941
|
});
|
|
745
942
|
if ("data" in response) {
|
|
746
943
|
toggleNotification({
|
|
@@ -794,7 +991,14 @@ const ReleaseDetailsPage = () => {
|
|
|
794
991
|
handleClose: toggleEditReleaseModal,
|
|
795
992
|
handleSubmit: handleEditRelease,
|
|
796
993
|
isLoading: isLoadingDetails || isSubmittingForm,
|
|
797
|
-
initialValues: {
|
|
994
|
+
initialValues: {
|
|
995
|
+
name: title || "",
|
|
996
|
+
scheduledAt,
|
|
997
|
+
date,
|
|
998
|
+
time,
|
|
999
|
+
isScheduled: Boolean(scheduledAt),
|
|
1000
|
+
timezone
|
|
1001
|
+
}
|
|
798
1002
|
}
|
|
799
1003
|
),
|
|
800
1004
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -819,6 +1023,7 @@ const LinkCard = styled__default.default(v2.Link)`
|
|
|
819
1023
|
`;
|
|
820
1024
|
const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
821
1025
|
const { formatMessage } = reactIntl.useIntl();
|
|
1026
|
+
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
822
1027
|
if (isError) {
|
|
823
1028
|
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.AnErrorOccurred, {});
|
|
824
1029
|
}
|
|
@@ -839,7 +1044,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
839
1044
|
}
|
|
840
1045
|
);
|
|
841
1046
|
}
|
|
842
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, actions }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { href: `content-releases/${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1047
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, actions, scheduledAt }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { href: `content-releases/${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
843
1048
|
designSystem.Flex,
|
|
844
1049
|
{
|
|
845
1050
|
direction: "column",
|
|
@@ -854,7 +1059,10 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
854
1059
|
gap: 2,
|
|
855
1060
|
children: [
|
|
856
1061
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
857
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: formatMessage(
|
|
1062
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: IsSchedulingEnabled ? scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
1063
|
+
id: "content-releases.pages.Releases.not-scheduled",
|
|
1064
|
+
defaultMessage: "Not scheduled"
|
|
1065
|
+
}) : formatMessage(
|
|
858
1066
|
{
|
|
859
1067
|
id: "content-releases.page.Releases.release-item.entries",
|
|
860
1068
|
defaultMessage: "{number, plural, =0 {No entries} one {# entry} other {# entries}}"
|
|
@@ -874,7 +1082,13 @@ const StyledAlert = styled__default.default(designSystem.Alert)`
|
|
|
874
1082
|
}
|
|
875
1083
|
`;
|
|
876
1084
|
const INITIAL_FORM_VALUES = {
|
|
877
|
-
name: ""
|
|
1085
|
+
name: "",
|
|
1086
|
+
date: null,
|
|
1087
|
+
time: "",
|
|
1088
|
+
// Remove future flag check after Scheduling Beta release and replace with true as creating new release should include scheduling by default
|
|
1089
|
+
isScheduled: window.strapi.future.isEnabled("contentReleasesScheduling"),
|
|
1090
|
+
scheduledAt: null,
|
|
1091
|
+
timezone: null
|
|
878
1092
|
};
|
|
879
1093
|
const ReleasesPage = () => {
|
|
880
1094
|
const tabRef = React__namespace.useRef(null);
|
|
@@ -934,9 +1148,11 @@ const ReleasesPage = () => {
|
|
|
934
1148
|
}
|
|
935
1149
|
});
|
|
936
1150
|
};
|
|
937
|
-
const handleAddRelease = async (
|
|
1151
|
+
const handleAddRelease = async ({ name, scheduledAt, timezone }) => {
|
|
938
1152
|
const response2 = await createRelease({
|
|
939
|
-
name
|
|
1153
|
+
name,
|
|
1154
|
+
scheduledAt,
|
|
1155
|
+
timezone
|
|
940
1156
|
});
|
|
941
1157
|
if ("data" in response2) {
|
|
942
1158
|
toggleNotification({
|
|
@@ -1096,4 +1312,4 @@ const App = () => {
|
|
|
1096
1312
|
] }) });
|
|
1097
1313
|
};
|
|
1098
1314
|
exports.App = App;
|
|
1099
|
-
//# sourceMappingURL=App-
|
|
1315
|
+
//# sourceMappingURL=App-C_iroyIu.js.map
|