@strapi/content-releases 0.0.0-experimental.f7b9b47085e387e97f990d8695971b51d7f7149a → 0.0.0-experimental.fb8e9fec2e10d6b55e3aee59c4eb76bb7a11432a
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-a4843fda.mjs → App-L1jSxCiL.mjs} +277 -117
- package/dist/_chunks/App-L1jSxCiL.mjs.map +1 -0
- package/dist/_chunks/{App-f2cafd81.js → App-_20W9dYa.js} +274 -114
- package/dist/_chunks/App-_20W9dYa.js.map +1 -0
- package/dist/_chunks/{en-e98d8b57.mjs → en-MyLPoISH.mjs} +14 -4
- package/dist/_chunks/en-MyLPoISH.mjs.map +1 -0
- package/dist/_chunks/{en-13576ce2.js → en-gYDqKYFd.js} +14 -4
- package/dist/_chunks/en-gYDqKYFd.js.map +1 -0
- package/dist/_chunks/{index-66d129ac.js → index-KJa1Rb5F.js} +107 -37
- package/dist/_chunks/index-KJa1Rb5F.js.map +1 -0
- package/dist/_chunks/{index-937f8179.mjs → index-c4zRX_sg.mjs} +117 -47
- package/dist/_chunks/index-c4zRX_sg.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +3 -2
- package/dist/admin/index.mjs.map +1 -1
- package/dist/server/index.js +359 -102
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +357 -103
- package/dist/server/index.mjs.map +1 -1
- package/package.json +11 -9
- package/dist/_chunks/App-a4843fda.mjs.map +0 -1
- package/dist/_chunks/App-f2cafd81.js.map +0 -1
- package/dist/_chunks/en-13576ce2.js.map +0 -1
- package/dist/_chunks/en-e98d8b57.mjs.map +0 -1
- package/dist/_chunks/index-66d129ac.js.map +0 -1
- package/dist/_chunks/index-937f8179.mjs.map +0 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
const helperPlugin = require("@strapi/helper-plugin");
|
|
4
5
|
const reactRouterDom = require("react-router-dom");
|
|
5
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-KJa1Rb5F.js");
|
|
6
7
|
const React = require("react");
|
|
8
|
+
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
7
9
|
const designSystem = require("@strapi/design-system");
|
|
8
10
|
const v2 = require("@strapi/design-system/v2");
|
|
9
|
-
const helperPlugin = require("@strapi/helper-plugin");
|
|
10
11
|
const icons = require("@strapi/icons");
|
|
11
12
|
const reactIntl = require("react-intl");
|
|
12
13
|
const styled = require("styled-components");
|
|
@@ -15,6 +16,7 @@ const yup = require("yup");
|
|
|
15
16
|
require("@reduxjs/toolkit/query");
|
|
16
17
|
require("axios");
|
|
17
18
|
require("@reduxjs/toolkit/query/react");
|
|
19
|
+
require("react-redux");
|
|
18
20
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
|
19
21
|
function _interopNamespace(e) {
|
|
20
22
|
if (e && e.__esModule)
|
|
@@ -47,11 +49,16 @@ const ReleaseModal = ({
|
|
|
47
49
|
isLoading = false
|
|
48
50
|
}) => {
|
|
49
51
|
const { formatMessage } = reactIntl.useIntl();
|
|
52
|
+
const { pathname } = reactRouterDom.useLocation();
|
|
53
|
+
const isCreatingRelease = pathname === `/plugins/${index.pluginId}`;
|
|
50
54
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy: "title", children: [
|
|
51
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "title", fontWeight: "bold", textColor: "neutral800", children: formatMessage(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "title", fontWeight: "bold", textColor: "neutral800", children: formatMessage(
|
|
56
|
+
{
|
|
57
|
+
id: "content-releases.modal.title",
|
|
58
|
+
defaultMessage: "{isCreatingRelease, select, true {New release} other {Edit release}}"
|
|
59
|
+
},
|
|
60
|
+
{ isCreatingRelease }
|
|
61
|
+
) }) }),
|
|
55
62
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
56
63
|
formik.Formik,
|
|
57
64
|
{
|
|
@@ -78,10 +85,22 @@ const ReleaseModal = ({
|
|
|
78
85
|
designSystem.ModalFooter,
|
|
79
86
|
{
|
|
80
87
|
startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", name: "cancel", children: formatMessage({ id: "cancel", defaultMessage: "Cancel" }) }),
|
|
81
|
-
endActions: /* @__PURE__ */ jsxRuntime.jsx(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
88
|
+
endActions: /* @__PURE__ */ jsxRuntime.jsx(
|
|
89
|
+
designSystem.Button,
|
|
90
|
+
{
|
|
91
|
+
name: "submit",
|
|
92
|
+
loading: isLoading,
|
|
93
|
+
disabled: !values.name || values.name === initialValues.name,
|
|
94
|
+
type: "submit",
|
|
95
|
+
children: formatMessage(
|
|
96
|
+
{
|
|
97
|
+
id: "content-releases.modal.form.button.submit",
|
|
98
|
+
defaultMessage: "{isCreatingRelease, select, true {Continue} other {Save}}"
|
|
99
|
+
},
|
|
100
|
+
{ isCreatingRelease }
|
|
101
|
+
)
|
|
102
|
+
}
|
|
103
|
+
)
|
|
85
104
|
}
|
|
86
105
|
)
|
|
87
106
|
] })
|
|
@@ -120,6 +139,9 @@ const TrashIcon = styled__default.default(icons.Trash)`
|
|
|
120
139
|
fill: ${({ theme }) => theme.colors.danger600};
|
|
121
140
|
}
|
|
122
141
|
`;
|
|
142
|
+
const TypographyMaxWidth = styled__default.default(designSystem.Typography)`
|
|
143
|
+
max-width: 300px;
|
|
144
|
+
`;
|
|
123
145
|
const PopoverButton = ({ onClick, disabled, children }) => {
|
|
124
146
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
125
147
|
StyledFlex,
|
|
@@ -138,6 +160,49 @@ const PopoverButton = ({ onClick, disabled, children }) => {
|
|
|
138
160
|
}
|
|
139
161
|
);
|
|
140
162
|
};
|
|
163
|
+
const EntryValidationText = ({ action, schema, components, entry }) => {
|
|
164
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
165
|
+
const { validate } = strapiAdmin.unstable_useDocument();
|
|
166
|
+
const { errors } = validate(entry, {
|
|
167
|
+
contentType: schema,
|
|
168
|
+
components,
|
|
169
|
+
isCreatingEntry: false
|
|
170
|
+
});
|
|
171
|
+
if (Object.keys(errors).length > 0) {
|
|
172
|
+
const validationErrorsMessages = Object.entries(errors).map(
|
|
173
|
+
([key, value]) => formatMessage(
|
|
174
|
+
{ id: `${value.id}.withField`, defaultMessage: value.defaultMessage },
|
|
175
|
+
{ field: key }
|
|
176
|
+
)
|
|
177
|
+
).join(" ");
|
|
178
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
179
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { color: "danger600", as: icons.CrossCircle }),
|
|
180
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(TypographyMaxWidth, { textColor: "danger600", variant: "omega", fontWeight: "semiBold", ellipsis: true, children: validationErrorsMessages }) })
|
|
181
|
+
] });
|
|
182
|
+
}
|
|
183
|
+
if (action == "publish") {
|
|
184
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
185
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { color: "success600", as: icons.CheckCircle }),
|
|
186
|
+
entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
187
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-published",
|
|
188
|
+
defaultMessage: "Already published"
|
|
189
|
+
}) }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
190
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-publish",
|
|
191
|
+
defaultMessage: "Ready to publish"
|
|
192
|
+
}) })
|
|
193
|
+
] });
|
|
194
|
+
}
|
|
195
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
|
196
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { color: "success600", as: icons.CheckCircle }),
|
|
197
|
+
!entry.publishedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
|
198
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.already-unpublished",
|
|
199
|
+
defaultMessage: "Already unpublished"
|
|
200
|
+
}) }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
|
201
|
+
id: "content-releases.pages.ReleaseDetails.entry-validation.ready-to-unpublish",
|
|
202
|
+
defaultMessage: "Ready to unpublish"
|
|
203
|
+
}) })
|
|
204
|
+
] });
|
|
205
|
+
};
|
|
141
206
|
const ReleaseDetailsLayout = ({
|
|
142
207
|
toggleEditReleaseModal,
|
|
143
208
|
toggleWarningSubmit,
|
|
@@ -159,6 +224,7 @@ const ReleaseDetailsLayout = ({
|
|
|
159
224
|
const {
|
|
160
225
|
allowedActions: { canUpdate, canDelete }
|
|
161
226
|
} = helperPlugin.useRBAC(index.PERMISSIONS);
|
|
227
|
+
const dispatch = index.useTypedDispatch();
|
|
162
228
|
const release = data?.data;
|
|
163
229
|
const handleTogglePopover = () => {
|
|
164
230
|
setIsPopoverVisible((prev) => !prev);
|
|
@@ -193,6 +259,9 @@ const ReleaseDetailsLayout = ({
|
|
|
193
259
|
toggleWarningSubmit();
|
|
194
260
|
handleTogglePopover();
|
|
195
261
|
};
|
|
262
|
+
const handleRefresh = () => {
|
|
263
|
+
dispatch(index.releaseApi.util.invalidateTags([{ type: "ReleaseAction", id: "LIST" }]));
|
|
264
|
+
};
|
|
196
265
|
if (isLoadingDetails) {
|
|
197
266
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Main, { "aria-busy": isLoadingDetails, children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) });
|
|
198
267
|
}
|
|
@@ -214,7 +283,7 @@ const ReleaseDetailsLayout = ({
|
|
|
214
283
|
);
|
|
215
284
|
}
|
|
216
285
|
const totalEntries = release.actions.meta.count || 0;
|
|
217
|
-
const createdBy = `${release.createdBy.firstname} ${release.createdBy.lastname}`;
|
|
286
|
+
const createdBy = release.createdBy.lastname ? `${release.createdBy.firstname} ${release.createdBy.lastname}` : `${release.createdBy.firstname}`;
|
|
218
287
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
|
|
219
288
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
220
289
|
designSystem.HeaderLayout,
|
|
@@ -298,6 +367,10 @@ const ReleaseDetailsLayout = ({
|
|
|
298
367
|
]
|
|
299
368
|
}
|
|
300
369
|
),
|
|
370
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { size: "S", variant: "tertiary", onClick: handleRefresh, children: formatMessage({
|
|
371
|
+
id: "content-releases.header.actions.refresh",
|
|
372
|
+
defaultMessage: "Refresh"
|
|
373
|
+
}) }),
|
|
301
374
|
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: index.PERMISSIONS.publish, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
302
375
|
designSystem.Button,
|
|
303
376
|
{
|
|
@@ -318,10 +391,29 @@ const ReleaseDetailsLayout = ({
|
|
|
318
391
|
children
|
|
319
392
|
] });
|
|
320
393
|
};
|
|
394
|
+
const GROUP_BY_OPTIONS = ["contentType", "locale", "action"];
|
|
395
|
+
const getGroupByOptionLabel = (value) => {
|
|
396
|
+
if (value === "locale") {
|
|
397
|
+
return {
|
|
398
|
+
id: "content-releases.pages.ReleaseDetails.groupBy.option.locales",
|
|
399
|
+
defaultMessage: "Locales"
|
|
400
|
+
};
|
|
401
|
+
}
|
|
402
|
+
if (value === "action") {
|
|
403
|
+
return {
|
|
404
|
+
id: "content-releases.pages.ReleaseDetails.groupBy.option.actions",
|
|
405
|
+
defaultMessage: "Actions"
|
|
406
|
+
};
|
|
407
|
+
}
|
|
408
|
+
return {
|
|
409
|
+
id: "content-releases.pages.ReleaseDetails.groupBy.option.content-type",
|
|
410
|
+
defaultMessage: "Content-Types"
|
|
411
|
+
};
|
|
412
|
+
};
|
|
321
413
|
const ReleaseDetailsBody = () => {
|
|
322
414
|
const { formatMessage } = reactIntl.useIntl();
|
|
323
415
|
const { releaseId } = reactRouterDom.useParams();
|
|
324
|
-
const [{ query }] = helperPlugin.useQueryParams();
|
|
416
|
+
const [{ query }, setQuery] = helperPlugin.useQueryParams();
|
|
325
417
|
const toggleNotification = helperPlugin.useNotification();
|
|
326
418
|
const { formatAPIError } = helperPlugin.useAPIErrorHandler();
|
|
327
419
|
const {
|
|
@@ -331,6 +423,7 @@ const ReleaseDetailsBody = () => {
|
|
|
331
423
|
error: releaseError
|
|
332
424
|
} = index.useGetReleaseQuery({ id: releaseId });
|
|
333
425
|
const release = releaseData?.data;
|
|
426
|
+
const selectedGroupBy = query?.groupBy || "contentType";
|
|
334
427
|
const {
|
|
335
428
|
isLoading,
|
|
336
429
|
isFetching,
|
|
@@ -369,7 +462,11 @@ const ReleaseDetailsBody = () => {
|
|
|
369
462
|
if (isLoading || isReleaseLoading) {
|
|
370
463
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.LoadingIndicatorPage, {}) });
|
|
371
464
|
}
|
|
372
|
-
|
|
465
|
+
const releaseActions = data?.data;
|
|
466
|
+
const releaseMeta = data?.meta;
|
|
467
|
+
const contentTypes = releaseMeta?.contentTypes || {};
|
|
468
|
+
const components = releaseMeta?.components || {};
|
|
469
|
+
if (isReleaseError || !release) {
|
|
373
470
|
const errorsArray = [];
|
|
374
471
|
if (releaseError) {
|
|
375
472
|
errorsArray.push({
|
|
@@ -393,9 +490,10 @@ const ReleaseDetailsBody = () => {
|
|
|
393
490
|
}
|
|
394
491
|
);
|
|
395
492
|
}
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
493
|
+
if (isError || !releaseActions) {
|
|
494
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.AnErrorOccurred, {}) });
|
|
495
|
+
}
|
|
496
|
+
if (Object.keys(releaseActions).length === 0) {
|
|
399
497
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
400
498
|
helperPlugin.NoContent,
|
|
401
499
|
{
|
|
@@ -421,90 +519,153 @@ const ReleaseDetailsBody = () => {
|
|
|
421
519
|
}
|
|
422
520
|
) });
|
|
423
521
|
}
|
|
424
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap:
|
|
425
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
426
|
-
|
|
522
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
|
|
523
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
524
|
+
designSystem.SingleSelect,
|
|
427
525
|
{
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
})
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
}),
|
|
445
|
-
name: "name"
|
|
446
|
-
}
|
|
447
|
-
),
|
|
448
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
449
|
-
helperPlugin.Table.HeaderCell,
|
|
450
|
-
{
|
|
451
|
-
fieldSchemaType: "string",
|
|
452
|
-
label: formatMessage({
|
|
453
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
454
|
-
defaultMessage: "locale"
|
|
455
|
-
}),
|
|
456
|
-
name: "locale"
|
|
457
|
-
}
|
|
458
|
-
),
|
|
459
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
460
|
-
helperPlugin.Table.HeaderCell,
|
|
461
|
-
{
|
|
462
|
-
fieldSchemaType: "string",
|
|
463
|
-
label: formatMessage({
|
|
464
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
465
|
-
defaultMessage: "content-type"
|
|
466
|
-
}),
|
|
467
|
-
name: "content-type"
|
|
468
|
-
}
|
|
469
|
-
),
|
|
470
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
471
|
-
helperPlugin.Table.HeaderCell,
|
|
472
|
-
{
|
|
473
|
-
fieldSchemaType: "string",
|
|
474
|
-
label: formatMessage({
|
|
475
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
476
|
-
defaultMessage: "action"
|
|
477
|
-
}),
|
|
478
|
-
name: "action"
|
|
479
|
-
}
|
|
480
|
-
)
|
|
481
|
-
] }),
|
|
482
|
-
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.LoadingBody, {}),
|
|
483
|
-
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.Body, { children: releaseActions.map(({ id, type, entry }) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
484
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${entry.contentType.mainFieldValue || entry.id}` }) }),
|
|
485
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${entry?.locale?.name ? entry.locale.name : "-"}` }) }),
|
|
486
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: entry.contentType.displayName || "" }) }),
|
|
487
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
488
|
-
{
|
|
489
|
-
id: "content-releases.page.ReleaseDetails.table.action-published",
|
|
490
|
-
defaultMessage: "This entry was <b>{isPublish, select, true {published} other {unpublished}}</b>."
|
|
491
|
-
},
|
|
492
|
-
{
|
|
493
|
-
isPublish: type === "publish",
|
|
494
|
-
b: (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children })
|
|
495
|
-
}
|
|
496
|
-
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
497
|
-
index.ReleaseActionOptions,
|
|
498
|
-
{
|
|
499
|
-
selected: type,
|
|
500
|
-
handleChange: (e) => handleChangeType(e, id),
|
|
501
|
-
name: `release-action-${id}-type`
|
|
502
|
-
}
|
|
503
|
-
) })
|
|
504
|
-
] }, id)) })
|
|
505
|
-
] })
|
|
526
|
+
"aria-label": formatMessage({
|
|
527
|
+
id: "content-releases.pages.ReleaseDetails.groupBy.label",
|
|
528
|
+
defaultMessage: "Group by"
|
|
529
|
+
}),
|
|
530
|
+
customizeContent: (value) => formatMessage(
|
|
531
|
+
{
|
|
532
|
+
id: `content-releases.pages.ReleaseDetails.groupBy.label`,
|
|
533
|
+
defaultMessage: `Group by {groupBy}`
|
|
534
|
+
},
|
|
535
|
+
{
|
|
536
|
+
groupBy: value
|
|
537
|
+
}
|
|
538
|
+
),
|
|
539
|
+
value: formatMessage(getGroupByOptionLabel(selectedGroupBy)),
|
|
540
|
+
onChange: (value) => setQuery({ groupBy: value }),
|
|
541
|
+
children: GROUP_BY_OPTIONS.map((option) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: option, children: formatMessage(getGroupByOptionLabel(option)) }, option))
|
|
506
542
|
}
|
|
507
|
-
),
|
|
543
|
+
) }),
|
|
544
|
+
Object.keys(releaseActions).map((key) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
|
545
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: key }) }),
|
|
546
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
547
|
+
helperPlugin.Table.Root,
|
|
548
|
+
{
|
|
549
|
+
rows: releaseActions[key].map((item) => ({
|
|
550
|
+
...item,
|
|
551
|
+
id: Number(item.entry.id)
|
|
552
|
+
})),
|
|
553
|
+
colCount: releaseActions[key].length,
|
|
554
|
+
isLoading,
|
|
555
|
+
isFetching,
|
|
556
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Content, { children: [
|
|
557
|
+
/* @__PURE__ */ jsxRuntime.jsxs(helperPlugin.Table.Head, { children: [
|
|
558
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
559
|
+
helperPlugin.Table.HeaderCell,
|
|
560
|
+
{
|
|
561
|
+
fieldSchemaType: "string",
|
|
562
|
+
label: formatMessage({
|
|
563
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.name",
|
|
564
|
+
defaultMessage: "name"
|
|
565
|
+
}),
|
|
566
|
+
name: "name"
|
|
567
|
+
}
|
|
568
|
+
),
|
|
569
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
570
|
+
helperPlugin.Table.HeaderCell,
|
|
571
|
+
{
|
|
572
|
+
fieldSchemaType: "string",
|
|
573
|
+
label: formatMessage({
|
|
574
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
|
575
|
+
defaultMessage: "locale"
|
|
576
|
+
}),
|
|
577
|
+
name: "locale"
|
|
578
|
+
}
|
|
579
|
+
),
|
|
580
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
581
|
+
helperPlugin.Table.HeaderCell,
|
|
582
|
+
{
|
|
583
|
+
fieldSchemaType: "string",
|
|
584
|
+
label: formatMessage({
|
|
585
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.content-type",
|
|
586
|
+
defaultMessage: "content-type"
|
|
587
|
+
}),
|
|
588
|
+
name: "content-type"
|
|
589
|
+
}
|
|
590
|
+
),
|
|
591
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
592
|
+
helperPlugin.Table.HeaderCell,
|
|
593
|
+
{
|
|
594
|
+
fieldSchemaType: "string",
|
|
595
|
+
label: formatMessage({
|
|
596
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.action",
|
|
597
|
+
defaultMessage: "action"
|
|
598
|
+
}),
|
|
599
|
+
name: "action"
|
|
600
|
+
}
|
|
601
|
+
),
|
|
602
|
+
!release.releasedAt && /* @__PURE__ */ jsxRuntime.jsx(
|
|
603
|
+
helperPlugin.Table.HeaderCell,
|
|
604
|
+
{
|
|
605
|
+
fieldSchemaType: "string",
|
|
606
|
+
label: formatMessage({
|
|
607
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.status",
|
|
608
|
+
defaultMessage: "status"
|
|
609
|
+
}),
|
|
610
|
+
name: "status"
|
|
611
|
+
}
|
|
612
|
+
)
|
|
613
|
+
] }),
|
|
614
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.LoadingBody, {}),
|
|
615
|
+
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.Table.Body, { children: releaseActions[key].map(({ id, contentType, locale, type, entry }) => /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tr, { children: [
|
|
616
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "25%", maxWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: `${contentType.mainFieldValue || entry.id}` }) }),
|
|
617
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: `${locale?.name ? locale.name : "-"}` }) }),
|
|
618
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "10%", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: contentType.displayName || "" }) }),
|
|
619
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", children: release.releasedAt ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
|
|
620
|
+
{
|
|
621
|
+
id: "content-releases.page.ReleaseDetails.table.action-published",
|
|
622
|
+
defaultMessage: "This entry was <b>{isPublish, select, true {published} other {unpublished}}</b>."
|
|
623
|
+
},
|
|
624
|
+
{
|
|
625
|
+
isPublish: type === "publish",
|
|
626
|
+
b: (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children })
|
|
627
|
+
}
|
|
628
|
+
) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
629
|
+
index.ReleaseActionOptions,
|
|
630
|
+
{
|
|
631
|
+
selected: type,
|
|
632
|
+
handleChange: (e) => handleChangeType(e, id),
|
|
633
|
+
name: `release-action-${id}-type`
|
|
634
|
+
}
|
|
635
|
+
) }),
|
|
636
|
+
!release.releasedAt && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
637
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { width: "20%", minWidth: "200px", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
638
|
+
EntryValidationText,
|
|
639
|
+
{
|
|
640
|
+
action: type,
|
|
641
|
+
schema: contentTypes?.[contentType.uid],
|
|
642
|
+
components,
|
|
643
|
+
entry
|
|
644
|
+
}
|
|
645
|
+
) }),
|
|
646
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Td, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(index.ReleaseActionMenu.Root, { children: [
|
|
647
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
648
|
+
index.ReleaseActionMenu.ReleaseActionEntryLinkItem,
|
|
649
|
+
{
|
|
650
|
+
contentTypeUid: contentType.uid,
|
|
651
|
+
entryId: entry.id,
|
|
652
|
+
locale: locale?.code
|
|
653
|
+
}
|
|
654
|
+
),
|
|
655
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
656
|
+
index.ReleaseActionMenu.DeleteReleaseActionItem,
|
|
657
|
+
{
|
|
658
|
+
releaseId: release.id,
|
|
659
|
+
actionId: id
|
|
660
|
+
}
|
|
661
|
+
)
|
|
662
|
+
] }) }) })
|
|
663
|
+
] })
|
|
664
|
+
] }, id)) })
|
|
665
|
+
] })
|
|
666
|
+
}
|
|
667
|
+
)
|
|
668
|
+
] }, `releases-group-${key}`)),
|
|
508
669
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { paddingTop: 4, alignItems: "flex-end", justifyContent: "space-between", children: [
|
|
509
670
|
/* @__PURE__ */ jsxRuntime.jsx(helperPlugin.PageSizeURLQuery, { defaultValue: releaseMeta?.pagination?.pageSize.toString() }),
|
|
510
671
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -625,7 +786,6 @@ const ReleaseDetailsPage = () => {
|
|
|
625
786
|
}
|
|
626
787
|
);
|
|
627
788
|
};
|
|
628
|
-
const ProtectedReleaseDetailsPage = () => /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsx(ReleaseDetailsPage, {}) });
|
|
629
789
|
const ReleasesLayout = ({
|
|
630
790
|
isLoading,
|
|
631
791
|
totalReleases,
|
|
@@ -712,6 +872,7 @@ const INITIAL_FORM_VALUES = {
|
|
|
712
872
|
name: ""
|
|
713
873
|
};
|
|
714
874
|
const ReleasesPage = () => {
|
|
875
|
+
const tabRef = React__namespace.useRef(null);
|
|
715
876
|
const location = reactRouterDom.useLocation();
|
|
716
877
|
const [releaseModalShown, setReleaseModalShown] = React__namespace.useState(false);
|
|
717
878
|
const toggleNotification = helperPlugin.useNotification();
|
|
@@ -722,6 +883,8 @@ const ReleasesPage = () => {
|
|
|
722
883
|
const response = index.useGetReleasesQuery(query);
|
|
723
884
|
const [createRelease, { isLoading: isSubmittingForm }] = index.useCreateReleaseMutation();
|
|
724
885
|
const { isLoading, isSuccess, isError } = response;
|
|
886
|
+
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
887
|
+
const activeTabIndex = ["pending", "done"].indexOf(activeTab);
|
|
725
888
|
React__namespace.useEffect(() => {
|
|
726
889
|
if (location?.state?.errors) {
|
|
727
890
|
toggleNotification({
|
|
@@ -738,6 +901,11 @@ const ReleasesPage = () => {
|
|
|
738
901
|
replace({ state: null });
|
|
739
902
|
}
|
|
740
903
|
}, [formatMessage, location?.state?.errors, replace, toggleNotification]);
|
|
904
|
+
React__namespace.useEffect(() => {
|
|
905
|
+
if (tabRef.current) {
|
|
906
|
+
tabRef.current._handlers.setSelectedTabIndex(activeTabIndex);
|
|
907
|
+
}
|
|
908
|
+
}, [activeTabIndex]);
|
|
741
909
|
const toggleAddReleaseModal = () => {
|
|
742
910
|
setReleaseModalShown((prev) => !prev);
|
|
743
911
|
};
|
|
@@ -757,7 +925,6 @@ const ReleasesPage = () => {
|
|
|
757
925
|
}
|
|
758
926
|
});
|
|
759
927
|
};
|
|
760
|
-
const activeTab = response?.currentData?.meta?.activeTab || "pending";
|
|
761
928
|
const handleAddRelease = async (values) => {
|
|
762
929
|
const response2 = await createRelease({
|
|
763
930
|
name: values.name
|
|
@@ -793,8 +960,9 @@ const ReleasesPage = () => {
|
|
|
793
960
|
defaultMessage: "Releases list"
|
|
794
961
|
}),
|
|
795
962
|
variant: "simple",
|
|
796
|
-
initialSelectedTabIndex:
|
|
963
|
+
initialSelectedTabIndex: activeTabIndex,
|
|
797
964
|
onTabChange: handleTabChange,
|
|
965
|
+
ref: tabRef,
|
|
798
966
|
children: [
|
|
799
967
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingBottom: 8, children: [
|
|
800
968
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Tabs, { children: [
|
|
@@ -859,19 +1027,11 @@ const ReleasesPage = () => {
|
|
|
859
1027
|
)
|
|
860
1028
|
] });
|
|
861
1029
|
};
|
|
862
|
-
const ProtectedReleasesPage = () => /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsx(ReleasesPage, {}) });
|
|
863
1030
|
const App = () => {
|
|
864
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Switch, { children: [
|
|
865
|
-
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { exact: true, path: `/plugins/${index.pluginId}`, component:
|
|
866
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
867
|
-
|
|
868
|
-
{
|
|
869
|
-
exact: true,
|
|
870
|
-
path: `/plugins/${index.pluginId}/:releaseId`,
|
|
871
|
-
component: ProtectedReleaseDetailsPage
|
|
872
|
-
}
|
|
873
|
-
)
|
|
874
|
-
] });
|
|
1031
|
+
return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPagePermissions, { permissions: index.PERMISSIONS.main, children: /* @__PURE__ */ jsxRuntime.jsxs(reactRouterDom.Switch, { children: [
|
|
1032
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { exact: true, path: `/plugins/${index.pluginId}`, component: ReleasesPage }),
|
|
1033
|
+
/* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Route, { exact: true, path: `/plugins/${index.pluginId}/:releaseId`, component: ReleaseDetailsPage })
|
|
1034
|
+
] }) });
|
|
875
1035
|
};
|
|
876
1036
|
exports.App = App;
|
|
877
|
-
//# sourceMappingURL=App-
|
|
1037
|
+
//# sourceMappingURL=App-_20W9dYa.js.map
|