@strapi/content-releases 5.0.0-beta.0 → 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-IkyOz9wq.mjs → App-B2R2exNT.mjs} +257 -256
- package/dist/_chunks/App-B2R2exNT.mjs.map +1 -0
- package/dist/_chunks/{App-FuRaphre.js → App-CEwOQkKT.js} +265 -265
- 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-Sb3Nal8H.js → index-BrWv-zV4.js} +169 -193
- package/dist/_chunks/index-BrWv-zV4.js.map +1 -0
- package/dist/_chunks/{index-qP3rNiDS.mjs → index-DbmynICx.mjs} +170 -192
- 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 +56 -320
- package/dist/admin/src/utils/api.d.ts +6 -0
- package/dist/server/index.js +101 -52
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +102 -53
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts +2 -2
- 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/controllers/validation/release-action.d.ts +7 -2
- package/dist/server/src/controllers/validation/release-action.d.ts.map +1 -1
- package/dist/server/src/destroy.d.ts +2 -2
- package/dist/server/src/destroy.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +1412 -1411
- 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 +2 -2
- 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 +1407 -1407
- package/dist/server/src/services/release.d.ts +9 -9
- package/dist/server/src/services/release.d.ts.map +1 -1
- package/dist/server/src/services/scheduling.d.ts +6 -6
- package/dist/server/src/services/scheduling.d.ts.map +1 -1
- package/dist/server/src/services/validation.d.ts +2 -2
- package/dist/server/src/services/validation.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +10 -10
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +9 -9
- package/dist/shared/contracts/release-actions.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/dist/shared/types.d.ts +2 -2
- package/dist/shared/types.d.ts.map +1 -1
- package/package.json +19 -19
- package/dist/_chunks/App-FuRaphre.js.map +0 -1
- package/dist/_chunks/App-IkyOz9wq.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-Sb3Nal8H.js.map +0 -1
- package/dist/_chunks/index-qP3rNiDS.mjs.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)
|
|
@@ -754,7 +745,12 @@ const ReleaseDetailsLayout = ({
|
|
|
754
745
|
}
|
|
755
746
|
};
|
|
756
747
|
const handleRefresh = () => {
|
|
757
|
-
dispatch(
|
|
748
|
+
dispatch(
|
|
749
|
+
index.releaseApi.util.invalidateTags([
|
|
750
|
+
{ type: "ReleaseAction", id: "LIST" },
|
|
751
|
+
{ type: "Release", id: releaseId }
|
|
752
|
+
])
|
|
753
|
+
);
|
|
758
754
|
};
|
|
759
755
|
const getCreatedByUser = () => {
|
|
760
756
|
if (!release?.createdBy) {
|
|
@@ -771,7 +767,7 @@ const ReleaseDetailsLayout = ({
|
|
|
771
767
|
if (isLoadingDetails) {
|
|
772
768
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
773
769
|
}
|
|
774
|
-
if (
|
|
770
|
+
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
775
771
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
776
772
|
reactRouterDom.Navigate,
|
|
777
773
|
{
|
|
@@ -779,6 +775,7 @@ const ReleaseDetailsLayout = ({
|
|
|
779
775
|
state: {
|
|
780
776
|
errors: [
|
|
781
777
|
{
|
|
778
|
+
// @ts-expect-error – TODO: fix this weird error flow
|
|
782
779
|
code: error?.code
|
|
783
780
|
}
|
|
784
781
|
]
|
|
@@ -818,7 +815,7 @@ const ReleaseDetailsLayout = ({
|
|
|
818
815
|
) : "";
|
|
819
816
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
820
817
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
821
|
-
|
|
818
|
+
strapiAdmin.Layouts.Header,
|
|
822
819
|
{
|
|
823
820
|
title: release.name,
|
|
824
821
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
@@ -827,22 +824,21 @@ const ReleaseDetailsLayout = ({
|
|
|
827
824
|
] }),
|
|
828
825
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
829
826
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
830
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
827
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
|
831
828
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
832
|
-
|
|
829
|
+
designSystem.Menu.Trigger,
|
|
833
830
|
{
|
|
834
|
-
as: designSystem.IconButton,
|
|
835
831
|
paddingLeft: 2,
|
|
836
832
|
paddingRight: 2,
|
|
837
833
|
"aria-label": formatMessage({
|
|
838
834
|
id: "content-releases.header.actions.open-release-actions",
|
|
839
835
|
defaultMessage: "Release edit and delete menu"
|
|
840
836
|
}),
|
|
841
|
-
|
|
842
|
-
|
|
837
|
+
variant: "tertiary",
|
|
838
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {})
|
|
843
839
|
}
|
|
844
840
|
),
|
|
845
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
841
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { top: 1, popoverPlacement: "bottom-end", maxHeight: void 0, children: [
|
|
846
842
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
847
843
|
designSystem.Flex,
|
|
848
844
|
{
|
|
@@ -864,7 +860,7 @@ const ReleaseDetailsLayout = ({
|
|
|
864
860
|
{
|
|
865
861
|
disabled: !canDelete,
|
|
866
862
|
onSelect: toggleWarningSubmit,
|
|
867
|
-
variant: "danger",
|
|
863
|
+
$variant: "danger",
|
|
868
864
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
869
865
|
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
870
866
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
@@ -891,7 +887,7 @@ const ReleaseDetailsLayout = ({
|
|
|
891
887
|
defaultMessage: "Created"
|
|
892
888
|
}) }),
|
|
893
889
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
894
|
-
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
890
|
+
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
895
891
|
formatMessage(
|
|
896
892
|
{
|
|
897
893
|
id: "content-releases.header.actions.created.description",
|
|
@@ -930,6 +926,7 @@ const ReleaseDetailsLayout = ({
|
|
|
930
926
|
] });
|
|
931
927
|
};
|
|
932
928
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
929
|
+
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
933
930
|
const getGroupByOptionLabel = (value) => {
|
|
934
931
|
if (value === "locale") {
|
|
935
932
|
return {
|
|
@@ -956,12 +953,25 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
956
953
|
const {
|
|
957
954
|
data: releaseData,
|
|
958
955
|
isLoading: isReleaseLoading,
|
|
959
|
-
isError: isReleaseError,
|
|
960
956
|
error: releaseError
|
|
961
957
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
962
958
|
const {
|
|
963
959
|
allowedActions: { canUpdate }
|
|
964
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
|
+
);
|
|
965
975
|
const release = releaseData?.data;
|
|
966
976
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
967
977
|
const {
|
|
@@ -990,7 +1000,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
990
1000
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
991
1001
|
});
|
|
992
1002
|
if ("error" in response) {
|
|
993
|
-
if (
|
|
1003
|
+
if (strapiAdmin.isFetchError(response.error)) {
|
|
994
1004
|
toggleNotification({
|
|
995
1005
|
type: "danger",
|
|
996
1006
|
message: formatAPIError(response.error)
|
|
@@ -1010,14 +1020,14 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1010
1020
|
const releaseMeta = data?.meta;
|
|
1011
1021
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
1012
1022
|
const components = releaseMeta?.components || {};
|
|
1013
|
-
if (
|
|
1023
|
+
if (isBaseQueryError(releaseError) || !release) {
|
|
1014
1024
|
const errorsArray = [];
|
|
1015
|
-
if (releaseError) {
|
|
1025
|
+
if (releaseError && "code" in releaseError) {
|
|
1016
1026
|
errorsArray.push({
|
|
1017
1027
|
code: releaseError.code
|
|
1018
1028
|
});
|
|
1019
1029
|
}
|
|
1020
|
-
if (releaseActionsError) {
|
|
1030
|
+
if (releaseActionsError && "code" in releaseActionsError) {
|
|
1021
1031
|
errorsArray.push({
|
|
1022
1032
|
code: releaseActionsError.code
|
|
1023
1033
|
});
|
|
@@ -1036,13 +1046,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1036
1046
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
1037
1047
|
}
|
|
1038
1048
|
if (Object.keys(releaseActions).length === 0) {
|
|
1039
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1049
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1040
1050
|
designSystem.EmptyStateLayout,
|
|
1041
1051
|
{
|
|
1042
1052
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1043
|
-
|
|
1053
|
+
designSystem.LinkButton,
|
|
1044
1054
|
{
|
|
1045
|
-
|
|
1055
|
+
tag: reactRouterDom.Link,
|
|
1046
1056
|
to: {
|
|
1047
1057
|
pathname: "/content-manager"
|
|
1048
1058
|
},
|
|
@@ -1054,7 +1064,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1054
1064
|
})
|
|
1055
1065
|
}
|
|
1056
1066
|
),
|
|
1057
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1067
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" }),
|
|
1058
1068
|
content: formatMessage({
|
|
1059
1069
|
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1060
1070
|
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
@@ -1062,7 +1072,12 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1062
1072
|
}
|
|
1063
1073
|
) });
|
|
1064
1074
|
}
|
|
1075
|
+
const groupByLabel = formatMessage({
|
|
1076
|
+
id: "content-releases.pages.ReleaseDetails.groupBy.aria-label",
|
|
1077
|
+
defaultMessage: "Group by"
|
|
1078
|
+
});
|
|
1065
1079
|
const headers = [
|
|
1080
|
+
// ...displayedHeaders,
|
|
1066
1081
|
{
|
|
1067
1082
|
label: formatMessage({
|
|
1068
1083
|
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
@@ -1070,13 +1085,6 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1070
1085
|
}),
|
|
1071
1086
|
name: "name"
|
|
1072
1087
|
},
|
|
1073
|
-
{
|
|
1074
|
-
label: formatMessage({
|
|
1075
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1076
|
-
defaultMessage: "locale"
|
|
1077
|
-
}),
|
|
1078
|
-
name: "locale"
|
|
1079
|
-
},
|
|
1080
1088
|
{
|
|
1081
1089
|
label: formatMessage({
|
|
1082
1090
|
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
@@ -1101,14 +1109,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1101
1109
|
}
|
|
1102
1110
|
] : []
|
|
1103
1111
|
];
|
|
1104
|
-
|
|
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: [
|
|
1105
1114
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
1115
|
designSystem.SingleSelect,
|
|
1107
1116
|
{
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
defaultMessage: "Group by"
|
|
1111
|
-
}),
|
|
1117
|
+
placeholder: groupByLabel,
|
|
1118
|
+
"aria-label": groupByLabel,
|
|
1112
1119
|
customizeContent: (value) => formatMessage(
|
|
1113
1120
|
{
|
|
1114
1121
|
id: `content-releases.pages.ReleaseDetails.groupBy.label`,
|
|
@@ -1120,7 +1127,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1120
1127
|
),
|
|
1121
1128
|
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
1122
1129
|
onChange: (value) => setQuery({ groupBy: value }),
|
|
1123
|
-
children:
|
|
1130
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
1124
1131
|
}
|
|
1125
1132
|
) }),
|
|
1126
1133
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
@@ -1140,7 +1147,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1140
1147
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: releaseActions[key].map(
|
|
1141
1148
|
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1142
1149
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1143
|
-
/* @__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 : "-"}` }) }),
|
|
1144
1151
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
1145
1152
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
1146
1153
|
{
|
|
@@ -1248,7 +1255,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1248
1255
|
const title = releaseData?.name || "";
|
|
1249
1256
|
const timezone = releaseData?.timezone ?? null;
|
|
1250
1257
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1251
|
-
const date = scheduledAt ?
|
|
1258
|
+
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1252
1259
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
1253
1260
|
const handleEditRelease = async (values) => {
|
|
1254
1261
|
const response = await updateRelease({
|
|
@@ -1265,7 +1272,8 @@ const ReleaseDetailsPage = () => {
|
|
|
1265
1272
|
defaultMessage: "Release updated."
|
|
1266
1273
|
})
|
|
1267
1274
|
});
|
|
1268
|
-
|
|
1275
|
+
toggleEditReleaseModal();
|
|
1276
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1269
1277
|
toggleNotification({
|
|
1270
1278
|
type: "danger",
|
|
1271
1279
|
message: formatAPIError(response.error)
|
|
@@ -1276,7 +1284,6 @@ const ReleaseDetailsPage = () => {
|
|
|
1276
1284
|
message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
|
|
1277
1285
|
});
|
|
1278
1286
|
}
|
|
1279
|
-
toggleEditReleaseModal();
|
|
1280
1287
|
};
|
|
1281
1288
|
const handleDeleteRelease = async () => {
|
|
1282
1289
|
const response = await deleteRelease({
|
|
@@ -1284,7 +1291,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1284
1291
|
});
|
|
1285
1292
|
if ("data" in response) {
|
|
1286
1293
|
navigate("..");
|
|
1287
|
-
} else if (
|
|
1294
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1288
1295
|
toggleNotification({
|
|
1289
1296
|
type: "danger",
|
|
1290
1297
|
message: formatAPIError(response.error)
|
|
@@ -1303,9 +1310,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1303
1310
|
toggleWarningSubmit,
|
|
1304
1311
|
children: [
|
|
1305
1312
|
/* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsBody, { releaseId }),
|
|
1306
|
-
|
|
1313
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1307
1314
|
ReleaseModal,
|
|
1308
1315
|
{
|
|
1316
|
+
open: releaseModalShown,
|
|
1309
1317
|
handleClose: toggleEditReleaseModal,
|
|
1310
1318
|
handleSubmit: handleEditRelease,
|
|
1311
1319
|
isLoading: isLoadingDetails || isSubmittingForm,
|
|
@@ -1319,18 +1327,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1319
1327
|
}
|
|
1320
1328
|
}
|
|
1321
1329
|
),
|
|
1322
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
onClose: toggleWarningSubmit,
|
|
1327
|
-
onConfirm: handleDeleteRelease,
|
|
1328
|
-
children: formatMessage({
|
|
1329
|
-
id: "content-releases.dialog.confirmation-message",
|
|
1330
|
-
defaultMessage: "Are you sure you want to delete this release?"
|
|
1331
|
-
})
|
|
1332
|
-
}
|
|
1333
|
-
)
|
|
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
|
+
}) }) })
|
|
1334
1334
|
]
|
|
1335
1335
|
}
|
|
1336
1336
|
);
|
|
@@ -1342,4 +1342,4 @@ const App = () => {
|
|
|
1342
1342
|
] }) });
|
|
1343
1343
|
};
|
|
1344
1344
|
exports.App = App;
|
|
1345
|
-
//# sourceMappingURL=App-
|
|
1345
|
+
//# sourceMappingURL=App-CEwOQkKT.js.map
|