@strapi/content-releases 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb → 0.0.0-experimental.d65615a2b9130dd742d3c396674457d7971da928
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/LICENSE +17 -1
- package/dist/_chunks/{App-CEwOQkKT.js → App-BKB1esYS.js} +314 -264
- package/dist/_chunks/App-BKB1esYS.js.map +1 -0
- package/dist/_chunks/{App-B2R2exNT.mjs → App-Cne--1Z8.mjs} +317 -266
- package/dist/_chunks/App-Cne--1Z8.mjs.map +1 -0
- package/dist/_chunks/ReleasesSettingsPage-C1WwGWIH.mjs +178 -0
- package/dist/_chunks/ReleasesSettingsPage-C1WwGWIH.mjs.map +1 -0
- package/dist/_chunks/ReleasesSettingsPage-kuXIwpWp.js +178 -0
- package/dist/_chunks/ReleasesSettingsPage-kuXIwpWp.js.map +1 -0
- package/dist/_chunks/{en-DtFJ5ViE.js → en-CmYoEnA7.js} +9 -2
- package/dist/_chunks/en-CmYoEnA7.js.map +1 -0
- package/dist/_chunks/{en-B9Ur3VsE.mjs → en-D0yVZFqf.mjs} +9 -2
- package/dist/_chunks/en-D0yVZFqf.mjs.map +1 -0
- package/dist/_chunks/{index-BrWv-zV4.js → index-5Odi61vw.js} +793 -441
- package/dist/_chunks/index-5Odi61vw.js.map +1 -0
- package/dist/_chunks/index-Cy7qwpaU.mjs +1362 -0
- package/dist/_chunks/index-Cy7qwpaU.mjs.map +1 -0
- package/dist/_chunks/schemas-BE1LxE9J.js +62 -0
- package/dist/_chunks/schemas-BE1LxE9J.js.map +1 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs +44 -0
- package/dist/_chunks/schemas-DdA2ic2U.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/ReleaseActionMenu.d.ts +2 -2
- package/dist/admin/src/components/{CMReleasesContainer.d.ts → ReleaseActionModal.d.ts} +3 -1
- package/dist/admin/src/components/ReleaseListCell.d.ts +28 -0
- package/dist/admin/src/components/ReleasesPanel.d.ts +3 -0
- package/dist/admin/src/constants.d.ts +18 -0
- package/dist/admin/src/modules/hooks.d.ts +7 -0
- package/dist/admin/src/pages/ReleasesSettingsPage.d.ts +1 -0
- package/dist/admin/src/services/release.d.ts +43 -36
- package/dist/admin/src/utils/time.d.ts +9 -0
- package/dist/admin/src/validation/schemas.d.ts +6 -0
- package/dist/server/index.js +782 -580
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +783 -581
- package/dist/server/index.mjs.map +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 -1
- 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 +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 +2 -0
- package/dist/server/src/controllers/validation/release.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/settings.d.ts +3 -0
- package/dist/server/src/controllers/validation/settings.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +68 -49
- 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.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.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 +40 -38
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/release-action.d.ts +38 -0
- package/dist/server/src/services/release-action.d.ts.map +1 -0
- package/dist/server/src/services/release.d.ts +6 -41
- package/dist/server/src/services/release.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 +1 -1
- package/dist/server/src/services/validation.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +29 -8
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/release-actions.d.ts +9 -10
- package/dist/shared/contracts/release-actions.d.ts.map +1 -1
- package/dist/shared/contracts/releases.d.ts +9 -7
- 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/package.json +15 -13
- package/dist/_chunks/App-B2R2exNT.mjs.map +0 -1
- package/dist/_chunks/App-CEwOQkKT.js.map +0 -1
- package/dist/_chunks/en-B9Ur3VsE.mjs.map +0 -1
- package/dist/_chunks/en-DtFJ5ViE.js.map +0 -1
- package/dist/_chunks/index-BrWv-zV4.js.map +0 -1
- package/dist/_chunks/index-DbmynICx.mjs +0 -1010
- package/dist/_chunks/index-DbmynICx.mjs.map +0 -1
- package/dist/shared/validation-schemas.d.ts +0 -2
- package/dist/shared/validation-schemas.d.ts.map +0 -1
- package/strapi-server.js +0 -3
|
@@ -3,7 +3,7 @@ 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-5Odi61vw.js");
|
|
7
7
|
const React = require("react");
|
|
8
8
|
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
|
9
9
|
const designSystem = require("@strapi/design-system");
|
|
@@ -15,7 +15,7 @@ const reactIntl = require("react-intl");
|
|
|
15
15
|
const styledComponents = require("styled-components");
|
|
16
16
|
const dateFns = require("date-fns");
|
|
17
17
|
const formik = require("formik");
|
|
18
|
-
const
|
|
18
|
+
const schemas = require("./schemas-BE1LxE9J.js");
|
|
19
19
|
const reactRedux = require("react-redux");
|
|
20
20
|
const ee = require("@strapi/admin/strapi-admin/ee");
|
|
21
21
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
@@ -39,7 +39,6 @@ function _interopNamespace(e) {
|
|
|
39
39
|
}
|
|
40
40
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
41
41
|
const format__default = /* @__PURE__ */ _interopDefault(format);
|
|
42
|
-
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
|
43
42
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
|
44
43
|
const RelativeTime$1 = React__namespace.forwardRef(
|
|
45
44
|
({ timestamp, customIntervals = [], ...restProps }, forwardedRef) => {
|
|
@@ -70,26 +69,6 @@ const RelativeTime$1 = React__namespace.forwardRef(
|
|
|
70
69
|
);
|
|
71
70
|
}
|
|
72
71
|
);
|
|
73
|
-
const RELEASE_SCHEMA = yup__namespace.object().shape({
|
|
74
|
-
name: yup__namespace.string().trim().required(),
|
|
75
|
-
scheduledAt: yup__namespace.string().nullable(),
|
|
76
|
-
isScheduled: yup__namespace.boolean().optional(),
|
|
77
|
-
time: yup__namespace.string().when("isScheduled", {
|
|
78
|
-
is: true,
|
|
79
|
-
then: yup__namespace.string().trim().required(),
|
|
80
|
-
otherwise: yup__namespace.string().nullable()
|
|
81
|
-
}),
|
|
82
|
-
timezone: yup__namespace.string().when("isScheduled", {
|
|
83
|
-
is: true,
|
|
84
|
-
then: yup__namespace.string().required().nullable(),
|
|
85
|
-
otherwise: yup__namespace.string().nullable()
|
|
86
|
-
}),
|
|
87
|
-
date: yup__namespace.string().when("isScheduled", {
|
|
88
|
-
is: true,
|
|
89
|
-
then: yup__namespace.string().required().nullable(),
|
|
90
|
-
otherwise: yup__namespace.string().nullable()
|
|
91
|
-
})
|
|
92
|
-
}).required().noUnknown();
|
|
93
72
|
const ReleaseModal = ({
|
|
94
73
|
handleClose,
|
|
95
74
|
open,
|
|
@@ -100,7 +79,7 @@ const ReleaseModal = ({
|
|
|
100
79
|
const { formatMessage } = reactIntl.useIntl();
|
|
101
80
|
const { pathname } = reactRouterDom.useLocation();
|
|
102
81
|
const isCreatingRelease = pathname === `/plugins/${index.pluginId}`;
|
|
103
|
-
const { timezoneList, systemTimezone = { value: "UTC+00:00-Africa/Abidjan " } } = getTimezones(
|
|
82
|
+
const { timezoneList, systemTimezone = { value: "UTC+00:00-Africa/Abidjan " } } = index.getTimezones(
|
|
104
83
|
initialValues.scheduledAt ? new Date(initialValues.scheduledAt) : /* @__PURE__ */ new Date()
|
|
105
84
|
);
|
|
106
85
|
const getScheduledTimestamp = (values) => {
|
|
@@ -138,19 +117,27 @@ const ReleaseModal = ({
|
|
|
138
117
|
...initialValues,
|
|
139
118
|
timezone: initialValues.timezone ? getTimezoneWithOffset() : systemTimezone.value
|
|
140
119
|
},
|
|
141
|
-
validationSchema: RELEASE_SCHEMA,
|
|
120
|
+
validationSchema: schemas.RELEASE_SCHEMA,
|
|
142
121
|
validateOnChange: false,
|
|
143
122
|
children: ({ values, errors, handleChange, setFieldValue }) => {
|
|
144
123
|
return /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
|
|
145
124
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
|
|
146
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
125
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
126
|
+
designSystem.Field.Root,
|
|
127
|
+
{
|
|
128
|
+
name: "name",
|
|
129
|
+
error: errors.name && formatMessage({ id: errors.name, defaultMessage: errors.name }),
|
|
130
|
+
required: true,
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
133
|
+
id: "content-releases.modal.form.input.label.release-name",
|
|
134
|
+
defaultMessage: "Name"
|
|
135
|
+
}) }),
|
|
136
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
138
|
+
]
|
|
139
|
+
}
|
|
140
|
+
),
|
|
154
141
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
155
142
|
designSystem.Checkbox,
|
|
156
143
|
{
|
|
@@ -186,54 +173,70 @@ const ReleaseModal = ({
|
|
|
186
173
|
) }),
|
|
187
174
|
values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
188
175
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
|
|
189
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
176
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
177
|
+
designSystem.Field.Root,
|
|
178
|
+
{
|
|
179
|
+
name: "date",
|
|
180
|
+
error: errors.date && formatMessage({ id: errors.date, defaultMessage: errors.date }),
|
|
181
|
+
required: true,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
184
|
+
id: "content-releases.modal.form.input.label.date",
|
|
185
|
+
defaultMessage: "Date"
|
|
186
|
+
}) }),
|
|
187
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
188
|
+
designSystem.DatePicker,
|
|
189
|
+
{
|
|
190
|
+
onChange: (date) => {
|
|
191
|
+
const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
|
|
192
|
+
setFieldValue("date", isoFormatDate);
|
|
193
|
+
},
|
|
194
|
+
clearLabel: formatMessage({
|
|
195
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
196
|
+
defaultMessage: "Clear"
|
|
197
|
+
}),
|
|
198
|
+
onClear: () => {
|
|
199
|
+
setFieldValue("date", null);
|
|
200
|
+
},
|
|
201
|
+
value: values.date ? new Date(values.date) : /* @__PURE__ */ new Date(),
|
|
202
|
+
minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
|
|
203
|
+
}
|
|
204
|
+
),
|
|
205
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
206
|
+
]
|
|
207
|
+
}
|
|
208
|
+
) }),
|
|
209
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
210
|
+
designSystem.Field.Root,
|
|
211
|
+
{
|
|
212
|
+
name: "time",
|
|
213
|
+
error: errors.time && formatMessage({ id: errors.time, defaultMessage: errors.time }),
|
|
214
|
+
required: true,
|
|
215
|
+
children: [
|
|
216
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
217
|
+
id: "content-releases.modal.form.input.label.time",
|
|
218
|
+
defaultMessage: "Time"
|
|
219
|
+
}) }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
221
|
+
designSystem.TimePicker,
|
|
222
|
+
{
|
|
223
|
+
onChange: (time) => {
|
|
224
|
+
setFieldValue("time", time);
|
|
225
|
+
},
|
|
226
|
+
clearLabel: formatMessage({
|
|
227
|
+
id: "content-releases.modal.form.input.clearLabel",
|
|
228
|
+
defaultMessage: "Clear"
|
|
229
|
+
}),
|
|
230
|
+
onClear: () => {
|
|
231
|
+
setFieldValue("time", "");
|
|
232
|
+
},
|
|
233
|
+
value: values.time || void 0
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
237
|
+
]
|
|
238
|
+
}
|
|
239
|
+
) })
|
|
237
240
|
] }),
|
|
238
241
|
/* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
|
|
239
242
|
] })
|
|
@@ -254,23 +257,13 @@ const ReleaseModal = ({
|
|
|
254
257
|
)
|
|
255
258
|
] }) });
|
|
256
259
|
};
|
|
257
|
-
const getTimezones = (selectedDate) => {
|
|
258
|
-
const timezoneList = Intl.supportedValuesOf("timeZone").map((timezone) => {
|
|
259
|
-
const utcOffset = index.getTimezoneOffset(timezone, selectedDate);
|
|
260
|
-
return { offset: utcOffset, value: `${utcOffset}&${timezone}` };
|
|
261
|
-
});
|
|
262
|
-
const systemTimezone = timezoneList.find(
|
|
263
|
-
(timezone) => timezone.value.split("&")[1] === Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
264
|
-
);
|
|
265
|
-
return { timezoneList, systemTimezone };
|
|
266
|
-
};
|
|
267
260
|
const TimezoneComponent = ({ timezoneOptions }) => {
|
|
268
261
|
const { values, errors, setFieldValue } = formik.useFormikContext();
|
|
269
262
|
const { formatMessage } = reactIntl.useIntl();
|
|
270
263
|
const [timezoneList, setTimezoneList] = React__namespace.useState(timezoneOptions);
|
|
271
264
|
React__namespace.useEffect(() => {
|
|
272
265
|
if (values.date) {
|
|
273
|
-
const { timezoneList: timezoneList2 } = getTimezones(new Date(values.date));
|
|
266
|
+
const { timezoneList: timezoneList2 } = index.getTimezones(new Date(values.date));
|
|
274
267
|
setTimezoneList(timezoneList2);
|
|
275
268
|
const updatedTimezone = values.timezone && timezoneList2.find((tz) => tz.value.split("&")[1] === values.timezone.split("&")[1]);
|
|
276
269
|
if (updatedTimezone) {
|
|
@@ -278,31 +271,39 @@ const TimezoneComponent = ({ timezoneOptions }) => {
|
|
|
278
271
|
}
|
|
279
272
|
}
|
|
280
273
|
}, [setFieldValue, values.date, values.timezone]);
|
|
281
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
274
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
275
|
+
designSystem.Field.Root,
|
|
276
|
+
{
|
|
277
|
+
name: "timezone",
|
|
278
|
+
error: errors.timezone && formatMessage({ id: errors.timezone, defaultMessage: errors.timezone }),
|
|
279
|
+
required: true,
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
|
282
|
+
id: "content-releases.modal.form.input.label.timezone",
|
|
283
|
+
defaultMessage: "Timezone"
|
|
284
|
+
}) }),
|
|
285
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
+
designSystem.Combobox,
|
|
287
|
+
{
|
|
288
|
+
autocomplete: { type: "list", filter: "contains" },
|
|
289
|
+
value: values.timezone || void 0,
|
|
290
|
+
textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
|
|
291
|
+
onChange: (timezone) => {
|
|
292
|
+
setFieldValue("timezone", timezone);
|
|
293
|
+
},
|
|
294
|
+
onTextValueChange: (timezone) => {
|
|
295
|
+
setFieldValue("timezone", timezone);
|
|
296
|
+
},
|
|
297
|
+
onClear: () => {
|
|
298
|
+
setFieldValue("timezone", "");
|
|
299
|
+
},
|
|
300
|
+
children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
|
|
301
|
+
}
|
|
302
|
+
),
|
|
303
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
|
304
|
+
]
|
|
305
|
+
}
|
|
306
|
+
);
|
|
306
307
|
};
|
|
307
308
|
const useTypedDispatch = reactRedux.useDispatch;
|
|
308
309
|
const isBaseQueryError = (error) => {
|
|
@@ -364,7 +365,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
|
|
|
364
365
|
}
|
|
365
366
|
);
|
|
366
367
|
}
|
|
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(
|
|
368
|
+
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, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(LinkCard, { tag: reactRouterDom.NavLink, to: `${id}`, isExternal: false, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
368
369
|
designSystem.Flex,
|
|
369
370
|
{
|
|
370
371
|
direction: "column",
|
|
@@ -400,7 +401,7 @@ const StyledAlert = styledComponents.styled(designSystem.Alert)`
|
|
|
400
401
|
`;
|
|
401
402
|
const INITIAL_FORM_VALUES = {
|
|
402
403
|
name: "",
|
|
403
|
-
date:
|
|
404
|
+
date: dateFns.format(/* @__PURE__ */ new Date(), "yyyy-MM-dd"),
|
|
404
405
|
time: "",
|
|
405
406
|
isScheduled: true,
|
|
406
407
|
scheduledAt: null,
|
|
@@ -415,6 +416,7 @@ const ReleasesPage = () => {
|
|
|
415
416
|
const { formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
416
417
|
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
|
417
418
|
const response = index.useGetReleasesQuery(query);
|
|
419
|
+
const { data, isLoading: isLoadingSettings } = index.useGetReleaseSettingsQuery();
|
|
418
420
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
419
421
|
const { getFeature } = ee.useLicenseLimits();
|
|
420
422
|
const { maximumReleases = 3 } = getFeature("cms-content-releases");
|
|
@@ -422,7 +424,7 @@ const ReleasesPage = () => {
|
|
|
422
424
|
const {
|
|
423
425
|
allowedActions: { canCreate }
|
|
424
426
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
425
|
-
const { isLoading, isSuccess, isError } = response;
|
|
427
|
+
const { isLoading: isLoadingReleases, isSuccess, isError } = response;
|
|
426
428
|
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
427
429
|
React__namespace.useEffect(() => {
|
|
428
430
|
if (location?.state?.errors) {
|
|
@@ -443,7 +445,7 @@ const ReleasesPage = () => {
|
|
|
443
445
|
const toggleAddReleaseModal = () => {
|
|
444
446
|
setReleaseModalShown((prev) => !prev);
|
|
445
447
|
};
|
|
446
|
-
if (
|
|
448
|
+
if (isLoadingReleases || isLoadingSettings) {
|
|
447
449
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
448
450
|
}
|
|
449
451
|
const totalPendingReleases = isSuccess && response.currentData?.meta?.pendingReleasesCount || 0;
|
|
@@ -488,7 +490,7 @@ const ReleasesPage = () => {
|
|
|
488
490
|
});
|
|
489
491
|
}
|
|
490
492
|
};
|
|
491
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy":
|
|
493
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingReleases || isLoadingSettings, children: [
|
|
492
494
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
493
495
|
strapiAdmin.Layouts.Header,
|
|
494
496
|
{
|
|
@@ -603,7 +605,10 @@ const ReleasesPage = () => {
|
|
|
603
605
|
handleClose: toggleAddReleaseModal,
|
|
604
606
|
handleSubmit: handleAddRelease,
|
|
605
607
|
isLoading: isSubmittingForm,
|
|
606
|
-
initialValues:
|
|
608
|
+
initialValues: {
|
|
609
|
+
...INITIAL_FORM_VALUES,
|
|
610
|
+
timezone: data?.data.defaultTimezone ? data.data.defaultTimezone.split("&")[1] : null
|
|
611
|
+
}
|
|
607
612
|
}
|
|
608
613
|
)
|
|
609
614
|
] });
|
|
@@ -614,7 +619,7 @@ const ReleaseInfoWrapper = styledComponents.styled(designSystem.Flex)`
|
|
|
614
619
|
border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
|
|
615
620
|
border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
|
|
616
621
|
`;
|
|
617
|
-
const StyledMenuItem = styledComponents.styled(designSystem.
|
|
622
|
+
const StyledMenuItem = styledComponents.styled(designSystem.MenuItem)`
|
|
618
623
|
svg path {
|
|
619
624
|
fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
|
|
620
625
|
}
|
|
@@ -627,15 +632,15 @@ const StyledMenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
|
|
627
632
|
}
|
|
628
633
|
`;
|
|
629
634
|
const PencilIcon = styledComponents.styled(icons.Pencil)`
|
|
630
|
-
width: ${({ theme }) => theme.spaces[
|
|
631
|
-
height: ${({ theme }) => theme.spaces[
|
|
635
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
636
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
632
637
|
path {
|
|
633
638
|
fill: ${({ theme }) => theme.colors.neutral600};
|
|
634
639
|
}
|
|
635
640
|
`;
|
|
636
641
|
const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
637
|
-
width: ${({ theme }) => theme.spaces[
|
|
638
|
-
height: ${({ theme }) => theme.spaces[
|
|
642
|
+
width: ${({ theme }) => theme.spaces[4]};
|
|
643
|
+
height: ${({ theme }) => theme.spaces[4]};
|
|
639
644
|
path {
|
|
640
645
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
641
646
|
}
|
|
@@ -643,42 +648,90 @@ const TrashIcon = styledComponents.styled(icons.Trash)`
|
|
|
643
648
|
const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
|
|
644
649
|
max-width: 300px;
|
|
645
650
|
`;
|
|
646
|
-
const EntryValidationText = ({ action, schema, entry }) => {
|
|
651
|
+
const EntryValidationText = ({ action, schema, entry, status }) => {
|
|
647
652
|
const { formatMessage } = reactIntl.useIntl();
|
|
648
|
-
const { validate } = strapiAdmin$1.unstable_useDocument(
|
|
653
|
+
const { validate, isLoading } = strapiAdmin$1.unstable_useDocument(
|
|
649
654
|
{
|
|
650
655
|
collectionType: schema?.kind ?? "",
|
|
651
656
|
model: schema?.uid ?? ""
|
|
652
657
|
},
|
|
653
658
|
{
|
|
654
|
-
skip
|
|
659
|
+
// 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
|
|
660
|
+
skip: true
|
|
655
661
|
}
|
|
656
662
|
);
|
|
657
|
-
const
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
663
|
+
const errorsToString = (errors2, prefix = "") => {
|
|
664
|
+
if (Object.keys(errors2).length === 0) {
|
|
665
|
+
return "";
|
|
666
|
+
}
|
|
667
|
+
return Object.entries(errors2).map(([key, value]) => {
|
|
668
|
+
if (value === void 0 || value === null) {
|
|
669
|
+
return "";
|
|
670
|
+
}
|
|
671
|
+
if (typeof value === "string") {
|
|
672
|
+
return formatMessage(
|
|
673
|
+
{ id: value, defaultMessage: value },
|
|
674
|
+
{ field: prefix ? `${prefix}.${key}` : key }
|
|
675
|
+
);
|
|
676
|
+
}
|
|
677
|
+
if (typeof value === "object" && value !== null && "id" in value && "defaultMessage" in value) {
|
|
678
|
+
return formatMessage(
|
|
679
|
+
// @ts-expect-error – TODO: default message will be a string
|
|
680
|
+
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
681
|
+
{ field: prefix ? `${prefix}.${key}` : key }
|
|
682
|
+
);
|
|
683
|
+
}
|
|
684
|
+
return errorsToString(value, key);
|
|
685
|
+
}).join(" ");
|
|
686
|
+
};
|
|
687
|
+
if (isLoading) {
|
|
688
|
+
return null;
|
|
670
689
|
}
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
690
|
+
const errors = validate(entry) ?? {};
|
|
691
|
+
if (action === "publish") {
|
|
692
|
+
if (Object.keys(errors).length > 0) {
|
|
693
|
+
const validationErrorsMessages = errorsToString(errors);
|
|
694
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
695
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
|
696
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
697
|
+
TypographyMaxWidth,
|
|
698
|
+
{
|
|
699
|
+
textColor: "danger600",
|
|
700
|
+
variant: "omega",
|
|
701
|
+
fontWeight: "semiBold",
|
|
702
|
+
ellipsis: true,
|
|
703
|
+
children: validationErrorsMessages
|
|
704
|
+
}
|
|
705
|
+
) })
|
|
706
|
+
] });
|
|
707
|
+
}
|
|
708
|
+
if (status === "draft") {
|
|
709
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
710
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
711
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
712
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
713
|
+
defaultMessage: "Ready to publish"
|
|
714
|
+
}) })
|
|
715
|
+
] });
|
|
716
|
+
}
|
|
717
|
+
if (status === "modified") {
|
|
718
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
719
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.ArrowsCounterClockwise, { fill: "alternative600" }),
|
|
720
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
721
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.modified",
|
|
722
|
+
defaultMessage: "Ready to publish changes"
|
|
723
|
+
}) })
|
|
724
|
+
] });
|
|
725
|
+
}
|
|
726
|
+
if (status === "published") {
|
|
727
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
728
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
729
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
730
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
731
|
+
defaultMessage: "Already published"
|
|
732
|
+
}) })
|
|
733
|
+
] });
|
|
734
|
+
}
|
|
682
735
|
}
|
|
683
736
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
684
737
|
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
|
@@ -824,83 +877,71 @@ const ReleaseDetailsLayout = ({
|
|
|
824
877
|
] }),
|
|
825
878
|
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
|
|
826
879
|
primaryAction: !release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
827
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
{
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
880
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
881
|
+
SimpleMenuButton,
|
|
882
|
+
{
|
|
883
|
+
label: /* @__PURE__ */ jsxRuntime.jsx(icons.More, {}),
|
|
884
|
+
variant: "tertiary",
|
|
885
|
+
endIcon: null,
|
|
886
|
+
paddingLeft: "7px",
|
|
887
|
+
paddingRight: "7px",
|
|
888
|
+
"aria-label": formatMessage({
|
|
889
|
+
id: "content-releases.header.actions.open-release-actions",
|
|
890
|
+
defaultMessage: "Release edit and delete menu"
|
|
891
|
+
}),
|
|
892
|
+
popoverPlacement: "bottom-end",
|
|
893
|
+
children: [
|
|
894
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { disabled: !canUpdate, onSelect: toggleEditReleaseModal, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
895
|
+
/* @__PURE__ */ jsxRuntime.jsx(PencilIcon, {}),
|
|
896
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: formatMessage({
|
|
897
|
+
id: "content-releases.header.actions.edit",
|
|
898
|
+
defaultMessage: "Edit"
|
|
899
|
+
}) })
|
|
900
|
+
] }) }),
|
|
901
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
902
|
+
StyledMenuItem,
|
|
903
|
+
{
|
|
904
|
+
disabled: !canDelete,
|
|
905
|
+
onSelect: toggleWarningSubmit,
|
|
906
|
+
$variant: "danger",
|
|
907
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
908
|
+
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
909
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
910
|
+
id: "content-releases.header.actions.delete",
|
|
911
|
+
defaultMessage: "Delete"
|
|
856
912
|
}) })
|
|
857
|
-
] }) }),
|
|
858
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
859
|
-
StyledMenuItem,
|
|
860
|
-
{
|
|
861
|
-
disabled: !canDelete,
|
|
862
|
-
onSelect: toggleWarningSubmit,
|
|
863
|
-
$variant: "danger",
|
|
864
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
|
|
865
|
-
/* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
|
|
866
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
|
|
867
|
-
id: "content-releases.header.actions.delete",
|
|
868
|
-
defaultMessage: "Delete"
|
|
869
|
-
}) })
|
|
870
|
-
] })
|
|
871
|
-
}
|
|
872
|
-
)
|
|
873
|
-
]
|
|
874
|
-
}
|
|
875
|
-
),
|
|
876
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
877
|
-
ReleaseInfoWrapper,
|
|
878
|
-
{
|
|
879
|
-
direction: "column",
|
|
880
|
-
justifyContent: "center",
|
|
881
|
-
alignItems: "flex-start",
|
|
882
|
-
gap: 1,
|
|
883
|
-
padding: 5,
|
|
884
|
-
children: [
|
|
885
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
886
|
-
id: "content-releases.header.actions.created",
|
|
887
|
-
defaultMessage: "Created"
|
|
888
|
-
}) }),
|
|
889
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
890
|
-
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
891
|
-
formatMessage(
|
|
892
|
-
{
|
|
893
|
-
id: "content-releases.header.actions.created.description",
|
|
894
|
-
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
895
|
-
},
|
|
896
|
-
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
897
|
-
)
|
|
898
913
|
] })
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
914
|
+
}
|
|
915
|
+
),
|
|
916
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
917
|
+
ReleaseInfoWrapper,
|
|
918
|
+
{
|
|
919
|
+
direction: "column",
|
|
920
|
+
justifyContent: "center",
|
|
921
|
+
alignItems: "flex-start",
|
|
922
|
+
gap: 1,
|
|
923
|
+
padding: 4,
|
|
924
|
+
children: [
|
|
925
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: formatMessage({
|
|
926
|
+
id: "content-releases.header.actions.created",
|
|
927
|
+
defaultMessage: "Created"
|
|
928
|
+
}) }),
|
|
929
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Typography, { variant: "pi", color: "neutral300", children: [
|
|
930
|
+
/* @__PURE__ */ jsxRuntime.jsx(RelativeTime$1, { timestamp: new Date(release.createdAt) }),
|
|
931
|
+
formatMessage(
|
|
932
|
+
{
|
|
933
|
+
id: "content-releases.header.actions.created.description",
|
|
934
|
+
defaultMessage: "{hasCreatedByUser, select, true { by {createdBy}} other { by deleted user}}"
|
|
935
|
+
},
|
|
936
|
+
{ createdBy: getCreatedByUser(), hasCreatedByUser }
|
|
937
|
+
)
|
|
938
|
+
] })
|
|
939
|
+
]
|
|
940
|
+
}
|
|
941
|
+
)
|
|
942
|
+
]
|
|
943
|
+
}
|
|
944
|
+
),
|
|
904
945
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { size: "S", variant: "tertiary", onClick: handleRefresh, children: formatMessage({
|
|
905
946
|
id: "content-releases.header.actions.refresh",
|
|
906
947
|
defaultMessage: "Refresh"
|
|
@@ -925,6 +966,11 @@ const ReleaseDetailsLayout = ({
|
|
|
925
966
|
children
|
|
926
967
|
] });
|
|
927
968
|
};
|
|
969
|
+
const SimpleMenuButton = styledComponents.styled(designSystem.SimpleMenu)`
|
|
970
|
+
& > span {
|
|
971
|
+
display: flex;
|
|
972
|
+
}
|
|
973
|
+
`;
|
|
928
974
|
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
929
975
|
const GROUP_BY_OPTIONS_NO_LOCALE = ["contentType", "action"];
|
|
930
976
|
const getGroupByOptionLabel = (value) => {
|
|
@@ -959,19 +1005,18 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
959
1005
|
allowedActions: { canUpdate }
|
|
960
1006
|
} = strapiAdmin.useRBAC(index.PERMISSIONS);
|
|
961
1007
|
const runHookWaterfall = strapiAdmin.useStrapiApp("ReleaseDetailsPage", (state) => state.runHookWaterfall);
|
|
962
|
-
const { hasI18nEnabled } = runHookWaterfall(
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
);
|
|
1008
|
+
const { displayedHeaders, hasI18nEnabled } = runHookWaterfall("ContentReleases/pages/ReleaseDetails/add-locale-in-releases", {
|
|
1009
|
+
displayedHeaders: [
|
|
1010
|
+
{
|
|
1011
|
+
label: {
|
|
1012
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1013
|
+
defaultMessage: "name"
|
|
1014
|
+
},
|
|
1015
|
+
name: "name"
|
|
1016
|
+
}
|
|
1017
|
+
],
|
|
1018
|
+
hasI18nEnabled: false
|
|
1019
|
+
});
|
|
975
1020
|
const release = releaseData?.data;
|
|
976
1021
|
const selectedGroupBy = query?.groupBy || "contentType";
|
|
977
1022
|
const {
|
|
@@ -1077,34 +1122,27 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1077
1122
|
defaultMessage: "Group by"
|
|
1078
1123
|
});
|
|
1079
1124
|
const headers = [
|
|
1080
|
-
|
|
1125
|
+
...displayedHeaders,
|
|
1081
1126
|
{
|
|
1082
|
-
label:
|
|
1083
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
1084
|
-
defaultMessage: "name"
|
|
1085
|
-
}),
|
|
1086
|
-
name: "name"
|
|
1087
|
-
},
|
|
1088
|
-
{
|
|
1089
|
-
label: formatMessage({
|
|
1127
|
+
label: {
|
|
1090
1128
|
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
1091
1129
|
defaultMessage: "content-type"
|
|
1092
|
-
}
|
|
1130
|
+
},
|
|
1093
1131
|
name: "content-type"
|
|
1094
1132
|
},
|
|
1095
1133
|
{
|
|
1096
|
-
label:
|
|
1134
|
+
label: {
|
|
1097
1135
|
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
1098
1136
|
defaultMessage: "action"
|
|
1099
|
-
}
|
|
1137
|
+
},
|
|
1100
1138
|
name: "action"
|
|
1101
1139
|
},
|
|
1102
1140
|
...!release.releasedAt ? [
|
|
1103
1141
|
{
|
|
1104
|
-
label:
|
|
1142
|
+
label: {
|
|
1105
1143
|
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
1106
1144
|
defaultMessage: "status"
|
|
1107
|
-
}
|
|
1145
|
+
},
|
|
1108
1146
|
name: "status"
|
|
1109
1147
|
}
|
|
1110
1148
|
] : []
|
|
@@ -1142,10 +1180,10 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1142
1180
|
headers,
|
|
1143
1181
|
isLoading: isLoading || isFetching,
|
|
1144
1182
|
children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
|
|
1145
|
-
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Head, { children: headers.map((
|
|
1183
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Head, { children: headers.map(({ label, name }) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { label: formatMessage(label), name }, name)) }),
|
|
1146
1184
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Loading, {}),
|
|
1147
1185
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: releaseActions[key].map(
|
|
1148
|
-
({ id, contentType, locale, type, entry }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1186
|
+
({ id, contentType, locale, type, entry, status }, actionIndex) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
1149
1187
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
1150
1188
|
hasI18nEnabled && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
1151
1189
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
@@ -1174,7 +1212,8 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1174
1212
|
action: type,
|
|
1175
1213
|
schema: contentTypes?.[contentType.uid],
|
|
1176
1214
|
components,
|
|
1177
|
-
entry
|
|
1215
|
+
entry,
|
|
1216
|
+
status
|
|
1178
1217
|
}
|
|
1179
1218
|
) }),
|
|
1180
1219
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(index.ReleaseActionMenu.Root, { children: [
|
|
@@ -1182,7 +1221,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
|
|
|
1182
1221
|
index.ReleaseActionMenu.ReleaseActionEntryLinkItem,
|
|
1183
1222
|
{
|
|
1184
1223
|
contentTypeUid: contentType.uid,
|
|
1185
|
-
|
|
1224
|
+
documentId: entry.documentId,
|
|
1186
1225
|
locale: locale?.code
|
|
1187
1226
|
}
|
|
1188
1227
|
),
|
|
@@ -1232,13 +1271,24 @@ const ReleaseDetailsPage = () => {
|
|
|
1232
1271
|
skip: !releaseId
|
|
1233
1272
|
}
|
|
1234
1273
|
);
|
|
1274
|
+
const { data: dataTimezone, isLoading: isLoadingTimezone } = index.useGetReleaseSettingsQuery();
|
|
1235
1275
|
const [updateRelease, { isLoading: isSubmittingForm }] = index.useUpdateReleaseMutation();
|
|
1236
1276
|
const [deleteRelease] = index.useDeleteReleaseMutation();
|
|
1237
1277
|
const toggleEditReleaseModal = () => {
|
|
1238
1278
|
setReleaseModalShown((prev) => !prev);
|
|
1239
1279
|
};
|
|
1280
|
+
const getTimezoneValue = () => {
|
|
1281
|
+
if (releaseData?.timezone) {
|
|
1282
|
+
return releaseData.timezone;
|
|
1283
|
+
} else {
|
|
1284
|
+
if (dataTimezone?.data.defaultTimezone) {
|
|
1285
|
+
return dataTimezone.data.defaultTimezone;
|
|
1286
|
+
}
|
|
1287
|
+
return null;
|
|
1288
|
+
}
|
|
1289
|
+
};
|
|
1240
1290
|
const toggleWarningSubmit = () => setWarningSubmit((prevState) => !prevState);
|
|
1241
|
-
if (isLoadingDetails) {
|
|
1291
|
+
if (isLoadingDetails || isLoadingTimezone) {
|
|
1242
1292
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1243
1293
|
ReleaseDetailsLayout,
|
|
1244
1294
|
{
|
|
@@ -1253,7 +1303,7 @@ const ReleaseDetailsPage = () => {
|
|
|
1253
1303
|
}
|
|
1254
1304
|
const releaseData = isSuccessDetails && data?.data || null;
|
|
1255
1305
|
const title = releaseData?.name || "";
|
|
1256
|
-
const timezone =
|
|
1306
|
+
const timezone = getTimezoneValue();
|
|
1257
1307
|
const scheduledAt = releaseData?.scheduledAt && timezone ? dateFnsTz.utcToZonedTime(releaseData.scheduledAt, timezone) : null;
|
|
1258
1308
|
const date = scheduledAt ? format__default.default(scheduledAt, "yyyy-MM-dd") : void 0;
|
|
1259
1309
|
const time = scheduledAt ? format__default.default(scheduledAt, "HH:mm") : "";
|
|
@@ -1342,4 +1392,4 @@ const App = () => {
|
|
|
1342
1392
|
] }) });
|
|
1343
1393
|
};
|
|
1344
1394
|
exports.App = App;
|
|
1345
|
-
//# sourceMappingURL=App-
|
|
1395
|
+
//# sourceMappingURL=App-BKB1esYS.js.map
|