@strapi/content-releases 0.0.0-next.836f74517f9a428a4798ed889c3f05057ec6beb1 → 0.0.0-next.8b561475428ed29d8c7ca70ec2e96f051220ebaf
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-pNsURCL_.js → App-dLXY5ei3.js} +146 -138
- package/dist/_chunks/App-dLXY5ei3.js.map +1 -0
- package/dist/_chunks/{App-fcvNs2Qb.mjs → App-jrh58sXY.mjs} +150 -142
- package/dist/_chunks/App-jrh58sXY.mjs.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Clm0iACO.mjs → PurchaseContentReleases-3tRbmbY3.mjs} +2 -2
- package/dist/_chunks/PurchaseContentReleases-3tRbmbY3.mjs.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-YhAPgpG9.js → PurchaseContentReleases-bpIYXOfu.js} +2 -2
- package/dist/_chunks/PurchaseContentReleases-bpIYXOfu.js.map +1 -0
- package/dist/_chunks/{en-gcJJ5htG.js → en-HrREghh3.js} +11 -3
- package/dist/_chunks/en-HrREghh3.js.map +1 -0
- package/dist/_chunks/{en-WuuhP6Bn.mjs → en-ltT1TlKQ.mjs} +11 -3
- package/dist/_chunks/en-ltT1TlKQ.mjs.map +1 -0
- package/dist/_chunks/{index-gzTuOXiK.js → index-CVO0Rqdm.js} +320 -18
- package/dist/_chunks/index-CVO0Rqdm.js.map +1 -0
- package/dist/_chunks/{index-pxhi8wsT.mjs → index-PiOGBETy.mjs} +325 -23
- package/dist/_chunks/index-PiOGBETy.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +290 -158
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +290 -158
- package/dist/server/index.mjs.map +1 -1
- package/package.json +12 -12
- package/dist/_chunks/App-fcvNs2Qb.mjs.map +0 -1
- package/dist/_chunks/App-pNsURCL_.js.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-Clm0iACO.mjs.map +0 -1
- package/dist/_chunks/PurchaseContentReleases-YhAPgpG9.js.map +0 -1
- package/dist/_chunks/en-WuuhP6Bn.mjs.map +0 -1
- package/dist/_chunks/en-gcJJ5htG.js.map +0 -1
- package/dist/_chunks/index-gzTuOXiK.js.map +0 -1
- package/dist/_chunks/index-pxhi8wsT.mjs.map +0 -1
|
@@ -3,7 +3,7 @@ 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-CVO0Rqdm.js");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
9
9
|
const designSystem = require("@strapi/design-system");
|
|
@@ -72,7 +72,6 @@ const ReleaseModal = ({
|
|
|
72
72
|
const { formatMessage } = reactIntl.useIntl();
|
|
73
73
|
const { pathname } = reactRouterDom.useLocation();
|
|
74
74
|
const isCreatingRelease = pathname === `/plugins/${index.pluginId}`;
|
|
75
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
76
75
|
const { timezoneList, systemTimezone = { value: "UTC+00:00-Africa/Abidjan " } } = getTimezones(
|
|
77
76
|
initialValues.scheduledAt ? new Date(initialValues.scheduledAt) : /* @__PURE__ */ new Date()
|
|
78
77
|
);
|
|
@@ -80,13 +79,12 @@ const ReleaseModal = ({
|
|
|
80
79
|
const { date, time, timezone } = values;
|
|
81
80
|
if (!date || !time || !timezone)
|
|
82
81
|
return null;
|
|
83
|
-
const
|
|
84
|
-
|
|
85
|
-
return dateFnsTz.zonedTimeToUtc(formattedDate, timezoneWithoutOffset);
|
|
82
|
+
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
83
|
+
return dateFnsTz.zonedTimeToUtc(`${date} ${time}`, timezoneWithoutOffset);
|
|
86
84
|
};
|
|
87
85
|
const getTimezoneWithOffset = () => {
|
|
88
86
|
const currentTimezone = timezoneList.find(
|
|
89
|
-
(timezone) => timezone.value.split("
|
|
87
|
+
(timezone) => timezone.value.split("&")[1] === initialValues.timezone
|
|
90
88
|
);
|
|
91
89
|
return currentTimezone?.value || systemTimezone.value;
|
|
92
90
|
};
|
|
@@ -104,7 +102,7 @@ const ReleaseModal = ({
|
|
|
104
102
|
onSubmit: (values) => {
|
|
105
103
|
handleSubmit({
|
|
106
104
|
...values,
|
|
107
|
-
timezone: values.timezone ? values.timezone.split("
|
|
105
|
+
timezone: values.timezone ? values.timezone.split("&")[1] : null,
|
|
108
106
|
scheduledAt: values.isScheduled ? getScheduledTimestamp(values) : null
|
|
109
107
|
});
|
|
110
108
|
},
|
|
@@ -130,92 +128,88 @@ const ReleaseModal = ({
|
|
|
130
128
|
required: true
|
|
131
129
|
}
|
|
132
130
|
),
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
132
|
+
designSystem.Checkbox,
|
|
133
|
+
{
|
|
134
|
+
name: "isScheduled",
|
|
135
|
+
value: values.isScheduled,
|
|
136
|
+
onChange: (event) => {
|
|
137
|
+
setFieldValue("isScheduled", event.target.checked);
|
|
138
|
+
if (!event.target.checked) {
|
|
139
|
+
setFieldValue("date", null);
|
|
140
|
+
setFieldValue("time", "");
|
|
141
|
+
setFieldValue("timezone", null);
|
|
142
|
+
} else {
|
|
143
|
+
setFieldValue("date", initialValues.date);
|
|
144
|
+
setFieldValue("time", initialValues.time);
|
|
145
|
+
setFieldValue("timezone", initialValues.timezone ?? systemTimezone?.value);
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
149
|
+
designSystem.Typography,
|
|
150
|
+
{
|
|
151
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
152
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
153
|
+
children: formatMessage({
|
|
154
|
+
id: "modal.form.input.label.schedule-release",
|
|
155
|
+
defaultMessage: "Schedule release"
|
|
156
|
+
})
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
) }),
|
|
161
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
162
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
163
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
164
|
+
designSystem.DatePicker,
|
|
165
|
+
{
|
|
166
|
+
label: formatMessage({
|
|
167
|
+
id: "content-releases.modal.form.input.label.date",
|
|
168
|
+
defaultMessage: "Date"
|
|
169
|
+
}),
|
|
170
|
+
name: "date",
|
|
171
|
+
error: errors.date,
|
|
172
|
+
onChange: (date) => {
|
|
173
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
174
|
+
setFieldValue("date", isoFormatDate);
|
|
175
|
+
},
|
|
176
|
+
clearLabel: formatMessage({
|
|
177
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
178
|
+
defaultMessage: "Clear"
|
|
179
|
+
}),
|
|
180
|
+
onClear: () => {
|
|
142
181
|
setFieldValue("date", null);
|
|
182
|
+
},
|
|
183
|
+
selectedDate: values.date || void 0,
|
|
184
|
+
required: true,
|
|
185
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
186
|
+
}
|
|
187
|
+
) }),
|
|
188
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
189
|
+
designSystem.TimePicker,
|
|
190
|
+
{
|
|
191
|
+
label: formatMessage({
|
|
192
|
+
id: "content-releases.modal.form.input.label.time",
|
|
193
|
+
defaultMessage: "Time"
|
|
194
|
+
}),
|
|
195
|
+
name: "time",
|
|
196
|
+
error: errors.time,
|
|
197
|
+
onChange: (time) => {
|
|
198
|
+
setFieldValue("time", time);
|
|
199
|
+
},
|
|
200
|
+
clearLabel: formatMessage({
|
|
201
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
202
|
+
defaultMessage: "Clear"
|
|
203
|
+
}),
|
|
204
|
+
onClear: () => {
|
|
143
205
|
setFieldValue("time", "");
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
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
|
-
] })
|
|
206
|
+
},
|
|
207
|
+
value: values.time || void 0,
|
|
208
|
+
required: true
|
|
209
|
+
}
|
|
210
|
+
) })
|
|
211
|
+
] }),
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
219
213
|
] })
|
|
220
214
|
] }) }),
|
|
221
215
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -239,10 +233,10 @@ const ReleaseModal = ({
|
|
|
239
233
|
const getTimezones = (selectedDate) => {
|
|
240
234
|
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
241
235
|
const utcOffset = index.getTimezoneOffset(timezone, selectedDate);
|
|
242
|
-
return { offset: utcOffset, value: `${utcOffset}
|
|
236
|
+
return { offset: utcOffset, value: `${utcOffset}&${timezone}` };
|
|
243
237
|
});
|
|
244
238
|
const systemTimezone = timezoneList.find(
|
|
245
|
-
(timezone) => timezone.value.split("
|
|
239
|
+
(timezone) => timezone.value.split("&")[1] === Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
246
240
|
);
|
|
247
241
|
return { timezoneList, systemTimezone };
|
|
248
242
|
};
|
|
@@ -254,7 +248,7 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
254
248
|
if (values.date) {
|
|
255
249
|
const { timezoneList: timezoneList2 } = getTimezones(new Date(values.date));
|
|
256
250
|
setTimezoneList(timezoneList2);
|
|
257
|
-
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("
|
|
251
|
+
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("&")[1] === values.timezone.split("&")[1]);
|
|
258
252
|
if (updatedTimezone) {
|
|
259
253
|
setFieldValue("timezone", updatedTimezone.value);
|
|
260
254
|
}
|
|
@@ -270,7 +264,7 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
270
264
|
autocomplete: { type: "list", filter: "contains" },
|
|
271
265
|
name: "timezone",
|
|
272
266
|
value: values.timezone || void 0,
|
|
273
|
-
textValue: values.timezone ? values.timezone.replace(
|
|
267
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
274
268
|
onChange: (timezone) => {
|
|
275
269
|
setFieldValue("timezone", timezone);
|
|
276
270
|
},
|
|
@@ -282,15 +276,18 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
282
276
|
},
|
|
283
277
|
error: errors.timezone,
|
|
284
278
|
required: true,
|
|
285
|
-
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(
|
|
279
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
286
280
|
}
|
|
287
281
|
);
|
|
288
282
|
};
|
|
289
283
|
const LinkCard = styled__default.default(v2.Link)`
|
|
290
284
|
display: block;
|
|
291
285
|
`;
|
|
292
|
-
const
|
|
293
|
-
|
|
286
|
+
const RelativeTime = styled__default.default(helperPlugin.RelativeTime)`
|
|
287
|
+
display: inline-block;
|
|
288
|
+
&::first-letter {
|
|
289
|
+
text-transform: uppercase;
|
|
290
|
+
}
|
|
294
291
|
`;
|
|
295
292
|
const getBadgeProps = (status) => {
|
|
296
293
|
let color;
|
|
@@ -319,7 +316,6 @@ const getBadgeProps = (status) => {
|
|
|
319
316
|
};
|
|
320
317
|
const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
321
318
|
const { formatMessage } = reactIntl.useIntl();
|
|
322
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
323
319
|
if (isError) {
|
|
324
320
|
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.AnErrorOccurred, {});
|
|
325
321
|
}
|
|
@@ -340,7 +336,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
340
336
|
}
|
|
341
337
|
);
|
|
342
338
|
}
|
|
343
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name,
|
|
339
|
+
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, { href: `content-releases/${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
344
340
|
designSystem.Flex,
|
|
345
341
|
{
|
|
346
342
|
direction: "column",
|
|
@@ -356,16 +352,10 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
356
352
|
children: [
|
|
357
353
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "start", gap: 1, children: [
|
|
358
354
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
359
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children:
|
|
355
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
360
356
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
361
357
|
defaultMessage: "Not scheduled"
|
|
362
|
-
})
|
|
363
|
-
{
|
|
364
|
-
id: "content-releases.page.Releases.release-item.entries",
|
|
365
|
-
defaultMessage: "{number, plural, =0 {No entries} one {# entry} other {# entries}}"
|
|
366
|
-
},
|
|
367
|
-
{ number: actions.meta.count }
|
|
368
|
-
) })
|
|
358
|
+
}) })
|
|
369
359
|
] }),
|
|
370
360
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { ...getBadgeProps(status), children: status })
|
|
371
361
|
]
|
|
@@ -384,8 +374,7 @@ const INITIAL_FORM_VALUES = {
|
|
|
384
374
|
name: "",
|
|
385
375
|
date: null,
|
|
386
376
|
time: "",
|
|
387
|
-
|
|
388
|
-
isScheduled: window.strapi.future.isEnabled("contentReleasesScheduling"),
|
|
377
|
+
isScheduled: true,
|
|
389
378
|
scheduledAt: null,
|
|
390
379
|
timezone: null
|
|
391
380
|
};
|
|
@@ -735,7 +724,12 @@ const ReleaseDetailsLayout = ({
|
|
|
735
724
|
}
|
|
736
725
|
};
|
|
737
726
|
const handleRefresh = () => {
|
|
738
|
-
dispatch(
|
|
727
|
+
dispatch(
|
|
728
|
+
index.releaseApi.util.invalidateTags([
|
|
729
|
+
{ type: "ReleaseAction", id: "LIST" },
|
|
730
|
+
{ type: "Release", id: releaseId }
|
|
731
|
+
])
|
|
732
|
+
);
|
|
739
733
|
};
|
|
740
734
|
const getCreatedByUser = () => {
|
|
741
735
|
if (!release?.createdBy) {
|
|
@@ -771,7 +765,6 @@ const ReleaseDetailsLayout = ({
|
|
|
771
765
|
}
|
|
772
766
|
const totalEntries = release.actions.meta.count || 0;
|
|
773
767
|
const hasCreatedByUser = Boolean(getCreatedByUser());
|
|
774
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
775
768
|
const isScheduled = release.scheduledAt && release.timezone;
|
|
776
769
|
const numberOfEntriesText = formatMessage(
|
|
777
770
|
{
|
|
@@ -806,7 +799,7 @@ const ReleaseDetailsLayout = ({
|
|
|
806
799
|
{
|
|
807
800
|
title: release.name,
|
|
808
801
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
809
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (
|
|
802
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (isScheduled ? ` - ${scheduledText}` : "") }),
|
|
810
803
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { ...getBadgeProps(release.status), children: release.status })
|
|
811
804
|
] }),
|
|
812
805
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}), to: "/plugins/content-releases", children: formatMessage({
|
|
@@ -917,6 +910,7 @@ const ReleaseDetailsLayout = ({
|
|
|
917
910
|
] });
|
|
918
911
|
};
|
|
919
912
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
913
|
+
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
920
914
|
const getGroupByOptionLabel = (value) => {
|
|
921
915
|
if (value === "locale") {
|
|
922
916
|
return {
|
|
@@ -935,6 +929,21 @@ const getGroupByOptionLabel = (value) => {
|
|
|
935
929
|
defaultMessage: "Content-Types"
|
|
936
930
|
};
|
|
937
931
|
};
|
|
932
|
+
const DEFAULT_RELEASE_DETAILS_HEADER = [
|
|
933
|
+
{
|
|
934
|
+
key: "__name__",
|
|
935
|
+
fieldSchema: { type: "string" },
|
|
936
|
+
metadatas: {
|
|
937
|
+
label: {
|
|
938
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
939
|
+
defaultMessage: "name"
|
|
940
|
+
},
|
|
941
|
+
searchable: false,
|
|
942
|
+
sortable: false
|
|
943
|
+
},
|
|
944
|
+
name: "name"
|
|
945
|
+
}
|
|
946
|
+
];
|
|
938
947
|
const ReleaseDetailsBody = () => {
|
|
939
948
|
const { formatMessage } = reactIntl.useIntl();
|
|
940
949
|
const { releaseId } = reactRouterDom.useParams();
|
|
@@ -950,6 +959,17 @@ const ReleaseDetailsBody = () => {
|
|
|
950
959
|
const {
|
|
951
960
|
allowedActions: { canUpdate }
|
|
952
961
|
} = helperPlugin.useRBAC(index.PERMISSIONS);
|
|
962
|
+
const { runHookWaterfall } = helperPlugin.useStrapiApp();
|
|
963
|
+
const {
|
|
964
|
+
displayedHeaders,
|
|
965
|
+
hasI18nEnabled
|
|
966
|
+
} = runHookWaterfall(
|
|
967
|
+
"ContentReleases/pages/ReleaseDetails/add-locale-in-releases",
|
|
968
|
+
{
|
|
969
|
+
displayedHeaders: DEFAULT_RELEASE_DETAILS_HEADER,
|
|
970
|
+
hasI18nEnabled: false
|
|
971
|
+
}
|
|
972
|
+
);
|
|
953
973
|
const release = releaseData?.data;
|
|
954
974
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
955
975
|
const {
|
|
@@ -1051,6 +1071,7 @@ const ReleaseDetailsBody = () => {
|
|
|
1051
1071
|
}
|
|
1052
1072
|
) });
|
|
1053
1073
|
}
|
|
1074
|
+
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1054
1075
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1055
1076
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1056
1077
|
designSystem.SingleSelect,
|
|
@@ -1070,7 +1091,7 @@ const ReleaseDetailsBody = () => {
|
|
|
1070
1091
|
),
|
|
1071
1092
|
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
1072
1093
|
onChange: (value) => setQuery({ groupBy: value }),
|
|
1073
|
-
children:
|
|
1094
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
1074
1095
|
}
|
|
1075
1096
|
) }),
|
|
1076
1097
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
@@ -1087,28 +1108,15 @@ const ReleaseDetailsBody = () => {
|
|
|
1087
1108
|
isFetching,
|
|
1088
1109
|
children: /* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Content, { children: [
|
|
1089
1110
|
/* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Head, { children: [
|
|
1090
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1111
|
+
displayedHeaders.map(({ key: key2, fieldSchema, metadatas, name }) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1091
1112
|
helperPlugin.Table.HeaderCell,
|
|
1092
1113
|
{
|
|
1093
|
-
fieldSchemaType:
|
|
1094
|
-
label: formatMessage(
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
}
|
|
1100
|
-
),
|
|
1101
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1102
|
-
helperPlugin.Table.HeaderCell,
|
|
1103
|
-
{
|
|
1104
|
-
fieldSchemaType: "string",
|
|
1105
|
-
label: formatMessage({
|
|
1106
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1107
|
-
defaultMessage: "locale"
|
|
1108
|
-
}),
|
|
1109
|
-
name: "locale"
|
|
1110
|
-
}
|
|
1111
|
-
),
|
|
1114
|
+
fieldSchemaType: fieldSchema.type,
|
|
1115
|
+
label: formatMessage(metadatas.label),
|
|
1116
|
+
name
|
|
1117
|
+
},
|
|
1118
|
+
key2
|
|
1119
|
+
)),
|
|
1112
1120
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1113
1121
|
helperPlugin.Table.HeaderCell,
|
|
1114
1122
|
{
|
|
@@ -1147,7 +1155,7 @@ const ReleaseDetailsBody = () => {
|
|
|
1147
1155
|
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.Body, { children: releaseActions[key].map(
|
|
1148
1156
|
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1149
1157
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1150
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1158
|
+
hasI18nEnabled && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1151
1159
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
1152
1160
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
1153
1161
|
{
|
|
@@ -1247,7 +1255,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1247
1255
|
const title = releaseData?.name || "";
|
|
1248
1256
|
const timezone = releaseData?.timezone ?? null;
|
|
1249
1257
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1250
|
-
const date = scheduledAt ?
|
|
1258
|
+
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : null;
|
|
1251
1259
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
1252
1260
|
const handleEditRelease = async (values) => {
|
|
1253
1261
|
const response = await updateRelease({
|
|
@@ -1264,6 +1272,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1264
1272
|
defaultMessage: "Release updated."
|
|
1265
1273
|
})
|
|
1266
1274
|
});
|
|
1275
|
+
toggleEditReleaseModal();
|
|
1267
1276
|
} else if (index.isAxiosError(response.error)) {
|
|
1268
1277
|
toggleNotification({
|
|
1269
1278
|
type: "warning",
|
|
@@ -1275,7 +1284,6 @@ const ReleaseDetailsPage = () => {
|
|
|
1275
1284
|
message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
|
|
1276
1285
|
});
|
|
1277
1286
|
}
|
|
1278
|
-
toggleEditReleaseModal();
|
|
1279
1287
|
};
|
|
1280
1288
|
const handleDeleteRelease = async () => {
|
|
1281
1289
|
const response = await deleteRelease({
|
|
@@ -1342,4 +1350,4 @@ const App = () => {
|
|
|
1342
1350
|
] }) });
|
|
1343
1351
|
};
|
|
1344
1352
|
exports.App = App;
|
|
1345
|
-
//# sourceMappingURL=App-
|
|
1353
|
+
//# sourceMappingURL=App-dLXY5ei3.js.map
|