@strapi/content-releases 5.0.0-beta.1 → 5.0.0-beta.10
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-X01LBg5V.mjs → App-B2R2exNT.mjs} +245 -251
- package/dist/_chunks/App-B2R2exNT.mjs.map +1 -0
- package/dist/_chunks/{App-1LckaIGY.js → App-CEwOQkKT.js} +253 -260
- package/dist/_chunks/App-CEwOQkKT.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-YhAPgpG9.js → PurchaseContentReleases-Be3acS2L.js} +8 -7
- package/dist/_chunks/PurchaseContentReleases-Be3acS2L.js.map +1 -0
- package/dist/_chunks/{PurchaseContentReleases-Clm0iACO.mjs → PurchaseContentReleases-_MxP6-Dt.mjs} +9 -8
- package/dist/_chunks/PurchaseContentReleases-_MxP6-Dt.mjs.map +1 -0
- package/dist/_chunks/{en-RdapH-9X.mjs → en-B9Ur3VsE.mjs} +11 -2
- package/dist/_chunks/en-B9Ur3VsE.mjs.map +1 -0
- package/dist/_chunks/{en-faJDuv3q.js → en-DtFJ5ViE.js} +11 -2
- package/dist/_chunks/en-DtFJ5ViE.js.map +1 -0
- package/dist/_chunks/{index-cYWov2wa.js → index-BrWv-zV4.js} +167 -192
- package/dist/_chunks/index-BrWv-zV4.js.map +1 -0
- package/dist/_chunks/{index-OD9AlD-6.mjs → index-DbmynICx.mjs} +168 -191
- package/dist/_chunks/index-DbmynICx.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/CMReleasesContainer.d.ts +21 -0
- package/dist/admin/src/components/ReleaseAction.d.ts +3 -0
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +1 -1
- package/dist/admin/src/components/ReleaseListCell.d.ts +0 -0
- package/dist/admin/src/components/ReleaseModal.d.ts +3 -2
- package/dist/admin/src/services/release.d.ts +44 -308
- package/dist/admin/src/utils/api.d.ts +6 -0
- package/dist/server/index.js +93 -32
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +93 -32
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts +1 -0
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/release.d.ts +1 -0
- package/dist/server/src/controllers/release.d.ts.map +1 -1
- package/dist/server/src/destroy.d.ts +1 -1
- package/dist/server/src/destroy.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +9 -8
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/migrations/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/release.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/release.d.ts +3 -3
- package/dist/server/src/services/release.d.ts.map +1 -1
- package/dist/server/src/services/scheduling.d.ts +1 -1
- package/dist/server/src/services/scheduling.d.ts.map +1 -1
- package/dist/server/src/services/validation.d.ts +1 -1
- package/dist/server/src/services/validation.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +9 -9
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/releases.d.ts +17 -1
- package/dist/shared/contracts/releases.d.ts.map +1 -1
- package/package.json +18 -18
- package/dist/_chunks/App-1LckaIGY.js.map +0 -1
- package/dist/_chunks/App-X01LBg5V.mjs.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-RdapH-9X.mjs.map +0 -1
- package/dist/_chunks/en-faJDuv3q.js.map +0 -1
- package/dist/_chunks/index-OD9AlD-6.mjs.map +0 -1
- package/dist/_chunks/index-cYWov2wa.js.map +0 -1
- package/dist/admin/src/services/axios.d.ts +0 -29
|
@@ -3,19 +3,21 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const reactRouterDom = require("react-router-dom");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-BrWv-zV4.js");
|
|
7
7
|
const React = require("react");
|
|
8
|
+
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
|
8
9
|
const designSystem = require("@strapi/design-system");
|
|
9
|
-
const v2 = require("@strapi/design-system/v2");
|
|
10
10
|
const icons = require("@strapi/icons");
|
|
11
|
+
const symbols = require("@strapi/icons/symbols");
|
|
11
12
|
const format = require("date-fns/format");
|
|
12
13
|
const dateFnsTz = require("date-fns-tz");
|
|
13
14
|
const reactIntl = require("react-intl");
|
|
14
|
-
const
|
|
15
|
+
const styledComponents = require("styled-components");
|
|
15
16
|
const dateFns = require("date-fns");
|
|
16
17
|
const formik = require("formik");
|
|
17
18
|
const yup = require("yup");
|
|
18
19
|
const reactRedux = require("react-redux");
|
|
20
|
+
const ee = require("@strapi/admin/strapi-admin/ee");
|
|
19
21
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
20
22
|
function _interopNamespace(e) {
|
|
21
23
|
if (e && e.__esModule)
|
|
@@ -37,10 +39,9 @@ function _interopNamespace(e) {
|
|
|
37
39
|
}
|
|
38
40
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
39
41
|
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
40
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
|
41
42
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
42
43
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
43
|
-
const RelativeTime = React__namespace.forwardRef(
|
|
44
|
+
const RelativeTime$1 = React__namespace.forwardRef(
|
|
44
45
|
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
|
45
46
|
const { formatRelativeTime, formatDate, formatTime } = reactIntl.useIntl();
|
|
46
47
|
const interval = dateFns.intervalToDuration({
|
|
@@ -91,6 +92,7 @@ const RELEASE_SCHEMA = yup__namespace.object().shape({
|
|
|
91
92
|
}).required().noUnknown();
|
|
92
93
|
const ReleaseModal = ({
|
|
93
94
|
handleClose,
|
|
95
|
+
open,
|
|
94
96
|
handleSubmit,
|
|
95
97
|
initialValues,
|
|
96
98
|
isLoading = false
|
|
@@ -105,9 +107,8 @@ const ReleaseModal = ({
|
|
|
105
107
|
const { date, time, timezone } = values;
|
|
106
108
|
if (!date || !time || !timezone)
|
|
107
109
|
return null;
|
|
108
|
-
const formattedDate = dateFns.parse(time, "HH:mm", new Date(date));
|
|
109
110
|
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
110
|
-
return dateFnsTz.zonedTimeToUtc(
|
|
111
|
+
return dateFnsTz.zonedTimeToUtc(`${date} ${time}`, timezoneWithoutOffset);
|
|
111
112
|
};
|
|
112
113
|
const getTimezoneWithOffset = () => {
|
|
113
114
|
const currentTimezone = timezoneList.find(
|
|
@@ -115,8 +116,8 @@ const ReleaseModal = ({
|
|
|
115
116
|
);
|
|
116
117
|
return currentTimezone?.value || systemTimezone.value;
|
|
117
118
|
};
|
|
118
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
119
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: formatMessage(
|
|
120
121
|
{
|
|
121
122
|
id: "content-releases.modal.title",
|
|
122
123
|
defaultMessage: "{isCreatingRelease, select, true {New release} other {Edit release}}"
|
|
@@ -139,123 +140,119 @@ const ReleaseModal = ({
|
|
|
139
140
|
},
|
|
140
141
|
validationSchema: RELEASE_SCHEMA,
|
|
141
142
|
validateOnChange: false,
|
|
142
|
-
children: ({ values, errors, handleChange, setFieldValue }) =>
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
-
designSystem.
|
|
146
|
-
|
|
147
|
-
label: formatMessage({
|
|
143
|
+
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
144
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
145
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
146
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
|
|
147
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
148
148
|
id: "content-releases.modal.form.input.label.release-name",
|
|
149
149
|
defaultMessage: "Name"
|
|
150
|
-
}),
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
designSystem.DatePicker,
|
|
192
|
-
{
|
|
193
|
-
label: formatMessage({
|
|
150
|
+
}) }),
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
153
|
+
] }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
|
+
designSystem.Checkbox,
|
|
156
|
+
{
|
|
157
|
+
name: "isScheduled",
|
|
158
|
+
checked: values.isScheduled,
|
|
159
|
+
onCheckedChange: (checked) => {
|
|
160
|
+
setFieldValue("isScheduled", checked);
|
|
161
|
+
if (!checked) {
|
|
162
|
+
setFieldValue("date", null);
|
|
163
|
+
setFieldValue("time", "");
|
|
164
|
+
setFieldValue("timezone", null);
|
|
165
|
+
} else {
|
|
166
|
+
setFieldValue("date", initialValues.date);
|
|
167
|
+
setFieldValue("time", initialValues.time);
|
|
168
|
+
setFieldValue(
|
|
169
|
+
"timezone",
|
|
170
|
+
initialValues.timezone ?? systemTimezone?.value
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
175
|
+
designSystem.Typography,
|
|
176
|
+
{
|
|
177
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
178
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
179
|
+
children: formatMessage({
|
|
180
|
+
id: "modal.form.input.label.schedule-release",
|
|
181
|
+
defaultMessage: "Schedule release"
|
|
182
|
+
})
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
) }),
|
|
187
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
188
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
189
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "date", error: errors.date, required: true, children: [
|
|
190
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
194
191
|
id: "content-releases.modal.form.input.label.date",
|
|
195
192
|
defaultMessage: "Date"
|
|
196
|
-
}),
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
{
|
|
218
|
-
|
|
193
|
+
}) }),
|
|
194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
195
|
+
designSystem.DatePicker,
|
|
196
|
+
{
|
|
197
|
+
onChange: (date) => {
|
|
198
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
199
|
+
setFieldValue("date", isoFormatDate);
|
|
200
|
+
},
|
|
201
|
+
clearLabel: formatMessage({
|
|
202
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
203
|
+
defaultMessage: "Clear"
|
|
204
|
+
}),
|
|
205
|
+
onClear: () => {
|
|
206
|
+
setFieldValue("date", null);
|
|
207
|
+
},
|
|
208
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
209
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
210
|
+
}
|
|
211
|
+
),
|
|
212
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
213
|
+
] }) }),
|
|
214
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "time", error: errors.time, required: true, children: [
|
|
215
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
219
216
|
id: "content-releases.modal.form.input.label.time",
|
|
220
217
|
defaultMessage: "Time"
|
|
221
|
-
}),
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
{
|
|
245
|
-
|
|
246
|
-
|
|
218
|
+
}) }),
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
220
|
+
designSystem.TimePicker,
|
|
221
|
+
{
|
|
222
|
+
onChange: (time) => {
|
|
223
|
+
setFieldValue("time", time);
|
|
224
|
+
},
|
|
225
|
+
clearLabel: formatMessage({
|
|
226
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
227
|
+
defaultMessage: "Clear"
|
|
228
|
+
}),
|
|
229
|
+
onClear: () => {
|
|
230
|
+
setFieldValue("time", "");
|
|
231
|
+
},
|
|
232
|
+
value: values.time || void 0
|
|
233
|
+
}
|
|
234
|
+
),
|
|
235
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
236
|
+
] }) })
|
|
237
|
+
] }),
|
|
238
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
239
|
+
] })
|
|
240
|
+
] }) }),
|
|
241
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }) }),
|
|
243
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
247
244
|
{
|
|
248
245
|
id: "content-releases.modal.form.button.submit",
|
|
249
246
|
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
250
247
|
},
|
|
251
248
|
{ isCreatingRelease }
|
|
252
249
|
) })
|
|
253
|
-
}
|
|
254
|
-
)
|
|
255
|
-
|
|
250
|
+
] })
|
|
251
|
+
] });
|
|
252
|
+
}
|
|
256
253
|
}
|
|
257
254
|
)
|
|
258
|
-
] });
|
|
255
|
+
] }) });
|
|
259
256
|
};
|
|
260
257
|
const getTimezones = (selectedDate) => {
|
|
261
258
|
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
@@ -281,38 +278,44 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
281
278
|
}
|
|
282
279
|
}
|
|
283
280
|
}, [setFieldValue, values.date, values.timezone]);
|
|
284
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
285
|
-
designSystem.
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
}
|
|
308
|
-
);
|
|
281
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "timezone", error: errors.timezone, required: true, children: [
|
|
282
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
283
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
284
|
+
defaultMessage: "Timezone"
|
|
285
|
+
}) }),
|
|
286
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
287
|
+
designSystem.Combobox,
|
|
288
|
+
{
|
|
289
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
290
|
+
value: values.timezone || void 0,
|
|
291
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
292
|
+
onChange: (timezone) => {
|
|
293
|
+
setFieldValue("timezone", timezone);
|
|
294
|
+
},
|
|
295
|
+
onTextValueChange: (timezone) => {
|
|
296
|
+
setFieldValue("timezone", timezone);
|
|
297
|
+
},
|
|
298
|
+
onClear: () => {
|
|
299
|
+
setFieldValue("timezone", "");
|
|
300
|
+
},
|
|
301
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
302
|
+
}
|
|
303
|
+
),
|
|
304
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
305
|
+
] });
|
|
309
306
|
};
|
|
310
307
|
const useTypedDispatch = reactRedux.useDispatch;
|
|
311
|
-
const
|
|
308
|
+
const isBaseQueryError = (error) => {
|
|
309
|
+
return typeof error !== "undefined" && error.name !== void 0;
|
|
310
|
+
};
|
|
311
|
+
const LinkCard = styledComponents.styled(designSystem.Link)`
|
|
312
312
|
display: block;
|
|
313
313
|
`;
|
|
314
|
-
const
|
|
315
|
-
|
|
314
|
+
const RelativeTime = styledComponents.styled(RelativeTime$1)`
|
|
315
|
+
display: inline-block;
|
|
316
|
+
&::first-letter {
|
|
317
|
+
text-transform: uppercase;
|
|
318
|
+
}
|
|
316
319
|
`;
|
|
317
320
|
const getBadgeProps = (status) => {
|
|
318
321
|
let color;
|
|
@@ -357,11 +360,11 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
357
360
|
target: sectionTitle
|
|
358
361
|
}
|
|
359
362
|
),
|
|
360
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
363
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" })
|
|
361
364
|
}
|
|
362
365
|
);
|
|
363
366
|
}
|
|
364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
367
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 3, s: 6, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
365
368
|
designSystem.Flex,
|
|
366
369
|
{
|
|
367
370
|
direction: "column",
|
|
@@ -376,8 +379,8 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
376
379
|
gap: 4,
|
|
377
380
|
children: [
|
|
378
381
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "start", gap: 1, children: [
|
|
379
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
|
380
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
382
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", tag: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
383
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
381
384
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
382
385
|
defaultMessage: "Not scheduled"
|
|
383
386
|
}) })
|
|
@@ -387,7 +390,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
387
390
|
}
|
|
388
391
|
) }) }, id)) });
|
|
389
392
|
};
|
|
390
|
-
const StyledAlert =
|
|
393
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
391
394
|
button {
|
|
392
395
|
display: none;
|
|
393
396
|
}
|
|
@@ -397,14 +400,13 @@ const StyledAlert = styled__default.default(designSystem.Alert)`
|
|
|
397
400
|
`;
|
|
398
401
|
const INITIAL_FORM_VALUES = {
|
|
399
402
|
name: "",
|
|
400
|
-
date:
|
|
403
|
+
date: void 0,
|
|
401
404
|
time: "",
|
|
402
405
|
isScheduled: true,
|
|
403
406
|
scheduledAt: null,
|
|
404
407
|
timezone: null
|
|
405
408
|
};
|
|
406
409
|
const ReleasesPage = () => {
|
|
407
|
-
const tabRef = React__namespace.useRef(null);
|
|
408
410
|
const location = reactRouterDom.useLocation();
|
|
409
411
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
410
412
|
const { toggleNotification } = strapiAdmin.useNotification();
|
|
@@ -414,7 +416,7 @@ const ReleasesPage = () => {
|
|
|
414
416
|
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
415
417
|
const response = index.useGetReleasesQuery(query);
|
|
416
418
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
417
|
-
const { getFeature } =
|
|
419
|
+
const { getFeature } = ee.useLicenseLimits();
|
|
418
420
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
419
421
|
const { trackUsage } = strapiAdmin.useTracking();
|
|
420
422
|
const {
|
|
@@ -422,7 +424,6 @@ const ReleasesPage = () => {
|
|
|
422
424
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
423
425
|
const { isLoading, isSuccess, isError } = response;
|
|
424
426
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
425
|
-
const activeTabIndex = ["pending", "done"].indexOf(activeTab);
|
|
426
427
|
React__namespace.useEffect(() => {
|
|
427
428
|
if (location?.state?.errors) {
|
|
428
429
|
toggleNotification({
|
|
@@ -439,11 +440,6 @@ const ReleasesPage = () => {
|
|
|
439
440
|
navigate("", { replace: true, state: null });
|
|
440
441
|
}
|
|
441
442
|
}, [formatMessage, location?.state?.errors, navigate, toggleNotification]);
|
|
442
|
-
React__namespace.useEffect(() => {
|
|
443
|
-
if (tabRef.current) {
|
|
444
|
-
tabRef.current._handlers.setSelectedTabIndex(activeTabIndex);
|
|
445
|
-
}
|
|
446
|
-
}, [activeTabIndex]);
|
|
447
443
|
const toggleAddReleaseModal = () => {
|
|
448
444
|
setReleaseModalShown((prev) => !prev);
|
|
449
445
|
};
|
|
@@ -452,14 +448,14 @@ const ReleasesPage = () => {
|
|
|
452
448
|
}
|
|
453
449
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
454
450
|
const hasReachedMaximumPendingReleases = totalPendingReleases >= maximumReleases;
|
|
455
|
-
const handleTabChange = (
|
|
451
|
+
const handleTabChange = (tabValue) => {
|
|
456
452
|
setQuery({
|
|
457
453
|
...query,
|
|
458
454
|
page: 1,
|
|
459
455
|
pageSize: response?.currentData?.meta?.pagination?.pageSize || 16,
|
|
460
456
|
filters: {
|
|
461
457
|
releasedAt: {
|
|
462
|
-
$notNull:
|
|
458
|
+
$notNull: tabValue !== "pending"
|
|
463
459
|
}
|
|
464
460
|
}
|
|
465
461
|
});
|
|
@@ -480,7 +476,7 @@ const ReleasesPage = () => {
|
|
|
480
476
|
});
|
|
481
477
|
trackUsage("didCreateRelease");
|
|
482
478
|
navigate(response2.data.data.id.toString());
|
|
483
|
-
} else if (
|
|
479
|
+
} else if (strapiAdmin.isFetchError(response2.error)) {
|
|
484
480
|
toggleNotification({
|
|
485
481
|
type: "danger",
|
|
486
482
|
message: formatAPIError(response2.error)
|
|
@@ -494,7 +490,7 @@ const ReleasesPage = () => {
|
|
|
494
490
|
};
|
|
495
491
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoading, children: [
|
|
496
492
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
497
|
-
|
|
493
|
+
strapiAdmin.Layouts.Header,
|
|
498
494
|
{
|
|
499
495
|
title: formatMessage({
|
|
500
496
|
id: "content-releases.pages.Releases.title",
|
|
@@ -518,12 +514,12 @@ const ReleasesPage = () => {
|
|
|
518
514
|
) : null
|
|
519
515
|
}
|
|
520
516
|
),
|
|
521
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
517
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
522
518
|
hasReachedMaximumPendingReleases && /* @__PURE__ */ jsxRuntime.jsx(
|
|
523
519
|
StyledAlert,
|
|
524
520
|
{
|
|
525
521
|
marginBottom: 6,
|
|
526
|
-
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
522
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { href: "https://strapi.io/pricing-cloud", isExternal: true, children: formatMessage({
|
|
527
523
|
id: "content-releases.pages.Releases.max-limit-reached.action",
|
|
528
524
|
defaultMessage: "Explore plans"
|
|
529
525
|
}) }),
|
|
@@ -543,21 +539,17 @@ const ReleasesPage = () => {
|
|
|
543
539
|
})
|
|
544
540
|
}
|
|
545
541
|
),
|
|
546
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
547
|
-
designSystem.
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
children: [
|
|
558
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingBottom: 8, children: [
|
|
559
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
|
|
560
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tab, { children: formatMessage(
|
|
542
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { variant: "simple", onValueChange: handleTabChange, value: activeTab, children: [
|
|
543
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingBottom: 8, children: [
|
|
544
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
545
|
+
designSystem.Tabs.List,
|
|
546
|
+
{
|
|
547
|
+
"aria-label": formatMessage({
|
|
548
|
+
id: "content-releases.pages.Releases.tab-group.label",
|
|
549
|
+
defaultMessage: "Releases list"
|
|
550
|
+
}),
|
|
551
|
+
children: [
|
|
552
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "pending", children: formatMessage(
|
|
561
553
|
{
|
|
562
554
|
id: "content-releases.pages.Releases.tab.pending",
|
|
563
555
|
defaultMessage: "Pending ({count})"
|
|
@@ -566,34 +558,32 @@ const ReleasesPage = () => {
|
|
|
566
558
|
count: totalPendingReleases
|
|
567
559
|
}
|
|
568
560
|
) }),
|
|
569
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
561
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "done", children: formatMessage({
|
|
570
562
|
id: "content-releases.pages.Releases.tab.done",
|
|
571
563
|
defaultMessage: "Done"
|
|
572
564
|
}) })
|
|
573
|
-
]
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
),
|
|
565
|
+
]
|
|
566
|
+
}
|
|
567
|
+
),
|
|
568
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {})
|
|
569
|
+
] }),
|
|
570
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "pending", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
571
|
+
ReleasesGrid,
|
|
572
|
+
{
|
|
573
|
+
sectionTitle: "pending",
|
|
574
|
+
releases: response?.currentData?.data,
|
|
575
|
+
isError
|
|
576
|
+
}
|
|
577
|
+
) }),
|
|
578
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "done", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
579
|
+
ReleasesGrid,
|
|
580
|
+
{
|
|
581
|
+
sectionTitle: "done",
|
|
582
|
+
releases: response?.currentData?.data,
|
|
583
|
+
isError
|
|
584
|
+
}
|
|
585
|
+
) })
|
|
586
|
+
] }),
|
|
597
587
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
598
588
|
strapiAdmin.Pagination.Root,
|
|
599
589
|
{
|
|
@@ -606,9 +596,10 @@ const ReleasesPage = () => {
|
|
|
606
596
|
}
|
|
607
597
|
)
|
|
608
598
|
] }) }),
|
|
609
|
-
|
|
599
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
610
600
|
ReleaseModal,
|
|
611
601
|
{
|
|
602
|
+
open: releaseModalShown,
|
|
612
603
|
handleClose: toggleAddReleaseModal,
|
|
613
604
|
handleSubmit: handleAddRelease,
|
|
614
605
|
isLoading: isSubmittingForm,
|
|
@@ -617,13 +608,13 @@ const ReleasesPage = () => {
|
|
|
617
608
|
)
|
|
618
609
|
] });
|
|
619
610
|
};
|
|
620
|
-
const ReleaseInfoWrapper =
|
|
611
|
+
const ReleaseInfoWrapper = styledComponents.styled(designSystem.Flex)`
|
|
621
612
|
align-self: stretch;
|
|
622
613
|
border-bottom-right-radius: ${({ theme }) => theme.borderRadius};
|
|
623
614
|
border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
|
|
624
615
|
border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
625
616
|
`;
|
|
626
|
-
const StyledMenuItem =
|
|
617
|
+
const StyledMenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
|
627
618
|
svg path {
|
|
628
619
|
fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
|
|
629
620
|
}
|
|
@@ -632,29 +623,29 @@ const StyledMenuItem = styled__default.default(v2.Menu.Item)`
|
|
|
632
623
|
}
|
|
633
624
|
|
|
634
625
|
&:hover {
|
|
635
|
-
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
626
|
+
background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
|
|
636
627
|
}
|
|
637
628
|
`;
|
|
638
|
-
const PencilIcon =
|
|
629
|
+
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
639
630
|
width: ${({ theme }) => theme.spaces[3]};
|
|
640
631
|
height: ${({ theme }) => theme.spaces[3]};
|
|
641
632
|
path {
|
|
642
633
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
643
634
|
}
|
|
644
635
|
`;
|
|
645
|
-
const TrashIcon =
|
|
636
|
+
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
646
637
|
width: ${({ theme }) => theme.spaces[3]};
|
|
647
638
|
height: ${({ theme }) => theme.spaces[3]};
|
|
648
639
|
path {
|
|
649
640
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
650
641
|
}
|
|
651
642
|
`;
|
|
652
|
-
const TypographyMaxWidth =
|
|
643
|
+
const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
|
|
653
644
|
max-width: 300px;
|
|
654
645
|
`;
|
|
655
646
|
const EntryValidationText = ({ action, schema, entry }) => {
|
|
656
647
|
const { formatMessage } = reactIntl.useIntl();
|
|
657
|
-
const { validate } = strapiAdmin.unstable_useDocument(
|
|
648
|
+
const { validate } = strapiAdmin$1.unstable_useDocument(
|
|
658
649
|
{
|
|
659
650
|
collectionType: schema?.kind ?? "",
|
|
660
651
|
model: schema?.uid ?? ""
|
|
@@ -667,18 +658,19 @@ const EntryValidationText = ({ action, schema, entry }) => {
|
|
|
667
658
|
if (Object.keys(errors).length > 0) {
|
|
668
659
|
const validationErrorsMessages = Object.entries(errors).map(
|
|
669
660
|
([key, value]) => formatMessage(
|
|
661
|
+
// @ts-expect-error – TODO: fix this will better checks
|
|
670
662
|
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
671
663
|
{ field: key }
|
|
672
664
|
)
|
|
673
665
|
).join(" ");
|
|
674
666
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
675
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
667
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
676
668
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { textColor: "danger600", variant: "omega", fontWeight: "semiBold", ellipsis: true, children: validationErrorsMessages }) })
|
|
677
669
|
] });
|
|
678
670
|
}
|
|
679
671
|
if (action == "publish") {
|
|
680
672
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
681
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
682
674
|
entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
683
675
|
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
684
676
|
defaultMessage: "Already published"
|
|
@@ -689,7 +681,7 @@ const EntryValidationText = ({ action, schema, entry }) => {
|
|
|
689
681
|
] });
|
|
690
682
|
}
|
|
691
683
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
692
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
684
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
693
685
|
!entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
694
686
|
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
695
687
|
defaultMessage: "Already unpublished"
|
|
@@ -709,7 +701,6 @@ const ReleaseDetailsLayout = ({
|
|
|
709
701
|
const {
|
|
710
702
|
data,
|
|
711
703
|
isLoading: isLoadingDetails,
|
|
712
|
-
isError,
|
|
713
704
|
error
|
|
714
705
|
} = index.useGetReleaseQuery(
|
|
715
706
|
{ id: releaseId },
|
|
@@ -741,7 +732,7 @@ const ReleaseDetailsLayout = ({
|
|
|
741
732
|
totalPublishedEntries,
|
|
742
733
|
totalUnpublishedEntries
|
|
743
734
|
});
|
|
744
|
-
} else if (
|
|
735
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
745
736
|
toggleNotification({
|
|
746
737
|
type: "danger",
|
|
747
738
|
message: formatAPIError(response.error)
|
|
@@ -776,7 +767,7 @@ const ReleaseDetailsLayout = ({
|
|
|
776
767
|
if (isLoadingDetails) {
|
|
777
768
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
778
769
|
}
|
|
779
|
-
if (
|
|
770
|
+
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
780
771
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
781
772
|
reactRouterDom.Navigate,
|
|
782
773
|
{
|
|
@@ -784,6 +775,7 @@ const ReleaseDetailsLayout = ({
|
|
|
784
775
|
state: {
|
|
785
776
|
errors: [
|
|
786
777
|
{
|
|
778
|
+
// @ts-expect-error – TODO: fix this weird error flow
|
|
787
779
|
code: error?.code
|
|
788
780
|
}
|
|
789
781
|
]
|
|
@@ -823,7 +815,7 @@ const ReleaseDetailsLayout = ({
|
|
|
823
815
|
) : "";
|
|
824
816
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
825
817
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
826
|
-
|
|
818
|
+
strapiAdmin.Layouts.Header,
|
|
827
819
|
{
|
|
828
820
|
title: release.name,
|
|
829
821
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
@@ -832,22 +824,21 @@ const ReleaseDetailsLayout = ({
|
|
|
832
824
|
] }),
|
|
833
825
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
834
826
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
835
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
827
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
836
828
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
837
|
-
|
|
829
|
+
designSystem.Menu.Trigger,
|
|
838
830
|
{
|
|
839
|
-
as: designSystem.IconButton,
|
|
840
831
|
paddingLeft: 2,
|
|
841
832
|
paddingRight: 2,
|
|
842
833
|
"aria-label": formatMessage({
|
|
843
834
|
id: "content-releases.header.actions.open-release-actions",
|
|
844
835
|
defaultMessage: "Release edit and delete menu"
|
|
845
836
|
}),
|
|
846
|
-
|
|
847
|
-
|
|
837
|
+
variant: "tertiary",
|
|
838
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
848
839
|
}
|
|
849
840
|
),
|
|
850
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
841
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { top: 1, popoverPlacement: "bottom-end", maxHeight: void 0, children: [
|
|
851
842
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
852
843
|
designSystem.Flex,
|
|
853
844
|
{
|
|
@@ -869,7 +860,7 @@ const ReleaseDetailsLayout = ({
|
|
|
869
860
|
{
|
|
870
861
|
disabled: !canDelete,
|
|
871
862
|
onSelect: toggleWarningSubmit,
|
|
872
|
-
variant: "danger",
|
|
863
|
+
$variant: "danger",
|
|
873
864
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
874
865
|
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
875
866
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
@@ -896,7 +887,7 @@ const ReleaseDetailsLayout = ({
|
|
|
896
887
|
defaultMessage: "Created"
|
|
897
888
|
}) }),
|
|
898
889
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
899
|
-
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
890
|
+
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
900
891
|
formatMessage(
|
|
901
892
|
{
|
|
902
893
|
id: "content-releases.header.actions.created.description",
|
|
@@ -935,6 +926,7 @@ const ReleaseDetailsLayout = ({
|
|
|
935
926
|
] });
|
|
936
927
|
};
|
|
937
928
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
929
|
+
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
938
930
|
const getGroupByOptionLabel = (value) => {
|
|
939
931
|
if (value === "locale") {
|
|
940
932
|
return {
|
|
@@ -961,12 +953,25 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
961
953
|
const {
|
|
962
954
|
data: releaseData,
|
|
963
955
|
isLoading: isReleaseLoading,
|
|
964
|
-
isError: isReleaseError,
|
|
965
956
|
error: releaseError
|
|
966
957
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
967
958
|
const {
|
|
968
959
|
allowedActions: { canUpdate }
|
|
969
960
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
961
|
+
const runHookWaterfall = strapiAdmin.useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
962
|
+
const { hasI18nEnabled } = runHookWaterfall(
|
|
963
|
+
"ContentReleases/pages/ReleaseDetails/add-locale-in-releases",
|
|
964
|
+
{
|
|
965
|
+
displayedHeaders: {
|
|
966
|
+
label: formatMessage({
|
|
967
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
968
|
+
defaultMessage: "locale"
|
|
969
|
+
}),
|
|
970
|
+
name: "locale"
|
|
971
|
+
},
|
|
972
|
+
hasI18nEnabled: false
|
|
973
|
+
}
|
|
974
|
+
);
|
|
970
975
|
const release = releaseData?.data;
|
|
971
976
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
972
977
|
const {
|
|
@@ -995,7 +1000,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
995
1000
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
996
1001
|
});
|
|
997
1002
|
if ("error" in response) {
|
|
998
|
-
if (
|
|
1003
|
+
if (strapiAdmin.isFetchError(response.error)) {
|
|
999
1004
|
toggleNotification({
|
|
1000
1005
|
type: "danger",
|
|
1001
1006
|
message: formatAPIError(response.error)
|
|
@@ -1015,14 +1020,14 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1015
1020
|
const releaseMeta = data?.meta;
|
|
1016
1021
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
1017
1022
|
const components = releaseMeta?.components || {};
|
|
1018
|
-
if (
|
|
1023
|
+
if (isBaseQueryError(releaseError) || !release) {
|
|
1019
1024
|
const errorsArray = [];
|
|
1020
|
-
if (releaseError) {
|
|
1025
|
+
if (releaseError && "code" in releaseError) {
|
|
1021
1026
|
errorsArray.push({
|
|
1022
1027
|
code: releaseError.code
|
|
1023
1028
|
});
|
|
1024
1029
|
}
|
|
1025
|
-
if (releaseActionsError) {
|
|
1030
|
+
if (releaseActionsError && "code" in releaseActionsError) {
|
|
1026
1031
|
errorsArray.push({
|
|
1027
1032
|
code: releaseActionsError.code
|
|
1028
1033
|
});
|
|
@@ -1041,13 +1046,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1041
1046
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
1042
1047
|
}
|
|
1043
1048
|
if (Object.keys(releaseActions).length === 0) {
|
|
1044
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1049
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1045
1050
|
designSystem.EmptyStateLayout,
|
|
1046
1051
|
{
|
|
1047
1052
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1048
|
-
|
|
1053
|
+
designSystem.LinkButton,
|
|
1049
1054
|
{
|
|
1050
|
-
|
|
1055
|
+
tag: reactRouterDom.Link,
|
|
1051
1056
|
to: {
|
|
1052
1057
|
pathname: "/content-manager"
|
|
1053
1058
|
},
|
|
@@ -1059,7 +1064,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1059
1064
|
})
|
|
1060
1065
|
}
|
|
1061
1066
|
),
|
|
1062
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1067
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" }),
|
|
1063
1068
|
content: formatMessage({
|
|
1064
1069
|
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1065
1070
|
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
@@ -1072,6 +1077,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1072
1077
|
defaultMessage: "Group by"
|
|
1073
1078
|
});
|
|
1074
1079
|
const headers = [
|
|
1080
|
+
// ...displayedHeaders,
|
|
1075
1081
|
{
|
|
1076
1082
|
label: formatMessage({
|
|
1077
1083
|
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
@@ -1079,13 +1085,6 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1079
1085
|
}),
|
|
1080
1086
|
name: "name"
|
|
1081
1087
|
},
|
|
1082
|
-
{
|
|
1083
|
-
label: formatMessage({
|
|
1084
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1085
|
-
defaultMessage: "locale"
|
|
1086
|
-
}),
|
|
1087
|
-
name: "locale"
|
|
1088
|
-
},
|
|
1089
1088
|
{
|
|
1090
1089
|
label: formatMessage({
|
|
1091
1090
|
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
@@ -1110,7 +1109,8 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1110
1109
|
}
|
|
1111
1110
|
] : []
|
|
1112
1111
|
];
|
|
1113
|
-
|
|
1112
|
+
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1113
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1114
1114
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
1115
|
designSystem.SingleSelect,
|
|
1116
1116
|
{
|
|
@@ -1127,7 +1127,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1127
1127
|
),
|
|
1128
1128
|
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
1129
1129
|
onChange: (value) => setQuery({ groupBy: value }),
|
|
1130
|
-
children:
|
|
1130
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
1131
1131
|
}
|
|
1132
1132
|
) }),
|
|
1133
1133
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
@@ -1147,7 +1147,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1147
1147
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: releaseActions[key].map(
|
|
1148
1148
|
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1149
1149
|
/* @__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 : "-"}` }) }),
|
|
1150
|
+
hasI18nEnabled && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1151
1151
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
1152
1152
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
1153
1153
|
{
|
|
@@ -1255,7 +1255,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1255
1255
|
const title = releaseData?.name || "";
|
|
1256
1256
|
const timezone = releaseData?.timezone ?? null;
|
|
1257
1257
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1258
|
-
const date = scheduledAt ?
|
|
1258
|
+
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1259
1259
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
1260
1260
|
const handleEditRelease = async (values) => {
|
|
1261
1261
|
const response = await updateRelease({
|
|
@@ -1272,7 +1272,8 @@ const ReleaseDetailsPage = () => {
|
|
|
1272
1272
|
defaultMessage: "Release updated."
|
|
1273
1273
|
})
|
|
1274
1274
|
});
|
|
1275
|
-
|
|
1275
|
+
toggleEditReleaseModal();
|
|
1276
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1276
1277
|
toggleNotification({
|
|
1277
1278
|
type: "danger",
|
|
1278
1279
|
message: formatAPIError(response.error)
|
|
@@ -1283,7 +1284,6 @@ const ReleaseDetailsPage = () => {
|
|
|
1283
1284
|
message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
|
|
1284
1285
|
});
|
|
1285
1286
|
}
|
|
1286
|
-
toggleEditReleaseModal();
|
|
1287
1287
|
};
|
|
1288
1288
|
const handleDeleteRelease = async () => {
|
|
1289
1289
|
const response = await deleteRelease({
|
|
@@ -1291,7 +1291,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1291
1291
|
});
|
|
1292
1292
|
if ("data" in response) {
|
|
1293
1293
|
navigate("..");
|
|
1294
|
-
} else if (
|
|
1294
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1295
1295
|
toggleNotification({
|
|
1296
1296
|
type: "danger",
|
|
1297
1297
|
message: formatAPIError(response.error)
|
|
@@ -1310,9 +1310,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1310
1310
|
toggleWarningSubmit,
|
|
1311
1311
|
children: [
|
|
1312
1312
|
/* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsBody, { releaseId }),
|
|
1313
|
-
|
|
1313
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1314
1314
|
ReleaseModal,
|
|
1315
1315
|
{
|
|
1316
|
+
open: releaseModalShown,
|
|
1316
1317
|
handleClose: toggleEditReleaseModal,
|
|
1317
1318
|
handleSubmit: handleEditRelease,
|
|
1318
1319
|
isLoading: isLoadingDetails || isSubmittingForm,
|
|
@@ -1326,18 +1327,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1326
1327
|
}
|
|
1327
1328
|
}
|
|
1328
1329
|
),
|
|
1329
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
onClose: toggleWarningSubmit,
|
|
1334
|
-
onConfirm: handleDeleteRelease,
|
|
1335
|
-
children: formatMessage({
|
|
1336
|
-
id: "content-releases.dialog.confirmation-message",
|
|
1337
|
-
defaultMessage: "Are you sure you want to delete this release?"
|
|
1338
|
-
})
|
|
1339
|
-
}
|
|
1340
|
-
)
|
|
1330
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarningSubmit, onOpenChange: toggleWarningSubmit, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleDeleteRelease, children: formatMessage({
|
|
1331
|
+
id: "content-releases.dialog.confirmation-message",
|
|
1332
|
+
defaultMessage: "Are you sure you want to delete this release?"
|
|
1333
|
+
}) }) })
|
|
1341
1334
|
]
|
|
1342
1335
|
}
|
|
1343
1336
|
);
|
|
@@ -1349,4 +1342,4 @@ const App = () => {
|
|
|
1349
1342
|
] }) });
|
|
1350
1343
|
};
|
|
1351
1344
|
exports.App = App;
|
|
1352
|
-
//# sourceMappingURL=App-
|
|
1345
|
+
//# sourceMappingURL=App-CEwOQkKT.js.map
|