@strapi/content-releases 0.0.0-experimental.e3e48deb89bd0a1b6cc69b698696566fa7854a95 → 0.0.0-experimental.e5740babedd53cf5b6af99d74920b6b9ef1e4c11
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-PQlYzNfb.mjs → App-HVXzE3i3.mjs} +256 -280
- package/dist/_chunks/App-HVXzE3i3.mjs.map +1 -0
- package/dist/_chunks/{App-lzeJz92X.js → App-l62gIUTX.js} +254 -278
- package/dist/_chunks/App-l62gIUTX.js.map +1 -0
- package/dist/_chunks/{en-WuuhP6Bn.mjs → en-RdapH-9X.mjs} +1 -2
- package/dist/_chunks/en-RdapH-9X.mjs.map +1 -0
- package/dist/_chunks/{en-gcJJ5htG.js → en-faJDuv3q.js} +1 -2
- package/dist/_chunks/en-faJDuv3q.js.map +1 -0
- package/dist/_chunks/{index-Nf1JfI-m.js → index-ML_b3php.js} +28 -22
- package/dist/_chunks/index-ML_b3php.js.map +1 -0
- package/dist/_chunks/{index--4AgLDzb.mjs → index-Ys87ROOe.mjs} +32 -26
- package/dist/_chunks/index-Ys87ROOe.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +344 -203
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +344 -204
- package/dist/server/index.mjs.map +1 -1
- package/package.json +21 -14
- package/dist/_chunks/App-PQlYzNfb.mjs.map +0 -1
- package/dist/_chunks/App-lzeJz92X.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--4AgLDzb.mjs.map +0 -1
- package/dist/_chunks/index-Nf1JfI-m.js.map +0 -1
- package/dist/admin/src/components/CMReleasesContainer.d.ts +0 -1
- package/dist/admin/src/components/RelativeTime.d.ts +0 -28
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +0 -26
- package/dist/admin/src/components/ReleaseActionOptions.d.ts +0 -9
- package/dist/admin/src/components/ReleaseModal.d.ts +0 -16
- package/dist/admin/src/constants.d.ts +0 -58
- package/dist/admin/src/index.d.ts +0 -3
- package/dist/admin/src/pages/App.d.ts +0 -1
- package/dist/admin/src/pages/PurchaseContentReleases.d.ts +0 -2
- package/dist/admin/src/pages/ReleaseDetailsPage.d.ts +0 -2
- package/dist/admin/src/pages/ReleasesPage.d.ts +0 -8
- package/dist/admin/src/pages/tests/mockReleaseDetailsPageData.d.ts +0 -181
- package/dist/admin/src/pages/tests/mockReleasesPageData.d.ts +0 -39
- package/dist/admin/src/pluginId.d.ts +0 -1
- package/dist/admin/src/services/axios.d.ts +0 -29
- package/dist/admin/src/services/release.d.ts +0 -369
- package/dist/admin/src/store/hooks.d.ts +0 -7
- package/dist/admin/src/utils/time.d.ts +0 -1
- package/dist/server/src/bootstrap.d.ts +0 -5
- package/dist/server/src/bootstrap.d.ts.map +0 -1
- package/dist/server/src/constants.d.ts +0 -12
- package/dist/server/src/constants.d.ts.map +0 -1
- package/dist/server/src/content-types/index.d.ts +0 -99
- package/dist/server/src/content-types/index.d.ts.map +0 -1
- package/dist/server/src/content-types/release/index.d.ts +0 -48
- package/dist/server/src/content-types/release/index.d.ts.map +0 -1
- package/dist/server/src/content-types/release/schema.d.ts +0 -47
- package/dist/server/src/content-types/release/schema.d.ts.map +0 -1
- package/dist/server/src/content-types/release-action/index.d.ts +0 -50
- package/dist/server/src/content-types/release-action/index.d.ts.map +0 -1
- package/dist/server/src/content-types/release-action/schema.d.ts +0 -49
- package/dist/server/src/content-types/release-action/schema.d.ts.map +0 -1
- package/dist/server/src/controllers/index.d.ts +0 -18
- package/dist/server/src/controllers/index.d.ts.map +0 -1
- package/dist/server/src/controllers/release-action.d.ts +0 -9
- package/dist/server/src/controllers/release-action.d.ts.map +0 -1
- package/dist/server/src/controllers/release.d.ts +0 -11
- package/dist/server/src/controllers/release.d.ts.map +0 -1
- package/dist/server/src/controllers/validation/release-action.d.ts +0 -3
- package/dist/server/src/controllers/validation/release-action.d.ts.map +0 -1
- package/dist/server/src/controllers/validation/release.d.ts +0 -2
- package/dist/server/src/controllers/validation/release.d.ts.map +0 -1
- package/dist/server/src/destroy.d.ts +0 -5
- package/dist/server/src/destroy.d.ts.map +0 -1
- package/dist/server/src/index.d.ts +0 -2092
- package/dist/server/src/index.d.ts.map +0 -1
- package/dist/server/src/migrations/index.d.ts +0 -10
- package/dist/server/src/migrations/index.d.ts.map +0 -1
- package/dist/server/src/register.d.ts +0 -5
- package/dist/server/src/register.d.ts.map +0 -1
- package/dist/server/src/routes/index.d.ts +0 -35
- package/dist/server/src/routes/index.d.ts.map +0 -1
- package/dist/server/src/routes/release-action.d.ts +0 -18
- package/dist/server/src/routes/release-action.d.ts.map +0 -1
- package/dist/server/src/routes/release.d.ts +0 -18
- package/dist/server/src/routes/release.d.ts.map +0 -1
- package/dist/server/src/services/index.d.ts +0 -1826
- package/dist/server/src/services/index.d.ts.map +0 -1
- package/dist/server/src/services/release.d.ts +0 -66
- package/dist/server/src/services/release.d.ts.map +0 -1
- package/dist/server/src/services/scheduling.d.ts +0 -18
- package/dist/server/src/services/scheduling.d.ts.map +0 -1
- package/dist/server/src/services/validation.d.ts +0 -14
- package/dist/server/src/services/validation.d.ts.map +0 -1
- package/dist/server/src/utils/index.d.ts +0 -14
- package/dist/server/src/utils/index.d.ts.map +0 -1
- package/dist/shared/contracts/release-actions.d.ts +0 -105
- package/dist/shared/contracts/release-actions.d.ts.map +0 -1
- package/dist/shared/contracts/releases.d.ts +0 -166
- package/dist/shared/contracts/releases.d.ts.map +0 -1
- package/dist/shared/types.d.ts +0 -24
- package/dist/shared/types.d.ts.map +0 -1
- package/dist/shared/validation-schemas.d.ts +0 -2
- package/dist/shared/validation-schemas.d.ts.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
-
const
|
|
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-ML_b3php.js");
|
|
7
7
|
const React = require("react");
|
|
8
|
+
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
8
9
|
const designSystem = require("@strapi/design-system");
|
|
9
10
|
const v2 = require("@strapi/design-system/v2");
|
|
10
|
-
const helperPlugin = require("@strapi/helper-plugin");
|
|
11
11
|
const icons = require("@strapi/icons");
|
|
12
12
|
const format = require("date-fns/format");
|
|
13
13
|
const dateFnsTz = require("date-fns-tz");
|
|
@@ -43,36 +43,6 @@ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
|
43
43
|
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
44
44
|
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
45
45
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
46
|
-
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
47
|
-
const RelativeTime = React__namespace.forwardRef(
|
|
48
|
-
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
|
49
|
-
const { formatRelativeTime, formatDate, formatTime } = reactIntl.useIntl();
|
|
50
|
-
const interval = dateFns.intervalToDuration({
|
|
51
|
-
start: timestamp,
|
|
52
|
-
end: Date.now()
|
|
53
|
-
// see https://github.com/date-fns/date-fns/issues/2891 – No idea why it's all partial it returns it every time.
|
|
54
|
-
});
|
|
55
|
-
const unit = intervals.find((intervalUnit) => {
|
|
56
|
-
return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
|
|
57
|
-
});
|
|
58
|
-
const relativeTime = dateFns.isPast(timestamp) ? -interval[unit] : interval[unit];
|
|
59
|
-
const customInterval = customIntervals.find(
|
|
60
|
-
(custom) => interval[custom.unit] < custom.threshold
|
|
61
|
-
);
|
|
62
|
-
const displayText = customInterval ? customInterval.text : formatRelativeTime(relativeTime, unit, { numeric: "auto" });
|
|
63
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
64
|
-
"time",
|
|
65
|
-
{
|
|
66
|
-
ref: forwardedRef,
|
|
67
|
-
dateTime: timestamp.toISOString(),
|
|
68
|
-
role: "time",
|
|
69
|
-
title: `${formatDate(timestamp)} ${formatTime(timestamp)}`,
|
|
70
|
-
...restProps,
|
|
71
|
-
children: displayText
|
|
72
|
-
}
|
|
73
|
-
);
|
|
74
|
-
}
|
|
75
|
-
);
|
|
76
46
|
const RELEASE_SCHEMA = yup__namespace.object().shape({
|
|
77
47
|
name: yup__namespace.string().trim().required(),
|
|
78
48
|
scheduledAt: yup__namespace.string().nullable(),
|
|
@@ -102,7 +72,6 @@ const ReleaseModal = ({
|
|
|
102
72
|
const { formatMessage } = reactIntl.useIntl();
|
|
103
73
|
const { pathname } = reactRouterDom.useLocation();
|
|
104
74
|
const isCreatingRelease = pathname === `/plugins/${index.pluginId}`;
|
|
105
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
106
75
|
const { timezoneList, systemTimezone = { value: "UTC+00:00-Africa/Abidjan " } } = getTimezones(
|
|
107
76
|
initialValues.scheduledAt ? new Date(initialValues.scheduledAt) : /* @__PURE__ */ new Date()
|
|
108
77
|
);
|
|
@@ -111,12 +80,12 @@ const ReleaseModal = ({
|
|
|
111
80
|
if (!date || !time || !timezone)
|
|
112
81
|
return null;
|
|
113
82
|
const formattedDate = dateFns.parse(time, "HH:mm", new Date(date));
|
|
114
|
-
const timezoneWithoutOffset = timezone.split("
|
|
83
|
+
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
115
84
|
return dateFnsTz.zonedTimeToUtc(formattedDate, timezoneWithoutOffset);
|
|
116
85
|
};
|
|
117
86
|
const getTimezoneWithOffset = () => {
|
|
118
87
|
const currentTimezone = timezoneList.find(
|
|
119
|
-
(timezone) => timezone.value.split("
|
|
88
|
+
(timezone) => timezone.value.split("&")[1] === initialValues.timezone
|
|
120
89
|
);
|
|
121
90
|
return currentTimezone?.value || systemTimezone.value;
|
|
122
91
|
};
|
|
@@ -134,7 +103,7 @@ const ReleaseModal = ({
|
|
|
134
103
|
onSubmit: (values) => {
|
|
135
104
|
handleSubmit({
|
|
136
105
|
...values,
|
|
137
|
-
timezone: values.timezone ? values.timezone.split("
|
|
106
|
+
timezone: values.timezone ? values.timezone.split("&")[1] : null,
|
|
138
107
|
scheduledAt: values.isScheduled ? getScheduledTimestamp(values) : null
|
|
139
108
|
});
|
|
140
109
|
},
|
|
@@ -160,92 +129,88 @@ const ReleaseModal = ({
|
|
|
160
129
|
required: true
|
|
161
130
|
}
|
|
162
131
|
),
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
133
|
+
designSystem.Checkbox,
|
|
134
|
+
{
|
|
135
|
+
name: "isScheduled",
|
|
136
|
+
value: values.isScheduled,
|
|
137
|
+
onChange: (event) => {
|
|
138
|
+
setFieldValue("isScheduled", event.target.checked);
|
|
139
|
+
if (!event.target.checked) {
|
|
140
|
+
setFieldValue("date", null);
|
|
141
|
+
setFieldValue("time", "");
|
|
142
|
+
setFieldValue("timezone", null);
|
|
143
|
+
} else {
|
|
144
|
+
setFieldValue("date", initialValues.date);
|
|
145
|
+
setFieldValue("time", initialValues.time);
|
|
146
|
+
setFieldValue("timezone", initialValues.timezone ?? systemTimezone?.value);
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
150
|
+
designSystem.Typography,
|
|
151
|
+
{
|
|
152
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
153
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
154
|
+
children: formatMessage({
|
|
155
|
+
id: "modal.form.input.label.schedule-release",
|
|
156
|
+
defaultMessage: "Schedule release"
|
|
157
|
+
})
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
}
|
|
161
|
+
) }),
|
|
162
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
163
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
164
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
165
|
+
designSystem.DatePicker,
|
|
166
|
+
{
|
|
167
|
+
label: formatMessage({
|
|
168
|
+
id: "content-releases.modal.form.input.label.date",
|
|
169
|
+
defaultMessage: "Date"
|
|
170
|
+
}),
|
|
171
|
+
name: "date",
|
|
172
|
+
error: errors.date,
|
|
173
|
+
onChange: (date) => {
|
|
174
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
175
|
+
setFieldValue("date", isoFormatDate);
|
|
176
|
+
},
|
|
177
|
+
clearLabel: formatMessage({
|
|
178
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
179
|
+
defaultMessage: "Clear"
|
|
180
|
+
}),
|
|
181
|
+
onClear: () => {
|
|
172
182
|
setFieldValue("date", null);
|
|
183
|
+
},
|
|
184
|
+
selectedDate: values.date || void 0,
|
|
185
|
+
required: true,
|
|
186
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
187
|
+
}
|
|
188
|
+
) }),
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
190
|
+
designSystem.TimePicker,
|
|
191
|
+
{
|
|
192
|
+
label: formatMessage({
|
|
193
|
+
id: "content-releases.modal.form.input.label.time",
|
|
194
|
+
defaultMessage: "Time"
|
|
195
|
+
}),
|
|
196
|
+
name: "time",
|
|
197
|
+
error: errors.time,
|
|
198
|
+
onChange: (time) => {
|
|
199
|
+
setFieldValue("time", time);
|
|
200
|
+
},
|
|
201
|
+
clearLabel: formatMessage({
|
|
202
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
203
|
+
defaultMessage: "Clear"
|
|
204
|
+
}),
|
|
205
|
+
onClear: () => {
|
|
173
206
|
setFieldValue("time", "");
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
);
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
185
|
-
designSystem.Typography,
|
|
186
|
-
{
|
|
187
|
-
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
188
|
-
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
189
|
-
children: formatMessage({
|
|
190
|
-
id: "modal.form.input.label.schedule-release",
|
|
191
|
-
defaultMessage: "Schedule release"
|
|
192
|
-
})
|
|
193
|
-
}
|
|
194
|
-
)
|
|
195
|
-
}
|
|
196
|
-
) }),
|
|
197
|
-
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
198
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
199
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
200
|
-
designSystem.DatePicker,
|
|
201
|
-
{
|
|
202
|
-
label: formatMessage({
|
|
203
|
-
id: "content-releases.modal.form.input.label.date",
|
|
204
|
-
defaultMessage: "Date"
|
|
205
|
-
}),
|
|
206
|
-
name: "date",
|
|
207
|
-
error: errors.date,
|
|
208
|
-
onChange: (date) => {
|
|
209
|
-
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
210
|
-
setFieldValue("date", isoFormatDate);
|
|
211
|
-
},
|
|
212
|
-
clearLabel: formatMessage({
|
|
213
|
-
id: "content-releases.modal.form.input.clearLabel",
|
|
214
|
-
defaultMessage: "Clear"
|
|
215
|
-
}),
|
|
216
|
-
onClear: () => {
|
|
217
|
-
setFieldValue("date", null);
|
|
218
|
-
},
|
|
219
|
-
selectedDate: values.date || void 0,
|
|
220
|
-
required: true
|
|
221
|
-
}
|
|
222
|
-
) }),
|
|
223
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
|
-
designSystem.TimePicker,
|
|
225
|
-
{
|
|
226
|
-
label: formatMessage({
|
|
227
|
-
id: "content-releases.modal.form.input.label.time",
|
|
228
|
-
defaultMessage: "Time"
|
|
229
|
-
}),
|
|
230
|
-
name: "time",
|
|
231
|
-
error: errors.time,
|
|
232
|
-
onChange: (time) => {
|
|
233
|
-
setFieldValue("time", time);
|
|
234
|
-
},
|
|
235
|
-
clearLabel: formatMessage({
|
|
236
|
-
id: "content-releases.modal.form.input.clearLabel",
|
|
237
|
-
defaultMessage: "Clear"
|
|
238
|
-
}),
|
|
239
|
-
onClear: () => {
|
|
240
|
-
setFieldValue("time", "");
|
|
241
|
-
},
|
|
242
|
-
value: values.time || void 0,
|
|
243
|
-
required: true
|
|
244
|
-
}
|
|
245
|
-
) })
|
|
246
|
-
] }),
|
|
247
|
-
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
248
|
-
] })
|
|
207
|
+
},
|
|
208
|
+
value: values.time || void 0,
|
|
209
|
+
required: true
|
|
210
|
+
}
|
|
211
|
+
) })
|
|
212
|
+
] }),
|
|
213
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
249
214
|
] })
|
|
250
215
|
] }) }),
|
|
251
216
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -269,10 +234,10 @@ const ReleaseModal = ({
|
|
|
269
234
|
const getTimezones = (selectedDate) => {
|
|
270
235
|
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
271
236
|
const utcOffset = index.getTimezoneOffset(timezone, selectedDate);
|
|
272
|
-
return { offset: utcOffset, value: `${utcOffset}
|
|
237
|
+
return { offset: utcOffset, value: `${utcOffset}&${timezone}` };
|
|
273
238
|
});
|
|
274
239
|
const systemTimezone = timezoneList.find(
|
|
275
|
-
(timezone) => timezone.value.split("
|
|
240
|
+
(timezone) => timezone.value.split("&")[1] === Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
276
241
|
);
|
|
277
242
|
return { timezoneList, systemTimezone };
|
|
278
243
|
};
|
|
@@ -284,7 +249,7 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
284
249
|
if (values.date) {
|
|
285
250
|
const { timezoneList: timezoneList2 } = getTimezones(new Date(values.date));
|
|
286
251
|
setTimezoneList(timezoneList2);
|
|
287
|
-
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("
|
|
252
|
+
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("&")[1] === values.timezone.split("&")[1]);
|
|
288
253
|
if (updatedTimezone) {
|
|
289
254
|
setFieldValue("timezone", updatedTimezone.value);
|
|
290
255
|
}
|
|
@@ -297,9 +262,10 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
297
262
|
id: "content-releases.modal.form.input.label.timezone",
|
|
298
263
|
defaultMessage: "Timezone"
|
|
299
264
|
}),
|
|
265
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
300
266
|
name: "timezone",
|
|
301
267
|
value: values.timezone || void 0,
|
|
302
|
-
textValue: values.timezone ? values.timezone.replace(
|
|
268
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
303
269
|
onChange: (timezone) => {
|
|
304
270
|
setFieldValue("timezone", timezone);
|
|
305
271
|
},
|
|
@@ -311,14 +277,14 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
311
277
|
},
|
|
312
278
|
error: errors.timezone,
|
|
313
279
|
required: true,
|
|
314
|
-
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(
|
|
280
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
315
281
|
}
|
|
316
282
|
);
|
|
317
283
|
};
|
|
318
284
|
const LinkCard = styled__default.default(v2.Link)`
|
|
319
285
|
display: block;
|
|
320
286
|
`;
|
|
321
|
-
const CapitalizeRelativeTime = styled__default.default(RelativeTime)`
|
|
287
|
+
const CapitalizeRelativeTime = styled__default.default(helperPlugin.RelativeTime)`
|
|
322
288
|
text-transform: capitalize;
|
|
323
289
|
`;
|
|
324
290
|
const getBadgeProps = (status) => {
|
|
@@ -348,9 +314,8 @@ const getBadgeProps = (status) => {
|
|
|
348
314
|
};
|
|
349
315
|
const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
350
316
|
const { formatMessage } = reactIntl.useIntl();
|
|
351
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
352
317
|
if (isError) {
|
|
353
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
318
|
+
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.AnErrorOccurred, {});
|
|
354
319
|
}
|
|
355
320
|
if (releases?.length === 0) {
|
|
356
321
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -369,7 +334,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
369
334
|
}
|
|
370
335
|
);
|
|
371
336
|
}
|
|
372
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name,
|
|
337
|
+
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(
|
|
373
338
|
designSystem.Flex,
|
|
374
339
|
{
|
|
375
340
|
direction: "column",
|
|
@@ -385,16 +350,10 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
385
350
|
children: [
|
|
386
351
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "start", gap: 1, children: [
|
|
387
352
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
388
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children:
|
|
353
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(CapitalizeRelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
389
354
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
390
355
|
defaultMessage: "Not scheduled"
|
|
391
|
-
})
|
|
392
|
-
{
|
|
393
|
-
id: "content-releases.page.Releases.release-item.entries",
|
|
394
|
-
defaultMessage: "{number, plural, =0 {No entries} one {# entry} other {# entries}}"
|
|
395
|
-
},
|
|
396
|
-
{ number: actions.meta.count }
|
|
397
|
-
) })
|
|
356
|
+
}) })
|
|
398
357
|
] }),
|
|
399
358
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { ...getBadgeProps(status), children: status })
|
|
400
359
|
]
|
|
@@ -413,8 +372,7 @@ const INITIAL_FORM_VALUES = {
|
|
|
413
372
|
name: "",
|
|
414
373
|
date: null,
|
|
415
374
|
time: "",
|
|
416
|
-
|
|
417
|
-
isScheduled: window.strapi.future.isEnabled("contentReleasesScheduling"),
|
|
375
|
+
isScheduled: true,
|
|
418
376
|
scheduledAt: null,
|
|
419
377
|
timezone: null
|
|
420
378
|
};
|
|
@@ -424,7 +382,7 @@ const ReleasesPage = () => {
|
|
|
424
382
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
425
383
|
const toggleNotification = helperPlugin.useNotification();
|
|
426
384
|
const { formatMessage } = reactIntl.useIntl();
|
|
427
|
-
const
|
|
385
|
+
const { push, replace } = reactRouterDom.useHistory();
|
|
428
386
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
429
387
|
const [{ query }, setQuery] = helperPlugin.useQueryParams();
|
|
430
388
|
const response = index.useGetReleasesQuery(query);
|
|
@@ -448,9 +406,9 @@ const ReleasesPage = () => {
|
|
|
448
406
|
defaultMessage: "Please try again or open another release."
|
|
449
407
|
})
|
|
450
408
|
});
|
|
451
|
-
|
|
409
|
+
replace({ state: null });
|
|
452
410
|
}
|
|
453
|
-
}, [formatMessage, location?.state?.errors,
|
|
411
|
+
}, [formatMessage, location?.state?.errors, replace, toggleNotification]);
|
|
454
412
|
React__namespace.useEffect(() => {
|
|
455
413
|
if (tabRef.current) {
|
|
456
414
|
tabRef.current._handlers.setSelectedTabIndex(activeTabIndex);
|
|
@@ -460,7 +418,7 @@ const ReleasesPage = () => {
|
|
|
460
418
|
setReleaseModalShown((prev) => !prev);
|
|
461
419
|
};
|
|
462
420
|
if (isLoading) {
|
|
463
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
421
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { "aria-busy": isLoading, children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) });
|
|
464
422
|
}
|
|
465
423
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
466
424
|
const hasReachedMaximumPendingReleases = totalPendingReleases >= maximumReleases;
|
|
@@ -491,7 +449,7 @@ const ReleasesPage = () => {
|
|
|
491
449
|
})
|
|
492
450
|
});
|
|
493
451
|
trackUsage("didCreateRelease");
|
|
494
|
-
|
|
452
|
+
push(`/plugins/content-releases/${response2.data.data.id}`);
|
|
495
453
|
} else if (index.isAxiosError(response2.error)) {
|
|
496
454
|
toggleNotification({
|
|
497
455
|
type: "warning",
|
|
@@ -606,17 +564,23 @@ const ReleasesPage = () => {
|
|
|
606
564
|
]
|
|
607
565
|
}
|
|
608
566
|
),
|
|
609
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
567
|
+
response.currentData?.meta?.pagination?.total ? /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { paddingTop: 4, alignItems: "flex-end", justifyContent: "space-between", children: [
|
|
568
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
569
|
+
helperPlugin.PageSizeURLQuery,
|
|
570
|
+
{
|
|
571
|
+
options: ["8", "16", "32", "64"],
|
|
572
|
+
defaultValue: response?.currentData?.meta?.pagination?.pageSize.toString()
|
|
573
|
+
}
|
|
574
|
+
),
|
|
575
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
576
|
+
helperPlugin.PaginationURLQuery,
|
|
577
|
+
{
|
|
578
|
+
pagination: {
|
|
579
|
+
pageCount: response?.currentData?.meta?.pagination?.pageCount || 0
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
)
|
|
583
|
+
] }) : null
|
|
620
584
|
] }) }),
|
|
621
585
|
releaseModalShown && /* @__PURE__ */ jsxRuntime.jsx(
|
|
622
586
|
ReleaseModal,
|
|
@@ -664,18 +628,14 @@ const TrashIcon = styled__default.default(icons.Trash)`
|
|
|
664
628
|
const TypographyMaxWidth = styled__default.default(designSystem.Typography)`
|
|
665
629
|
max-width: 300px;
|
|
666
630
|
`;
|
|
667
|
-
const EntryValidationText = ({ action, schema, entry }) => {
|
|
631
|
+
const EntryValidationText = ({ action, schema, components, entry }) => {
|
|
668
632
|
const { formatMessage } = reactIntl.useIntl();
|
|
669
|
-
const { validate } = strapiAdmin.unstable_useDocument(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
skip: !schema
|
|
676
|
-
}
|
|
677
|
-
);
|
|
678
|
-
const errors = validate(entry) ?? {};
|
|
633
|
+
const { validate } = strapiAdmin.unstable_useDocument();
|
|
634
|
+
const { errors } = validate(entry, {
|
|
635
|
+
contentType: schema,
|
|
636
|
+
components,
|
|
637
|
+
isCreatingEntry: false
|
|
638
|
+
});
|
|
679
639
|
if (Object.keys(errors).length > 0) {
|
|
680
640
|
const validationErrorsMessages = Object.entries(errors).map(
|
|
681
641
|
([key, value]) => formatMessage(
|
|
@@ -723,12 +683,7 @@ const ReleaseDetailsLayout = ({
|
|
|
723
683
|
isLoading: isLoadingDetails,
|
|
724
684
|
isError,
|
|
725
685
|
error
|
|
726
|
-
} = index.useGetReleaseQuery(
|
|
727
|
-
{ id: releaseId },
|
|
728
|
-
{
|
|
729
|
-
skip: !releaseId
|
|
730
|
-
}
|
|
731
|
-
);
|
|
686
|
+
} = index.useGetReleaseQuery({ id: releaseId });
|
|
732
687
|
const [publishRelease, { isLoading: isPublishing }] = index.usePublishReleaseMutation();
|
|
733
688
|
const toggleNotification = helperPlugin.useNotification();
|
|
734
689
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -738,8 +693,8 @@ const ReleaseDetailsLayout = ({
|
|
|
738
693
|
const dispatch = index.useTypedDispatch();
|
|
739
694
|
const { trackUsage } = helperPlugin.useTracking();
|
|
740
695
|
const release = data?.data;
|
|
741
|
-
const handlePublishRelease =
|
|
742
|
-
const response = await publishRelease({ id });
|
|
696
|
+
const handlePublishRelease = async () => {
|
|
697
|
+
const response = await publishRelease({ id: releaseId });
|
|
743
698
|
if ("data" in response) {
|
|
744
699
|
toggleNotification({
|
|
745
700
|
type: "success",
|
|
@@ -767,7 +722,12 @@ const ReleaseDetailsLayout = ({
|
|
|
767
722
|
}
|
|
768
723
|
};
|
|
769
724
|
const handleRefresh = () => {
|
|
770
|
-
dispatch(
|
|
725
|
+
dispatch(
|
|
726
|
+
index.releaseApi.util.invalidateTags([
|
|
727
|
+
{ type: "ReleaseAction", id: "LIST" },
|
|
728
|
+
{ type: "Release", id: releaseId }
|
|
729
|
+
])
|
|
730
|
+
);
|
|
771
731
|
};
|
|
772
732
|
const getCreatedByUser = () => {
|
|
773
733
|
if (!release?.createdBy) {
|
|
@@ -782,26 +742,27 @@ const ReleaseDetailsLayout = ({
|
|
|
782
742
|
return release.createdBy.email;
|
|
783
743
|
};
|
|
784
744
|
if (isLoadingDetails) {
|
|
785
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
745
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { "aria-busy": isLoadingDetails, children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) });
|
|
786
746
|
}
|
|
787
747
|
if (isError || !release) {
|
|
788
748
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
789
|
-
reactRouterDom.
|
|
749
|
+
reactRouterDom.Redirect,
|
|
790
750
|
{
|
|
791
|
-
to:
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
751
|
+
to: {
|
|
752
|
+
pathname: "/plugins/content-releases",
|
|
753
|
+
state: {
|
|
754
|
+
errors: [
|
|
755
|
+
{
|
|
756
|
+
code: error?.code
|
|
757
|
+
}
|
|
758
|
+
]
|
|
759
|
+
}
|
|
798
760
|
}
|
|
799
761
|
}
|
|
800
762
|
);
|
|
801
763
|
}
|
|
802
764
|
const totalEntries = release.actions.meta.count || 0;
|
|
803
765
|
const hasCreatedByUser = Boolean(getCreatedByUser());
|
|
804
|
-
const IsSchedulingEnabled = window.strapi.future.isEnabled("contentReleasesScheduling");
|
|
805
766
|
const isScheduled = release.scheduledAt && release.timezone;
|
|
806
767
|
const numberOfEntriesText = formatMessage(
|
|
807
768
|
{
|
|
@@ -836,10 +797,13 @@ const ReleaseDetailsLayout = ({
|
|
|
836
797
|
{
|
|
837
798
|
title: release.name,
|
|
838
799
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
839
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (
|
|
800
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral600", variant: "epsilon", children: numberOfEntriesText + (isScheduled ? ` - ${scheduledText}` : "") }),
|
|
840
801
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { ...getBadgeProps(release.status), children: release.status })
|
|
841
802
|
] }),
|
|
842
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
|
803
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(icons.ArrowLeft, {}), to: "/plugins/content-releases", children: formatMessage({
|
|
804
|
+
id: "global.back",
|
|
805
|
+
defaultMessage: "Back"
|
|
806
|
+
}) }),
|
|
843
807
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
844
808
|
/* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.Root, { children: [
|
|
845
809
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -905,7 +869,7 @@ const ReleaseDetailsLayout = ({
|
|
|
905
869
|
defaultMessage: "Created"
|
|
906
870
|
}) }),
|
|
907
871
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
908
|
-
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
872
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
909
873
|
formatMessage(
|
|
910
874
|
{
|
|
911
875
|
id: "content-releases.header.actions.created.description",
|
|
@@ -928,7 +892,7 @@ const ReleaseDetailsLayout = ({
|
|
|
928
892
|
{
|
|
929
893
|
size: "S",
|
|
930
894
|
variant: "default",
|
|
931
|
-
onClick: handlePublishRelease
|
|
895
|
+
onClick: handlePublishRelease,
|
|
932
896
|
loading: isPublishing,
|
|
933
897
|
disabled: release.actions.meta.count === 0,
|
|
934
898
|
children: formatMessage({
|
|
@@ -962,8 +926,9 @@ const getGroupByOptionLabel = (value) => {
|
|
|
962
926
|
defaultMessage: "Content-Types"
|
|
963
927
|
};
|
|
964
928
|
};
|
|
965
|
-
const ReleaseDetailsBody = (
|
|
929
|
+
const ReleaseDetailsBody = () => {
|
|
966
930
|
const { formatMessage } = reactIntl.useIntl();
|
|
931
|
+
const { releaseId } = reactRouterDom.useParams();
|
|
967
932
|
const [{ query }, setQuery] = helperPlugin.useQueryParams();
|
|
968
933
|
const toggleNotification = helperPlugin.useNotification();
|
|
969
934
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
@@ -1018,7 +983,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1018
983
|
}
|
|
1019
984
|
};
|
|
1020
985
|
if (isLoading || isReleaseLoading) {
|
|
1021
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
986
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) });
|
|
1022
987
|
}
|
|
1023
988
|
const releaseActions = data?.data;
|
|
1024
989
|
const releaseMeta = data?.meta;
|
|
@@ -1037,22 +1002,28 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1037
1002
|
});
|
|
1038
1003
|
}
|
|
1039
1004
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1040
|
-
reactRouterDom.
|
|
1005
|
+
reactRouterDom.Redirect,
|
|
1041
1006
|
{
|
|
1042
|
-
to:
|
|
1043
|
-
|
|
1044
|
-
|
|
1007
|
+
to: {
|
|
1008
|
+
pathname: "/plugins/content-releases",
|
|
1009
|
+
state: {
|
|
1010
|
+
errors: errorsArray
|
|
1011
|
+
}
|
|
1045
1012
|
}
|
|
1046
1013
|
}
|
|
1047
1014
|
);
|
|
1048
1015
|
}
|
|
1049
1016
|
if (isError || !releaseActions) {
|
|
1050
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.AnErrorOccurred, {}) });
|
|
1051
1018
|
}
|
|
1052
1019
|
if (Object.keys(releaseActions).length === 0) {
|
|
1053
1020
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1054
|
-
|
|
1021
|
+
helperPlugin.NoContent,
|
|
1055
1022
|
{
|
|
1023
|
+
content: {
|
|
1024
|
+
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1025
|
+
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
1026
|
+
},
|
|
1056
1027
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1057
1028
|
v2.LinkButton,
|
|
1058
1029
|
{
|
|
@@ -1067,54 +1038,10 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1067
1038
|
defaultMessage: "Open the Content Manager"
|
|
1068
1039
|
})
|
|
1069
1040
|
}
|
|
1070
|
-
)
|
|
1071
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.EmptyDocuments, { width: "10rem" }),
|
|
1072
|
-
content: formatMessage({
|
|
1073
|
-
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1074
|
-
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
1075
|
-
})
|
|
1041
|
+
)
|
|
1076
1042
|
}
|
|
1077
1043
|
) });
|
|
1078
1044
|
}
|
|
1079
|
-
const headers = [
|
|
1080
|
-
{
|
|
1081
|
-
label: formatMessage({
|
|
1082
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1083
|
-
defaultMessage: "name"
|
|
1084
|
-
}),
|
|
1085
|
-
name: "name"
|
|
1086
|
-
},
|
|
1087
|
-
{
|
|
1088
|
-
label: formatMessage({
|
|
1089
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1090
|
-
defaultMessage: "locale"
|
|
1091
|
-
}),
|
|
1092
|
-
name: "locale"
|
|
1093
|
-
},
|
|
1094
|
-
{
|
|
1095
|
-
label: formatMessage({
|
|
1096
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
1097
|
-
defaultMessage: "content-type"
|
|
1098
|
-
}),
|
|
1099
|
-
name: "content-type"
|
|
1100
|
-
},
|
|
1101
|
-
{
|
|
1102
|
-
label: formatMessage({
|
|
1103
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
1104
|
-
defaultMessage: "action"
|
|
1105
|
-
}),
|
|
1106
|
-
name: "action"
|
|
1107
|
-
},
|
|
1108
|
-
...!release.releasedAt ? [
|
|
1109
|
-
{
|
|
1110
|
-
label: formatMessage({
|
|
1111
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
1112
|
-
defaultMessage: "status"
|
|
1113
|
-
}),
|
|
1114
|
-
name: "status"
|
|
1115
|
-
}
|
|
1116
|
-
] : []
|
|
1117
|
-
];
|
|
1118
1045
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1119
1046
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1120
1047
|
designSystem.SingleSelect,
|
|
@@ -1140,18 +1067,75 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1140
1067
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
1141
1068
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { role: "separator", "aria-label": key, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: key }) }),
|
|
1142
1069
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1143
|
-
|
|
1070
|
+
helperPlugin.Table.Root,
|
|
1144
1071
|
{
|
|
1145
1072
|
rows: releaseActions[key].map((item) => ({
|
|
1146
1073
|
...item,
|
|
1147
1074
|
id: Number(item.entry.id)
|
|
1148
1075
|
})),
|
|
1149
|
-
|
|
1150
|
-
isLoading
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
/* @__PURE__ */ jsxRuntime.
|
|
1154
|
-
|
|
1076
|
+
colCount: releaseActions[key].length,
|
|
1077
|
+
isLoading,
|
|
1078
|
+
isFetching,
|
|
1079
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Content, { children: [
|
|
1080
|
+
/* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Head, { children: [
|
|
1081
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1082
|
+
helperPlugin.Table.HeaderCell,
|
|
1083
|
+
{
|
|
1084
|
+
fieldSchemaType: "string",
|
|
1085
|
+
label: formatMessage({
|
|
1086
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1087
|
+
defaultMessage: "name"
|
|
1088
|
+
}),
|
|
1089
|
+
name: "name"
|
|
1090
|
+
}
|
|
1091
|
+
),
|
|
1092
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1093
|
+
helperPlugin.Table.HeaderCell,
|
|
1094
|
+
{
|
|
1095
|
+
fieldSchemaType: "string",
|
|
1096
|
+
label: formatMessage({
|
|
1097
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1098
|
+
defaultMessage: "locale"
|
|
1099
|
+
}),
|
|
1100
|
+
name: "locale"
|
|
1101
|
+
}
|
|
1102
|
+
),
|
|
1103
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1104
|
+
helperPlugin.Table.HeaderCell,
|
|
1105
|
+
{
|
|
1106
|
+
fieldSchemaType: "string",
|
|
1107
|
+
label: formatMessage({
|
|
1108
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
1109
|
+
defaultMessage: "content-type"
|
|
1110
|
+
}),
|
|
1111
|
+
name: "content-type"
|
|
1112
|
+
}
|
|
1113
|
+
),
|
|
1114
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
|
+
helperPlugin.Table.HeaderCell,
|
|
1116
|
+
{
|
|
1117
|
+
fieldSchemaType: "string",
|
|
1118
|
+
label: formatMessage({
|
|
1119
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
1120
|
+
defaultMessage: "action"
|
|
1121
|
+
}),
|
|
1122
|
+
name: "action"
|
|
1123
|
+
}
|
|
1124
|
+
),
|
|
1125
|
+
!release.releasedAt && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1126
|
+
helperPlugin.Table.HeaderCell,
|
|
1127
|
+
{
|
|
1128
|
+
fieldSchemaType: "string",
|
|
1129
|
+
label: formatMessage({
|
|
1130
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
1131
|
+
defaultMessage: "status"
|
|
1132
|
+
}),
|
|
1133
|
+
name: "status"
|
|
1134
|
+
}
|
|
1135
|
+
)
|
|
1136
|
+
] }),
|
|
1137
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.LoadingBody, {}),
|
|
1138
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.Body, { children: releaseActions[key].map(
|
|
1155
1139
|
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1156
1140
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1157
1141
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
@@ -1208,17 +1192,17 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1208
1192
|
}
|
|
1209
1193
|
)
|
|
1210
1194
|
] }, `releases-group-${key}`)),
|
|
1211
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
)
|
|
1195
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { paddingTop: 4, alignItems: "flex-end", justifyContent: "space-between", children: [
|
|
1196
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.PageSizeURLQuery, { defaultValue: releaseMeta?.pagination?.pageSize.toString() }),
|
|
1197
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1198
|
+
helperPlugin.PaginationURLQuery,
|
|
1199
|
+
{
|
|
1200
|
+
pagination: {
|
|
1201
|
+
pageCount: releaseMeta?.pagination?.pageCount || 0
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
)
|
|
1205
|
+
] })
|
|
1222
1206
|
] }) });
|
|
1223
1207
|
};
|
|
1224
1208
|
const ReleaseDetailsPage = () => {
|
|
@@ -1226,19 +1210,14 @@ const ReleaseDetailsPage = () => {
|
|
|
1226
1210
|
const { releaseId } = reactRouterDom.useParams();
|
|
1227
1211
|
const toggleNotification = helperPlugin.useNotification();
|
|
1228
1212
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
1229
|
-
const
|
|
1213
|
+
const { replace } = reactRouterDom.useHistory();
|
|
1230
1214
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
1231
1215
|
const [showWarningSubmit, setWarningSubmit] = React__namespace.useState(false);
|
|
1232
1216
|
const {
|
|
1233
1217
|
isLoading: isLoadingDetails,
|
|
1234
1218
|
data,
|
|
1235
1219
|
isSuccess: isSuccessDetails
|
|
1236
|
-
} = index.useGetReleaseQuery(
|
|
1237
|
-
{ id: releaseId },
|
|
1238
|
-
{
|
|
1239
|
-
skip: !releaseId
|
|
1240
|
-
}
|
|
1241
|
-
);
|
|
1220
|
+
} = index.useGetReleaseQuery({ id: releaseId });
|
|
1242
1221
|
const [updateRelease, { isLoading: isSubmittingForm }] = index.useUpdateReleaseMutation();
|
|
1243
1222
|
const [deleteRelease, { isLoading: isDeletingRelease }] = index.useDeleteReleaseMutation();
|
|
1244
1223
|
const toggleEditReleaseModal = () => {
|
|
@@ -1251,13 +1230,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1251
1230
|
{
|
|
1252
1231
|
toggleEditReleaseModal,
|
|
1253
1232
|
toggleWarningSubmit,
|
|
1254
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1233
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) })
|
|
1255
1234
|
}
|
|
1256
1235
|
);
|
|
1257
1236
|
}
|
|
1258
|
-
if (!releaseId) {
|
|
1259
|
-
return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: ".." });
|
|
1260
|
-
}
|
|
1261
1237
|
const releaseData = isSuccessDetails && data?.data || null;
|
|
1262
1238
|
const title = releaseData?.name || "";
|
|
1263
1239
|
const timezone = releaseData?.timezone ?? null;
|
|
@@ -1297,7 +1273,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1297
1273
|
id: releaseId
|
|
1298
1274
|
});
|
|
1299
1275
|
if ("data" in response) {
|
|
1300
|
-
|
|
1276
|
+
replace("/plugins/content-releases");
|
|
1301
1277
|
} else if (index.isAxiosError(response.error)) {
|
|
1302
1278
|
toggleNotification({
|
|
1303
1279
|
type: "warning",
|
|
@@ -1316,7 +1292,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1316
1292
|
toggleEditReleaseModal,
|
|
1317
1293
|
toggleWarningSubmit,
|
|
1318
1294
|
children: [
|
|
1319
|
-
/* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsBody, {
|
|
1295
|
+
/* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsBody, {}),
|
|
1320
1296
|
releaseModalShown && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1321
1297
|
ReleaseModal,
|
|
1322
1298
|
{
|
|
@@ -1351,10 +1327,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1351
1327
|
);
|
|
1352
1328
|
};
|
|
1353
1329
|
const App = () => {
|
|
1354
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1355
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1356
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, {
|
|
1330
|
+
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPagePermissions, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Switch, { children: [
|
|
1331
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { exact: true, path: `/plugins/${index.pluginId}`, component: ReleasesPage }),
|
|
1332
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { exact: true, path: `/plugins/${index.pluginId}/:releaseId`, component: ReleaseDetailsPage })
|
|
1357
1333
|
] }) });
|
|
1358
1334
|
};
|
|
1359
1335
|
exports.App = App;
|
|
1360
|
-
//# sourceMappingURL=App-
|
|
1336
|
+
//# sourceMappingURL=App-l62gIUTX.js.map
|