@strapi/content-releases 5.0.0-beta.1 → 5.0.0-beta.11
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-1LckaIGY.js → App-B5UOQWbt.js} +375 -368
- package/dist/_chunks/App-B5UOQWbt.js.map +1 -0
- package/dist/_chunks/{App-X01LBg5V.mjs → App-DcXlnXrr.mjs} +371 -363
- package/dist/_chunks/App-DcXlnXrr.mjs.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/SettingsPage-ped5WZ6Q.js +40 -0
- package/dist/_chunks/SettingsPage-ped5WZ6Q.js.map +1 -0
- package/dist/_chunks/SettingsPage-w5dOMAtL.mjs +40 -0
- package/dist/_chunks/SettingsPage-w5dOMAtL.mjs.map +1 -0
- package/dist/_chunks/{en-faJDuv3q.js → en-aH5E5UNw.js} +12 -2
- package/dist/_chunks/en-aH5E5UNw.js.map +1 -0
- package/dist/_chunks/{en-RdapH-9X.mjs → en-ahPQUZv2.mjs} +12 -2
- package/dist/_chunks/en-ahPQUZv2.mjs.map +1 -0
- package/dist/_chunks/{index-cYWov2wa.js → index-BgID5UQ7.js} +549 -525
- package/dist/_chunks/index-BgID5UQ7.js.map +1 -0
- package/dist/_chunks/{index-OD9AlD-6.mjs → index-LUuvped4.mjs} +551 -525
- package/dist/_chunks/index-LUuvped4.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/ReleaseAction.d.ts +3 -0
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +3 -3
- package/dist/admin/src/components/ReleaseActionModal.d.ts +24 -0
- package/dist/admin/src/components/ReleaseListCell.d.ts +0 -0
- package/dist/admin/src/components/ReleaseModal.d.ts +3 -2
- package/dist/admin/src/components/ReleasesPanel.d.ts +3 -0
- package/dist/admin/src/pages/SettingsPage.d.ts +1 -0
- package/dist/admin/src/services/release.d.ts +51 -313
- package/dist/admin/src/utils/api.d.ts +6 -0
- package/dist/server/index.js +824 -579
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +825 -580
- 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/constants.d.ts +11 -2
- package/dist/server/src/constants.d.ts.map +1 -1
- package/dist/server/src/content-types/index.d.ts +3 -5
- package/dist/server/src/content-types/index.d.ts.map +1 -1
- package/dist/server/src/content-types/release-action/index.d.ts +3 -5
- package/dist/server/src/content-types/release-action/index.d.ts.map +1 -1
- package/dist/server/src/content-types/release-action/schema.d.ts +3 -5
- package/dist/server/src/content-types/release-action/schema.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts +6 -2
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/release-action.d.ts +0 -1
- package/dist/server/src/controllers/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/release.d.ts +7 -1
- package/dist/server/src/controllers/release.d.ts.map +1 -1
- package/dist/server/src/controllers/settings.d.ts +11 -0
- package/dist/server/src/controllers/settings.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/release-action.d.ts +7 -1
- package/dist/server/src/controllers/validation/release-action.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/release.d.ts +1 -0
- package/dist/server/src/controllers/validation/release.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/settings.d.ts +2 -0
- package/dist/server/src/controllers/validation/settings.d.ts.map +1 -0
- 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 +73 -57
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/middlewares/documents.d.ts +6 -0
- package/dist/server/src/middlewares/documents.d.ts.map +1 -0
- package/dist/server/src/migrations/database/5.0.0-document-id-in-actions.d.ts +9 -0
- package/dist/server/src/migrations/database/5.0.0-document-id-in-actions.d.ts.map +1 -0
- 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/index.d.ts +16 -0
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/routes/release-action.d.ts.map +1 -1
- package/dist/server/src/routes/release.d.ts.map +1 -1
- package/dist/server/src/routes/settings.d.ts +18 -0
- package/dist/server/src/routes/settings.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +41 -41
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts +36 -0
- package/dist/server/src/services/release-action.d.ts.map +1 -0
- package/dist/server/src/services/release.d.ts +7 -42
- 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/settings.d.ts +13 -0
- package/dist/server/src/services/settings.d.ts.map +1 -0
- 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 +33 -12
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +6 -5
- package/dist/shared/contracts/release-actions.d.ts.map +1 -1
- package/dist/shared/contracts/releases.d.ts +23 -6
- package/dist/shared/contracts/releases.d.ts.map +1 -1
- package/dist/shared/contracts/settings.d.ts +39 -0
- package/dist/shared/contracts/settings.d.ts.map +1 -0
- package/dist/shared/validation-schemas.d.ts +1 -0
- package/dist/shared/validation-schemas.d.ts.map +1 -1
- package/package.json +19 -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/components/CMReleasesContainer.d.ts +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-BgID5UQ7.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({
|
|
@@ -89,8 +90,12 @@ const RELEASE_SCHEMA = yup__namespace.object().shape({
|
|
|
89
90
|
otherwise: yup__namespace.string().nullable()
|
|
90
91
|
})
|
|
91
92
|
}).required().noUnknown();
|
|
93
|
+
yup__namespace.object().shape({
|
|
94
|
+
defaultTimezone: yup__namespace.string().nullable().default(null)
|
|
95
|
+
}).required().noUnknown();
|
|
92
96
|
const ReleaseModal = ({
|
|
93
97
|
handleClose,
|
|
98
|
+
open,
|
|
94
99
|
handleSubmit,
|
|
95
100
|
initialValues,
|
|
96
101
|
isLoading = false
|
|
@@ -105,9 +110,8 @@ const ReleaseModal = ({
|
|
|
105
110
|
const { date, time, timezone } = values;
|
|
106
111
|
if (!date || !time || !timezone)
|
|
107
112
|
return null;
|
|
108
|
-
const formattedDate = dateFns.parse(time, "HH:mm", new Date(date));
|
|
109
113
|
const timezoneWithoutOffset = timezone.split("&")[1];
|
|
110
|
-
return dateFnsTz.zonedTimeToUtc(
|
|
114
|
+
return dateFnsTz.zonedTimeToUtc(`${date} ${time}`, timezoneWithoutOffset);
|
|
111
115
|
};
|
|
112
116
|
const getTimezoneWithOffset = () => {
|
|
113
117
|
const currentTimezone = timezoneList.find(
|
|
@@ -115,8 +119,8 @@ const ReleaseModal = ({
|
|
|
115
119
|
);
|
|
116
120
|
return currentTimezone?.value || systemTimezone.value;
|
|
117
121
|
};
|
|
118
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
119
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
122
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: formatMessage(
|
|
120
124
|
{
|
|
121
125
|
id: "content-releases.modal.title",
|
|
122
126
|
defaultMessage: "{isCreatingRelease, select, true {New release} other {Edit release}}"
|
|
@@ -139,123 +143,119 @@ const ReleaseModal = ({
|
|
|
139
143
|
},
|
|
140
144
|
validationSchema: RELEASE_SCHEMA,
|
|
141
145
|
validateOnChange: false,
|
|
142
|
-
children: ({ values, errors, handleChange, setFieldValue }) =>
|
|
143
|
-
|
|
144
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
145
|
-
designSystem.
|
|
146
|
-
|
|
147
|
-
label: formatMessage({
|
|
146
|
+
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
147
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
148
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
149
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
|
|
150
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
148
151
|
id: "content-releases.modal.form.input.label.release-name",
|
|
149
152
|
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({
|
|
153
|
+
}) }),
|
|
154
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
|
|
155
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
156
|
+
] }),
|
|
157
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
158
|
+
designSystem.Checkbox,
|
|
159
|
+
{
|
|
160
|
+
name: "isScheduled",
|
|
161
|
+
checked: values.isScheduled,
|
|
162
|
+
onCheckedChange: (checked) => {
|
|
163
|
+
setFieldValue("isScheduled", checked);
|
|
164
|
+
if (!checked) {
|
|
165
|
+
setFieldValue("date", null);
|
|
166
|
+
setFieldValue("time", "");
|
|
167
|
+
setFieldValue("timezone", null);
|
|
168
|
+
} else {
|
|
169
|
+
setFieldValue("date", initialValues.date);
|
|
170
|
+
setFieldValue("time", initialValues.time);
|
|
171
|
+
setFieldValue(
|
|
172
|
+
"timezone",
|
|
173
|
+
initialValues.timezone ?? systemTimezone?.value
|
|
174
|
+
);
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
178
|
+
designSystem.Typography,
|
|
179
|
+
{
|
|
180
|
+
textColor: values.isScheduled ? "primary600" : "neutral800",
|
|
181
|
+
fontWeight: values.isScheduled ? "semiBold" : "regular",
|
|
182
|
+
children: formatMessage({
|
|
183
|
+
id: "modal.form.input.label.schedule-release",
|
|
184
|
+
defaultMessage: "Schedule release"
|
|
185
|
+
})
|
|
186
|
+
}
|
|
187
|
+
)
|
|
188
|
+
}
|
|
189
|
+
) }),
|
|
190
|
+
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
191
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "date", error: errors.date, required: true, children: [
|
|
193
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
194
194
|
id: "content-releases.modal.form.input.label.date",
|
|
195
195
|
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
|
-
|
|
196
|
+
}) }),
|
|
197
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
198
|
+
designSystem.DatePicker,
|
|
199
|
+
{
|
|
200
|
+
onChange: (date) => {
|
|
201
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
202
|
+
setFieldValue("date", isoFormatDate);
|
|
203
|
+
},
|
|
204
|
+
clearLabel: formatMessage({
|
|
205
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
206
|
+
defaultMessage: "Clear"
|
|
207
|
+
}),
|
|
208
|
+
onClear: () => {
|
|
209
|
+
setFieldValue("date", null);
|
|
210
|
+
},
|
|
211
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
212
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
213
|
+
}
|
|
214
|
+
),
|
|
215
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
216
|
+
] }) }),
|
|
217
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "time", error: errors.time, required: true, children: [
|
|
218
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
219
219
|
id: "content-releases.modal.form.input.label.time",
|
|
220
220
|
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
|
-
|
|
221
|
+
}) }),
|
|
222
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
223
|
+
designSystem.TimePicker,
|
|
224
|
+
{
|
|
225
|
+
onChange: (time) => {
|
|
226
|
+
setFieldValue("time", time);
|
|
227
|
+
},
|
|
228
|
+
clearLabel: formatMessage({
|
|
229
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
230
|
+
defaultMessage: "Clear"
|
|
231
|
+
}),
|
|
232
|
+
onClear: () => {
|
|
233
|
+
setFieldValue("time", "");
|
|
234
|
+
},
|
|
235
|
+
value: values.time || void 0
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
239
|
+
] }) })
|
|
240
|
+
] }),
|
|
241
|
+
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
242
|
+
] })
|
|
243
|
+
] }) }),
|
|
244
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
|
|
245
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Close, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }) }),
|
|
246
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { name: "submit", loading: isLoading, type: "submit", children: formatMessage(
|
|
247
247
|
{
|
|
248
248
|
id: "content-releases.modal.form.button.submit",
|
|
249
249
|
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
250
250
|
},
|
|
251
251
|
{ isCreatingRelease }
|
|
252
252
|
) })
|
|
253
|
-
}
|
|
254
|
-
)
|
|
255
|
-
|
|
253
|
+
] })
|
|
254
|
+
] });
|
|
255
|
+
}
|
|
256
256
|
}
|
|
257
257
|
)
|
|
258
|
-
] });
|
|
258
|
+
] }) });
|
|
259
259
|
};
|
|
260
260
|
const getTimezones = (selectedDate) => {
|
|
261
261
|
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
@@ -281,38 +281,44 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
}, [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
|
-
);
|
|
284
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "timezone", error: errors.timezone, required: true, children: [
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
286
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
287
|
+
defaultMessage: "Timezone"
|
|
288
|
+
}) }),
|
|
289
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
290
|
+
designSystem.Combobox,
|
|
291
|
+
{
|
|
292
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
293
|
+
value: values.timezone || void 0,
|
|
294
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
295
|
+
onChange: (timezone) => {
|
|
296
|
+
setFieldValue("timezone", timezone);
|
|
297
|
+
},
|
|
298
|
+
onTextValueChange: (timezone) => {
|
|
299
|
+
setFieldValue("timezone", timezone);
|
|
300
|
+
},
|
|
301
|
+
onClear: () => {
|
|
302
|
+
setFieldValue("timezone", "");
|
|
303
|
+
},
|
|
304
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
305
|
+
}
|
|
306
|
+
),
|
|
307
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
308
|
+
] });
|
|
309
309
|
};
|
|
310
310
|
const useTypedDispatch = reactRedux.useDispatch;
|
|
311
|
-
const
|
|
311
|
+
const isBaseQueryError = (error) => {
|
|
312
|
+
return typeof error !== "undefined" && error.name !== void 0;
|
|
313
|
+
};
|
|
314
|
+
const LinkCard = styledComponents.styled(designSystem.Link)`
|
|
312
315
|
display: block;
|
|
313
316
|
`;
|
|
314
|
-
const
|
|
315
|
-
|
|
317
|
+
const RelativeTime = styledComponents.styled(RelativeTime$1)`
|
|
318
|
+
display: inline-block;
|
|
319
|
+
&::first-letter {
|
|
320
|
+
text-transform: uppercase;
|
|
321
|
+
}
|
|
316
322
|
`;
|
|
317
323
|
const getBadgeProps = (status) => {
|
|
318
324
|
let color;
|
|
@@ -357,11 +363,11 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
357
363
|
target: sectionTitle
|
|
358
364
|
}
|
|
359
365
|
),
|
|
360
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
366
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" })
|
|
361
367
|
}
|
|
362
368
|
);
|
|
363
369
|
}
|
|
364
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: releases.map(({ id, name, scheduledAt, status }) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
370
|
+
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
371
|
designSystem.Flex,
|
|
366
372
|
{
|
|
367
373
|
direction: "column",
|
|
@@ -376,8 +382,8 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
376
382
|
gap: 4,
|
|
377
383
|
children: [
|
|
378
384
|
/* @__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(
|
|
385
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", tag: "h3", variant: "delta", fontWeight: "bold", children: name }),
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
|
|
381
387
|
id: "content-releases.pages.Releases.not-scheduled",
|
|
382
388
|
defaultMessage: "Not scheduled"
|
|
383
389
|
}) })
|
|
@@ -387,7 +393,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
387
393
|
}
|
|
388
394
|
) }) }, id)) });
|
|
389
395
|
};
|
|
390
|
-
const StyledAlert =
|
|
396
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
391
397
|
button {
|
|
392
398
|
display: none;
|
|
393
399
|
}
|
|
@@ -397,14 +403,13 @@ const StyledAlert = styled__default.default(designSystem.Alert)`
|
|
|
397
403
|
`;
|
|
398
404
|
const INITIAL_FORM_VALUES = {
|
|
399
405
|
name: "",
|
|
400
|
-
date:
|
|
406
|
+
date: void 0,
|
|
401
407
|
time: "",
|
|
402
408
|
isScheduled: true,
|
|
403
409
|
scheduledAt: null,
|
|
404
410
|
timezone: null
|
|
405
411
|
};
|
|
406
412
|
const ReleasesPage = () => {
|
|
407
|
-
const tabRef = React__namespace.useRef(null);
|
|
408
413
|
const location = reactRouterDom.useLocation();
|
|
409
414
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
410
415
|
const { toggleNotification } = strapiAdmin.useNotification();
|
|
@@ -414,7 +419,7 @@ const ReleasesPage = () => {
|
|
|
414
419
|
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
415
420
|
const response = index.useGetReleasesQuery(query);
|
|
416
421
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
417
|
-
const { getFeature } =
|
|
422
|
+
const { getFeature } = ee.useLicenseLimits();
|
|
418
423
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
419
424
|
const { trackUsage } = strapiAdmin.useTracking();
|
|
420
425
|
const {
|
|
@@ -422,7 +427,6 @@ const ReleasesPage = () => {
|
|
|
422
427
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
423
428
|
const { isLoading, isSuccess, isError } = response;
|
|
424
429
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
425
|
-
const activeTabIndex = ["pending", "done"].indexOf(activeTab);
|
|
426
430
|
React__namespace.useEffect(() => {
|
|
427
431
|
if (location?.state?.errors) {
|
|
428
432
|
toggleNotification({
|
|
@@ -439,11 +443,6 @@ const ReleasesPage = () => {
|
|
|
439
443
|
navigate("", { replace: true, state: null });
|
|
440
444
|
}
|
|
441
445
|
}, [formatMessage, location?.state?.errors, navigate, toggleNotification]);
|
|
442
|
-
React__namespace.useEffect(() => {
|
|
443
|
-
if (tabRef.current) {
|
|
444
|
-
tabRef.current._handlers.setSelectedTabIndex(activeTabIndex);
|
|
445
|
-
}
|
|
446
|
-
}, [activeTabIndex]);
|
|
447
446
|
const toggleAddReleaseModal = () => {
|
|
448
447
|
setReleaseModalShown((prev) => !prev);
|
|
449
448
|
};
|
|
@@ -452,14 +451,14 @@ const ReleasesPage = () => {
|
|
|
452
451
|
}
|
|
453
452
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
454
453
|
const hasReachedMaximumPendingReleases = totalPendingReleases >= maximumReleases;
|
|
455
|
-
const handleTabChange = (
|
|
454
|
+
const handleTabChange = (tabValue) => {
|
|
456
455
|
setQuery({
|
|
457
456
|
...query,
|
|
458
457
|
page: 1,
|
|
459
458
|
pageSize: response?.currentData?.meta?.pagination?.pageSize || 16,
|
|
460
459
|
filters: {
|
|
461
460
|
releasedAt: {
|
|
462
|
-
$notNull:
|
|
461
|
+
$notNull: tabValue !== "pending"
|
|
463
462
|
}
|
|
464
463
|
}
|
|
465
464
|
});
|
|
@@ -480,7 +479,7 @@ const ReleasesPage = () => {
|
|
|
480
479
|
});
|
|
481
480
|
trackUsage("didCreateRelease");
|
|
482
481
|
navigate(response2.data.data.id.toString());
|
|
483
|
-
} else if (
|
|
482
|
+
} else if (strapiAdmin.isFetchError(response2.error)) {
|
|
484
483
|
toggleNotification({
|
|
485
484
|
type: "danger",
|
|
486
485
|
message: formatAPIError(response2.error)
|
|
@@ -494,7 +493,7 @@ const ReleasesPage = () => {
|
|
|
494
493
|
};
|
|
495
494
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoading, children: [
|
|
496
495
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
497
|
-
|
|
496
|
+
strapiAdmin.Layouts.Header,
|
|
498
497
|
{
|
|
499
498
|
title: formatMessage({
|
|
500
499
|
id: "content-releases.pages.Releases.title",
|
|
@@ -518,12 +517,12 @@ const ReleasesPage = () => {
|
|
|
518
517
|
) : null
|
|
519
518
|
}
|
|
520
519
|
),
|
|
521
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
522
521
|
hasReachedMaximumPendingReleases && /* @__PURE__ */ jsxRuntime.jsx(
|
|
523
522
|
StyledAlert,
|
|
524
523
|
{
|
|
525
524
|
marginBottom: 6,
|
|
526
|
-
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
525
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { href: "https://strapi.io/pricing-cloud", isExternal: true, children: formatMessage({
|
|
527
526
|
id: "content-releases.pages.Releases.max-limit-reached.action",
|
|
528
527
|
defaultMessage: "Explore plans"
|
|
529
528
|
}) }),
|
|
@@ -543,21 +542,17 @@ const ReleasesPage = () => {
|
|
|
543
542
|
})
|
|
544
543
|
}
|
|
545
544
|
),
|
|
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(
|
|
545
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs.Root, { variant: "simple", onValueChange: handleTabChange, value: activeTab, children: [
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingBottom: 8, children: [
|
|
547
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
548
|
+
designSystem.Tabs.List,
|
|
549
|
+
{
|
|
550
|
+
"aria-label": formatMessage({
|
|
551
|
+
id: "content-releases.pages.Releases.tab-group.label",
|
|
552
|
+
defaultMessage: "Releases list"
|
|
553
|
+
}),
|
|
554
|
+
children: [
|
|
555
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "pending", children: formatMessage(
|
|
561
556
|
{
|
|
562
557
|
id: "content-releases.pages.Releases.tab.pending",
|
|
563
558
|
defaultMessage: "Pending ({count})"
|
|
@@ -566,34 +561,32 @@ const ReleasesPage = () => {
|
|
|
566
561
|
count: totalPendingReleases
|
|
567
562
|
}
|
|
568
563
|
) }),
|
|
569
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
|
564
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Trigger, { value: "done", children: formatMessage({
|
|
570
565
|
id: "content-releases.pages.Releases.tab.done",
|
|
571
566
|
defaultMessage: "Done"
|
|
572
567
|
}) })
|
|
573
|
-
]
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
}
|
|
596
|
-
),
|
|
568
|
+
]
|
|
569
|
+
}
|
|
570
|
+
),
|
|
571
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {})
|
|
572
|
+
] }),
|
|
573
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "pending", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
574
|
+
ReleasesGrid,
|
|
575
|
+
{
|
|
576
|
+
sectionTitle: "pending",
|
|
577
|
+
releases: response?.currentData?.data,
|
|
578
|
+
isError
|
|
579
|
+
}
|
|
580
|
+
) }),
|
|
581
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tabs.Content, { value: "done", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
582
|
+
ReleasesGrid,
|
|
583
|
+
{
|
|
584
|
+
sectionTitle: "done",
|
|
585
|
+
releases: response?.currentData?.data,
|
|
586
|
+
isError
|
|
587
|
+
}
|
|
588
|
+
) })
|
|
589
|
+
] }),
|
|
597
590
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
598
591
|
strapiAdmin.Pagination.Root,
|
|
599
592
|
{
|
|
@@ -606,9 +599,10 @@ const ReleasesPage = () => {
|
|
|
606
599
|
}
|
|
607
600
|
)
|
|
608
601
|
] }) }),
|
|
609
|
-
|
|
602
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
610
603
|
ReleaseModal,
|
|
611
604
|
{
|
|
605
|
+
open: releaseModalShown,
|
|
612
606
|
handleClose: toggleAddReleaseModal,
|
|
613
607
|
handleSubmit: handleAddRelease,
|
|
614
608
|
isLoading: isSubmittingForm,
|
|
@@ -617,13 +611,13 @@ const ReleasesPage = () => {
|
|
|
617
611
|
)
|
|
618
612
|
] });
|
|
619
613
|
};
|
|
620
|
-
const ReleaseInfoWrapper =
|
|
614
|
+
const ReleaseInfoWrapper = styledComponents.styled(designSystem.Flex)`
|
|
621
615
|
align-self: stretch;
|
|
622
616
|
border-bottom-right-radius: ${({ theme }) => theme.borderRadius};
|
|
623
617
|
border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
|
|
624
618
|
border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
625
619
|
`;
|
|
626
|
-
const StyledMenuItem =
|
|
620
|
+
const StyledMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
627
621
|
svg path {
|
|
628
622
|
fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
|
|
629
623
|
}
|
|
@@ -632,64 +626,95 @@ const StyledMenuItem = styled__default.default(v2.Menu.Item)`
|
|
|
632
626
|
}
|
|
633
627
|
|
|
634
628
|
&:hover {
|
|
635
|
-
background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
|
|
629
|
+
background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
|
|
636
630
|
}
|
|
637
631
|
`;
|
|
638
|
-
const PencilIcon =
|
|
632
|
+
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
639
633
|
width: ${({ theme }) => theme.spaces[3]};
|
|
640
634
|
height: ${({ theme }) => theme.spaces[3]};
|
|
641
635
|
path {
|
|
642
636
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
643
637
|
}
|
|
644
638
|
`;
|
|
645
|
-
const TrashIcon =
|
|
639
|
+
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
646
640
|
width: ${({ theme }) => theme.spaces[3]};
|
|
647
641
|
height: ${({ theme }) => theme.spaces[3]};
|
|
648
642
|
path {
|
|
649
643
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
650
644
|
}
|
|
651
645
|
`;
|
|
652
|
-
const TypographyMaxWidth =
|
|
646
|
+
const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
|
|
653
647
|
max-width: 300px;
|
|
654
648
|
`;
|
|
655
|
-
const EntryValidationText = ({ action, schema, entry }) => {
|
|
649
|
+
const EntryValidationText = ({ action, schema, entry, status }) => {
|
|
656
650
|
const { formatMessage } = reactIntl.useIntl();
|
|
657
|
-
const { validate } = strapiAdmin.unstable_useDocument(
|
|
651
|
+
const { validate, isLoading } = strapiAdmin$1.unstable_useDocument(
|
|
658
652
|
{
|
|
659
653
|
collectionType: schema?.kind ?? "",
|
|
660
654
|
model: schema?.uid ?? ""
|
|
661
655
|
},
|
|
662
656
|
{
|
|
663
|
-
skip
|
|
657
|
+
// useDocument makes a request to get more data about the entry, but we only want to have the validation function so we skip the request
|
|
658
|
+
skip: true
|
|
664
659
|
}
|
|
665
660
|
);
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
const validationErrorsMessages = Object.entries(errors).map(
|
|
669
|
-
([key, value]) => formatMessage(
|
|
670
|
-
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
671
|
-
{ field: key }
|
|
672
|
-
)
|
|
673
|
-
).join(" ");
|
|
674
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
675
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { color: "danger600", as: icons.CrossCircle }),
|
|
676
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { textColor: "danger600", variant: "omega", fontWeight: "semiBold", ellipsis: true, children: validationErrorsMessages }) })
|
|
677
|
-
] });
|
|
661
|
+
if (isLoading) {
|
|
662
|
+
return null;
|
|
678
663
|
}
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
664
|
+
const errors = validate(entry) ?? {};
|
|
665
|
+
if (action === "publish") {
|
|
666
|
+
if (Object.keys(errors).length > 0) {
|
|
667
|
+
const validationErrorsMessages = Object.entries(errors).map(
|
|
668
|
+
([key, value]) => formatMessage(
|
|
669
|
+
// @ts-expect-error – TODO: fix this will better checks
|
|
670
|
+
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
671
|
+
{ field: key }
|
|
672
|
+
)
|
|
673
|
+
).join(" ");
|
|
674
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
675
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
676
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
677
|
+
TypographyMaxWidth,
|
|
678
|
+
{
|
|
679
|
+
textColor: "danger600",
|
|
680
|
+
variant: "omega",
|
|
681
|
+
fontWeight: "semiBold",
|
|
682
|
+
ellipsis: true,
|
|
683
|
+
children: validationErrorsMessages
|
|
684
|
+
}
|
|
685
|
+
) })
|
|
686
|
+
] });
|
|
687
|
+
}
|
|
688
|
+
if (status === "draft") {
|
|
689
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
690
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
692
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
693
|
+
defaultMessage: "Ready to publish"
|
|
694
|
+
}) })
|
|
695
|
+
] });
|
|
696
|
+
}
|
|
697
|
+
if (status === "modified") {
|
|
698
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
699
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.ArrowsCounterClockwise, { fill: "alternative600" }),
|
|
700
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
701
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.modified",
|
|
702
|
+
defaultMessage: "Ready to publish changes"
|
|
703
|
+
}) })
|
|
704
|
+
] });
|
|
705
|
+
}
|
|
706
|
+
if (status === "published") {
|
|
707
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
708
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
709
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
710
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
711
|
+
defaultMessage: "Already published"
|
|
712
|
+
}) })
|
|
713
|
+
] });
|
|
714
|
+
}
|
|
690
715
|
}
|
|
691
716
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
692
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
717
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
693
718
|
!entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
694
719
|
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
695
720
|
defaultMessage: "Already unpublished"
|
|
@@ -709,7 +734,6 @@ const ReleaseDetailsLayout = ({
|
|
|
709
734
|
const {
|
|
710
735
|
data,
|
|
711
736
|
isLoading: isLoadingDetails,
|
|
712
|
-
isError,
|
|
713
737
|
error
|
|
714
738
|
} = index.useGetReleaseQuery(
|
|
715
739
|
{ id: releaseId },
|
|
@@ -741,7 +765,7 @@ const ReleaseDetailsLayout = ({
|
|
|
741
765
|
totalPublishedEntries,
|
|
742
766
|
totalUnpublishedEntries
|
|
743
767
|
});
|
|
744
|
-
} else if (
|
|
768
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
745
769
|
toggleNotification({
|
|
746
770
|
type: "danger",
|
|
747
771
|
message: formatAPIError(response.error)
|
|
@@ -776,7 +800,7 @@ const ReleaseDetailsLayout = ({
|
|
|
776
800
|
if (isLoadingDetails) {
|
|
777
801
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
778
802
|
}
|
|
779
|
-
if (
|
|
803
|
+
if (isBaseQueryError(error) && "code" in error || !release) {
|
|
780
804
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
781
805
|
reactRouterDom.Navigate,
|
|
782
806
|
{
|
|
@@ -784,6 +808,7 @@ const ReleaseDetailsLayout = ({
|
|
|
784
808
|
state: {
|
|
785
809
|
errors: [
|
|
786
810
|
{
|
|
811
|
+
// @ts-expect-error – TODO: fix this weird error flow
|
|
787
812
|
code: error?.code
|
|
788
813
|
}
|
|
789
814
|
]
|
|
@@ -823,7 +848,7 @@ const ReleaseDetailsLayout = ({
|
|
|
823
848
|
) : "";
|
|
824
849
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
825
850
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
826
|
-
|
|
851
|
+
strapiAdmin.Layouts.Header,
|
|
827
852
|
{
|
|
828
853
|
title: release.name,
|
|
829
854
|
subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
|
|
@@ -832,84 +857,71 @@ const ReleaseDetailsLayout = ({
|
|
|
832
857
|
] }),
|
|
833
858
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
834
859
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
835
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
{
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
860
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
861
|
+
designSystem.SimpleMenu,
|
|
862
|
+
{
|
|
863
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {}),
|
|
864
|
+
variant: "tertiary",
|
|
865
|
+
endIcon: null,
|
|
866
|
+
paddingLeft: 2,
|
|
867
|
+
paddingRight: 2,
|
|
868
|
+
"aria-label": formatMessage({
|
|
869
|
+
id: "content-releases.header.actions.open-release-actions",
|
|
870
|
+
defaultMessage: "Release edit and delete menu"
|
|
871
|
+
}),
|
|
872
|
+
popoverPlacement: "bottom-end",
|
|
873
|
+
children: [
|
|
874
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { disabled: !canUpdate, onSelect: toggleEditReleaseModal, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
875
|
+
/* @__PURE__ */ jsxRuntime.jsx(PencilIcon, {}),
|
|
876
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: formatMessage({
|
|
877
|
+
id: "content-releases.header.actions.edit",
|
|
878
|
+
defaultMessage: "Edit"
|
|
879
|
+
}) })
|
|
880
|
+
] }) }),
|
|
881
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
882
|
+
StyledMenuItem,
|
|
883
|
+
{
|
|
884
|
+
disabled: !canDelete,
|
|
885
|
+
onSelect: toggleWarningSubmit,
|
|
886
|
+
$variant: "danger",
|
|
887
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
888
|
+
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
889
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
890
|
+
id: "content-releases.header.actions.delete",
|
|
891
|
+
defaultMessage: "Delete"
|
|
865
892
|
}) })
|
|
866
|
-
] }) }),
|
|
867
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
868
|
-
StyledMenuItem,
|
|
869
|
-
{
|
|
870
|
-
disabled: !canDelete,
|
|
871
|
-
onSelect: toggleWarningSubmit,
|
|
872
|
-
variant: "danger",
|
|
873
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
874
|
-
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
875
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
876
|
-
id: "content-releases.header.actions.delete",
|
|
877
|
-
defaultMessage: "Delete"
|
|
878
|
-
}) })
|
|
879
|
-
] })
|
|
880
|
-
}
|
|
881
|
-
)
|
|
882
|
-
]
|
|
883
|
-
}
|
|
884
|
-
),
|
|
885
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
886
|
-
ReleaseInfoWrapper,
|
|
887
|
-
{
|
|
888
|
-
direction: "column",
|
|
889
|
-
justifyContent: "center",
|
|
890
|
-
alignItems: "flex-start",
|
|
891
|
-
gap: 1,
|
|
892
|
-
padding: 5,
|
|
893
|
-
children: [
|
|
894
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
895
|
-
id: "content-releases.header.actions.created",
|
|
896
|
-
defaultMessage: "Created"
|
|
897
|
-
}) }),
|
|
898
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
899
|
-
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(release.createdAt) }),
|
|
900
|
-
formatMessage(
|
|
901
|
-
{
|
|
902
|
-
id: "content-releases.header.actions.created.description",
|
|
903
|
-
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
904
|
-
},
|
|
905
|
-
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
906
|
-
)
|
|
907
893
|
] })
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
894
|
+
}
|
|
895
|
+
),
|
|
896
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
897
|
+
ReleaseInfoWrapper,
|
|
898
|
+
{
|
|
899
|
+
direction: "column",
|
|
900
|
+
justifyContent: "center",
|
|
901
|
+
alignItems: "flex-start",
|
|
902
|
+
gap: 1,
|
|
903
|
+
padding: 5,
|
|
904
|
+
children: [
|
|
905
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
906
|
+
id: "content-releases.header.actions.created",
|
|
907
|
+
defaultMessage: "Created"
|
|
908
|
+
}) }),
|
|
909
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
910
|
+
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
911
|
+
formatMessage(
|
|
912
|
+
{
|
|
913
|
+
id: "content-releases.header.actions.created.description",
|
|
914
|
+
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
915
|
+
},
|
|
916
|
+
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
917
|
+
)
|
|
918
|
+
] })
|
|
919
|
+
]
|
|
920
|
+
}
|
|
921
|
+
)
|
|
922
|
+
]
|
|
923
|
+
}
|
|
924
|
+
),
|
|
913
925
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { size: "S", variant: "tertiary", onClick: handleRefresh, children: formatMessage({
|
|
914
926
|
id: "content-releases.header.actions.refresh",
|
|
915
927
|
defaultMessage: "Refresh"
|
|
@@ -935,6 +947,7 @@ const ReleaseDetailsLayout = ({
|
|
|
935
947
|
] });
|
|
936
948
|
};
|
|
937
949
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
950
|
+
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
938
951
|
const getGroupByOptionLabel = (value) => {
|
|
939
952
|
if (value === "locale") {
|
|
940
953
|
return {
|
|
@@ -961,12 +974,24 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
961
974
|
const {
|
|
962
975
|
data: releaseData,
|
|
963
976
|
isLoading: isReleaseLoading,
|
|
964
|
-
isError: isReleaseError,
|
|
965
977
|
error: releaseError
|
|
966
978
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
967
979
|
const {
|
|
968
980
|
allowedActions: { canUpdate }
|
|
969
981
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
982
|
+
const runHookWaterfall = strapiAdmin.useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
983
|
+
const { displayedHeaders, hasI18nEnabled } = runHookWaterfall("ContentReleases/pages/ReleaseDetails/add-locale-in-releases", {
|
|
984
|
+
displayedHeaders: [
|
|
985
|
+
{
|
|
986
|
+
label: {
|
|
987
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
988
|
+
defaultMessage: "name"
|
|
989
|
+
},
|
|
990
|
+
name: "name"
|
|
991
|
+
}
|
|
992
|
+
],
|
|
993
|
+
hasI18nEnabled: false
|
|
994
|
+
});
|
|
970
995
|
const release = releaseData?.data;
|
|
971
996
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
972
997
|
const {
|
|
@@ -995,7 +1020,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
995
1020
|
// We are passing the action path to found the position in the cache of the action for optimistic updates
|
|
996
1021
|
});
|
|
997
1022
|
if ("error" in response) {
|
|
998
|
-
if (
|
|
1023
|
+
if (strapiAdmin.isFetchError(response.error)) {
|
|
999
1024
|
toggleNotification({
|
|
1000
1025
|
type: "danger",
|
|
1001
1026
|
message: formatAPIError(response.error)
|
|
@@ -1015,14 +1040,14 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1015
1040
|
const releaseMeta = data?.meta;
|
|
1016
1041
|
const contentTypes = releaseMeta?.contentTypes || {};
|
|
1017
1042
|
const components = releaseMeta?.components || {};
|
|
1018
|
-
if (
|
|
1043
|
+
if (isBaseQueryError(releaseError) || !release) {
|
|
1019
1044
|
const errorsArray = [];
|
|
1020
|
-
if (releaseError) {
|
|
1045
|
+
if (releaseError && "code" in releaseError) {
|
|
1021
1046
|
errorsArray.push({
|
|
1022
1047
|
code: releaseError.code
|
|
1023
1048
|
});
|
|
1024
1049
|
}
|
|
1025
|
-
if (releaseActionsError) {
|
|
1050
|
+
if (releaseActionsError && "code" in releaseActionsError) {
|
|
1026
1051
|
errorsArray.push({
|
|
1027
1052
|
code: releaseActionsError.code
|
|
1028
1053
|
});
|
|
@@ -1041,13 +1066,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1041
1066
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
1042
1067
|
}
|
|
1043
1068
|
if (Object.keys(releaseActions).length === 0) {
|
|
1044
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1069
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1045
1070
|
designSystem.EmptyStateLayout,
|
|
1046
1071
|
{
|
|
1047
1072
|
action: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1048
|
-
|
|
1073
|
+
designSystem.LinkButton,
|
|
1049
1074
|
{
|
|
1050
|
-
|
|
1075
|
+
tag: reactRouterDom.Link,
|
|
1051
1076
|
to: {
|
|
1052
1077
|
pathname: "/content-manager"
|
|
1053
1078
|
},
|
|
@@ -1059,7 +1084,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1059
1084
|
})
|
|
1060
1085
|
}
|
|
1061
1086
|
),
|
|
1062
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1087
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(symbols.EmptyDocuments, { width: "16rem" }),
|
|
1063
1088
|
content: formatMessage({
|
|
1064
1089
|
id: "content-releases.pages.Details.tab.emptyEntries",
|
|
1065
1090
|
defaultMessage: "This release is empty. Open the Content Manager, select an entry and add it to the release."
|
|
@@ -1072,45 +1097,33 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1072
1097
|
defaultMessage: "Group by"
|
|
1073
1098
|
});
|
|
1074
1099
|
const headers = [
|
|
1100
|
+
...displayedHeaders,
|
|
1075
1101
|
{
|
|
1076
|
-
label:
|
|
1077
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1078
|
-
defaultMessage: "name"
|
|
1079
|
-
}),
|
|
1080
|
-
name: "name"
|
|
1081
|
-
},
|
|
1082
|
-
{
|
|
1083
|
-
label: formatMessage({
|
|
1084
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
1085
|
-
defaultMessage: "locale"
|
|
1086
|
-
}),
|
|
1087
|
-
name: "locale"
|
|
1088
|
-
},
|
|
1089
|
-
{
|
|
1090
|
-
label: formatMessage({
|
|
1102
|
+
label: {
|
|
1091
1103
|
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
1092
1104
|
defaultMessage: "content-type"
|
|
1093
|
-
}
|
|
1105
|
+
},
|
|
1094
1106
|
name: "content-type"
|
|
1095
1107
|
},
|
|
1096
1108
|
{
|
|
1097
|
-
label:
|
|
1109
|
+
label: {
|
|
1098
1110
|
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
1099
1111
|
defaultMessage: "action"
|
|
1100
|
-
}
|
|
1112
|
+
},
|
|
1101
1113
|
name: "action"
|
|
1102
1114
|
},
|
|
1103
1115
|
...!release.releasedAt ? [
|
|
1104
1116
|
{
|
|
1105
|
-
label:
|
|
1117
|
+
label: {
|
|
1106
1118
|
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
1107
1119
|
defaultMessage: "status"
|
|
1108
|
-
}
|
|
1120
|
+
},
|
|
1109
1121
|
name: "status"
|
|
1110
1122
|
}
|
|
1111
1123
|
] : []
|
|
1112
1124
|
];
|
|
1113
|
-
|
|
1125
|
+
const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
|
|
1126
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
1114
1127
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1115
1128
|
designSystem.SingleSelect,
|
|
1116
1129
|
{
|
|
@@ -1127,7 +1140,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1127
1140
|
),
|
|
1128
1141
|
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
1129
1142
|
onChange: (value) => setQuery({ groupBy: value }),
|
|
1130
|
-
children:
|
|
1143
|
+
children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
1131
1144
|
}
|
|
1132
1145
|
) }),
|
|
1133
1146
|
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
@@ -1142,12 +1155,12 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1142
1155
|
headers,
|
|
1143
1156
|
isLoading: isLoading || isFetching,
|
|
1144
1157
|
children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
|
|
1145
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Head, { children: headers.map((
|
|
1158
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Head, { children: headers.map(({ label, name }) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { label: formatMessage(label), name }, name)) }),
|
|
1146
1159
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Loading, {}),
|
|
1147
1160
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: releaseActions[key].map(
|
|
1148
|
-
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1161
|
+
({ id, contentType, locale, type, entry, status }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1149
1162
|
/* @__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 : "-"}` }) }),
|
|
1163
|
+
hasI18nEnabled && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1151
1164
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
1152
1165
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
1153
1166
|
{
|
|
@@ -1174,7 +1187,8 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1174
1187
|
action: type,
|
|
1175
1188
|
schema: contentTypes?.[contentType.uid],
|
|
1176
1189
|
components,
|
|
1177
|
-
entry
|
|
1190
|
+
entry,
|
|
1191
|
+
status
|
|
1178
1192
|
}
|
|
1179
1193
|
) }),
|
|
1180
1194
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(index.ReleaseActionMenu.Root, { children: [
|
|
@@ -1182,7 +1196,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1182
1196
|
index.ReleaseActionMenu.ReleaseActionEntryLinkItem,
|
|
1183
1197
|
{
|
|
1184
1198
|
contentTypeUid: contentType.uid,
|
|
1185
|
-
|
|
1199
|
+
documentId: entry.documentId,
|
|
1186
1200
|
locale: locale?.code
|
|
1187
1201
|
}
|
|
1188
1202
|
),
|
|
@@ -1255,7 +1269,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1255
1269
|
const title = releaseData?.name || "";
|
|
1256
1270
|
const timezone = releaseData?.timezone ?? null;
|
|
1257
1271
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1258
|
-
const date = scheduledAt ?
|
|
1272
|
+
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1259
1273
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
1260
1274
|
const handleEditRelease = async (values) => {
|
|
1261
1275
|
const response = await updateRelease({
|
|
@@ -1272,7 +1286,8 @@ const ReleaseDetailsPage = () => {
|
|
|
1272
1286
|
defaultMessage: "Release updated."
|
|
1273
1287
|
})
|
|
1274
1288
|
});
|
|
1275
|
-
|
|
1289
|
+
toggleEditReleaseModal();
|
|
1290
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1276
1291
|
toggleNotification({
|
|
1277
1292
|
type: "danger",
|
|
1278
1293
|
message: formatAPIError(response.error)
|
|
@@ -1283,7 +1298,6 @@ const ReleaseDetailsPage = () => {
|
|
|
1283
1298
|
message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
|
|
1284
1299
|
});
|
|
1285
1300
|
}
|
|
1286
|
-
toggleEditReleaseModal();
|
|
1287
1301
|
};
|
|
1288
1302
|
const handleDeleteRelease = async () => {
|
|
1289
1303
|
const response = await deleteRelease({
|
|
@@ -1291,7 +1305,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1291
1305
|
});
|
|
1292
1306
|
if ("data" in response) {
|
|
1293
1307
|
navigate("..");
|
|
1294
|
-
} else if (
|
|
1308
|
+
} else if (strapiAdmin.isFetchError(response.error)) {
|
|
1295
1309
|
toggleNotification({
|
|
1296
1310
|
type: "danger",
|
|
1297
1311
|
message: formatAPIError(response.error)
|
|
@@ -1310,9 +1324,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1310
1324
|
toggleWarningSubmit,
|
|
1311
1325
|
children: [
|
|
1312
1326
|
/* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsBody, { releaseId }),
|
|
1313
|
-
|
|
1327
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1314
1328
|
ReleaseModal,
|
|
1315
1329
|
{
|
|
1330
|
+
open: releaseModalShown,
|
|
1316
1331
|
handleClose: toggleEditReleaseModal,
|
|
1317
1332
|
handleSubmit: handleEditRelease,
|
|
1318
1333
|
isLoading: isLoadingDetails || isSubmittingForm,
|
|
@@ -1326,18 +1341,10 @@ const ReleaseDetailsPage = () => {
|
|
|
1326
1341
|
}
|
|
1327
1342
|
}
|
|
1328
1343
|
),
|
|
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
|
-
)
|
|
1344
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: showWarningSubmit, onOpenChange: toggleWarningSubmit, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.ConfirmDialog, { onConfirm: handleDeleteRelease, children: formatMessage({
|
|
1345
|
+
id: "content-releases.dialog.confirmation-message",
|
|
1346
|
+
defaultMessage: "Are you sure you want to delete this release?"
|
|
1347
|
+
}) }) })
|
|
1341
1348
|
]
|
|
1342
1349
|
}
|
|
1343
1350
|
);
|
|
@@ -1349,4 +1356,4 @@ const App = () => {
|
|
|
1349
1356
|
] }) });
|
|
1350
1357
|
};
|
|
1351
1358
|
exports.App = App;
|
|
1352
|
-
//# sourceMappingURL=App-
|
|
1359
|
+
//# sourceMappingURL=App-B5UOQWbt.js.map
|