@strapi/content-manager 5.0.0-beta.8 → 5.0.0-rc.0
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 +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-by0e_kNd.js → ComponentConfigurationPage-DVY3LwHo.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-by0e_kNd.js.map → ComponentConfigurationPage-DVY3LwHo.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-CuWgXugY.mjs → ComponentConfigurationPage-Dy9BQQ2V.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CuWgXugY.mjs.map → ComponentConfigurationPage-Dy9BQQ2V.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DbI4KMyz.mjs → EditConfigurationPage-DbR8mWH5.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DbI4KMyz.mjs.map → EditConfigurationPage-DbR8mWH5.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CqBeCPGH.js → EditConfigurationPage-b6V7YHfo.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CqBeCPGH.js.map → EditConfigurationPage-b6V7YHfo.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-dFPBya9U.mjs → EditViewPage-CPrukwtO.mjs} +46 -46
- package/dist/_chunks/EditViewPage-CPrukwtO.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-ChgloMyO.js → EditViewPage-DhttErmY.js} +45 -45
- package/dist/_chunks/EditViewPage-DhttErmY.js.map +1 -0
- package/dist/_chunks/{Field-dLk-vgLL.js → Field-CBRV4uan.js} +416 -136
- package/dist/_chunks/Field-CBRV4uan.js.map +1 -0
- package/dist/_chunks/{Field-C1nUKcdS.mjs → Field-DrgIgQPw.mjs} +417 -137
- package/dist/_chunks/Field-DrgIgQPw.mjs.map +1 -0
- package/dist/_chunks/{Form-CbXtmHC_.js → Form-Bk3v7Frl.js} +25 -26
- package/dist/_chunks/Form-Bk3v7Frl.js.map +1 -0
- package/dist/_chunks/{Form-DOlpi7Js.mjs → Form-Dxk4txLJ.mjs} +27 -28
- package/dist/_chunks/Form-Dxk4txLJ.mjs.map +1 -0
- package/dist/_chunks/{History-BFNUAiGc.mjs → History-DSU-y4Hg.mjs} +126 -31
- package/dist/_chunks/History-DSU-y4Hg.mjs.map +1 -0
- package/dist/_chunks/{History-BjDfohBr.js → History-xNH_9UuV.js} +125 -30
- package/dist/_chunks/History-xNH_9UuV.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-IQBgWTaa.js → ListConfigurationPage-BCPzXk5W.js} +48 -47
- package/dist/_chunks/ListConfigurationPage-BCPzXk5W.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DDi0KqFm.mjs → ListConfigurationPage-BWwZ-uMJ.mjs} +49 -49
- package/dist/_chunks/ListConfigurationPage-BWwZ-uMJ.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BPjljUsH.mjs → ListViewPage-D9UmehuA.mjs} +74 -70
- package/dist/_chunks/ListViewPage-D9UmehuA.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-CZYGqlvF.js → ListViewPage-ZIvstfvl.js} +72 -68
- package/dist/_chunks/ListViewPage-ZIvstfvl.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DaWw67K-.mjs → NoContentTypePage-CstnyWv2.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DaWw67K-.mjs.map → NoContentTypePage-CstnyWv2.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BOAI6VZ1.js → NoContentTypePage-h7FcuMjI.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BOAI6VZ1.js.map → NoContentTypePage-h7FcuMjI.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-cYEtLc_e.js → NoPermissionsPage-DofU68cO.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-cYEtLc_e.js.map → NoPermissionsPage-DofU68cO.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CZrJH00p.mjs → NoPermissionsPage-aFCCLbsf.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CZrJH00p.mjs.map → NoPermissionsPage-aFCCLbsf.mjs.map} +1 -1
- package/dist/_chunks/{Relations-DTowyge2.mjs → Relations-7v66IP7b.mjs} +4 -4
- package/dist/_chunks/Relations-7v66IP7b.mjs.map +1 -0
- package/dist/_chunks/{Relations-DU6B7irU.js → Relations-DAS_DKG5.js} +4 -4
- package/dist/_chunks/Relations-DAS_DKG5.js.map +1 -0
- package/dist/_chunks/{en-GCOTL6jR.mjs → en-BrCTWlZv.mjs} +9 -4
- package/dist/_chunks/{en-GCOTL6jR.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-DTULi5-d.js → en-uOUIxfcQ.js} +9 -4
- package/dist/_chunks/{en-DTULi5-d.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-CCJeB7Rw.js → index-CAlLHIrI.js} +1198 -784
- package/dist/_chunks/index-CAlLHIrI.js.map +1 -0
- package/dist/_chunks/{index-BaGHmIir.mjs → index-DIQ7Io-l.mjs} +1229 -815
- package/dist/_chunks/index-DIQ7Io-l.mjs.map +1 -0
- package/dist/_chunks/{layout-ni_L9kT1.js → layout-B1ZS-usI.js} +21 -16
- package/dist/_chunks/layout-B1ZS-usI.js.map +1 -0
- package/dist/_chunks/{layout-BinjszSQ.mjs → layout-DHe2GdT4.mjs} +22 -17
- package/dist/_chunks/layout-DHe2GdT4.mjs.map +1 -0
- package/dist/_chunks/{relations-c91ji5eR.mjs → relations-BUieBWhT.mjs} +2 -2
- package/dist/_chunks/{relations-c91ji5eR.mjs.map → relations-BUieBWhT.mjs.map} +1 -1
- package/dist/_chunks/{relations-CeJAJc5I.js → relations-yXHkSG1Z.js} +2 -2
- package/dist/_chunks/{relations-CeJAJc5I.js.map → relations-yXHkSG1Z.js.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +8 -8
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +14 -0
- package/dist/server/index.js +26 -17
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +26 -17
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/_chunks/EditViewPage-ChgloMyO.js.map +0 -1
- package/dist/_chunks/EditViewPage-dFPBya9U.mjs.map +0 -1
- package/dist/_chunks/Field-C1nUKcdS.mjs.map +0 -1
- package/dist/_chunks/Field-dLk-vgLL.js.map +0 -1
- package/dist/_chunks/Form-CbXtmHC_.js.map +0 -1
- package/dist/_chunks/Form-DOlpi7Js.mjs.map +0 -1
- package/dist/_chunks/History-BFNUAiGc.mjs.map +0 -1
- package/dist/_chunks/History-BjDfohBr.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DDi0KqFm.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-IQBgWTaa.js.map +0 -1
- package/dist/_chunks/ListViewPage-BPjljUsH.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-CZYGqlvF.js.map +0 -1
- package/dist/_chunks/Relations-DTowyge2.mjs.map +0 -1
- package/dist/_chunks/Relations-DU6B7irU.js.map +0 -1
- package/dist/_chunks/index-BaGHmIir.mjs.map +0 -1
- package/dist/_chunks/index-CCJeB7Rw.js.map +0 -1
- package/dist/_chunks/layout-BinjszSQ.mjs.map +0 -1
- package/dist/_chunks/layout-ni_L9kT1.js.map +0 -1
@@ -2,10 +2,30 @@ import * as React from 'react';
|
|
2
2
|
import { type InputProps } from '@strapi/admin/strapi-admin';
|
3
3
|
import { FlexComponent } from '@strapi/design-system';
|
4
4
|
import { type EditFieldLayout } from '../../../../hooks/useDocumentLayout';
|
5
|
+
import { RelationResult } from '../../../../services/relations';
|
6
|
+
type RelationPosition = (Pick<RelationResult, 'status' | 'locale'> & {
|
7
|
+
before: string;
|
8
|
+
end?: never;
|
9
|
+
}) | {
|
10
|
+
end: boolean;
|
11
|
+
before?: never;
|
12
|
+
status?: never;
|
13
|
+
locale?: never;
|
14
|
+
};
|
15
|
+
interface Relation extends Pick<RelationResult, 'documentId' | 'id' | 'locale' | 'status'> {
|
16
|
+
href: string;
|
17
|
+
label: string;
|
18
|
+
position?: RelationPosition;
|
19
|
+
__temp_key__: string;
|
20
|
+
}
|
5
21
|
interface RelationsFieldProps extends Omit<Extract<EditFieldLayout, {
|
6
22
|
type: 'relation';
|
7
23
|
}>, 'size' | 'hint'>, Pick<InputProps, 'hint'> {
|
8
24
|
}
|
25
|
+
export interface RelationsFormValue {
|
26
|
+
connect?: Relation[];
|
27
|
+
disconnect?: Pick<Relation, 'id'>[];
|
28
|
+
}
|
9
29
|
declare const FlexWrapper: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<Omit<import("@strapi/design-system").FlexProps<"div">, "ref"> & React.RefAttributes<unknown>, "ref"> & {
|
10
30
|
ref?: ((instance: unknown) => void) | React.RefObject<unknown> | null | undefined;
|
11
31
|
}, never>> & Omit<FlexComponent, keyof React.Component<any, {}, any>>;
|
@@ -41,11 +41,7 @@ export declare const CustomLinkIconButton: import("styled-components").IStyledCo
|
|
41
41
|
variant?: "secondary" | "tertiary" | undefined;
|
42
42
|
withTooltip?: boolean | undefined;
|
43
43
|
}, never>> & Omit<IconButtonComponent, keyof import("react").Component<any, {}, any>>, keyof import("react").Component<any, {}, any>>;
|
44
|
-
export declare const MainButtons: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components
|
45
|
-
ref?: import("react").RefObject<unknown> | ((instance: unknown) => void) | null | undefined;
|
46
|
-
}, never>, never>> & Omit<import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<Omit<import("@strapi/design-system").FlexProps<"div">, "ref"> & import("react").RefAttributes<unknown>, "ref"> & {
|
47
|
-
ref?: import("react").RefObject<unknown> | ((instance: unknown) => void) | null | undefined;
|
48
|
-
}, never>> & Omit<import("@strapi/design-system").FlexComponent, keyof import("react").Component<any, {}, any>>, keyof import("react").Component<any, {}, any>>;
|
44
|
+
export declare const MainButtons: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<any, never>> | (import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<any, never>> & Omit<any, keyof import("react").Component<any, {}, any>>);
|
49
45
|
export declare const MoreButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("@strapi/design-system").TransientBoxProps & {
|
50
46
|
children?: import("react").ReactNode;
|
51
47
|
} & import("@strapi/design-system/dist/types").AsProp<"button"> & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref">, "children" | keyof import("@strapi/design-system/dist/types").AsProp<C> | keyof import("@strapi/design-system").TransientBoxProps> & {
|
@@ -60,11 +56,7 @@ export declare const MoreButton: import("styled-components").IStyledComponent<"w
|
|
60
56
|
variant?: "secondary" | "tertiary" | undefined;
|
61
57
|
withTooltip?: boolean | undefined;
|
62
58
|
}, never>> & Omit<IconButtonComponent, keyof import("react").Component<any, {}, any>>;
|
63
|
-
export declare const IconButtonGroupMargin: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<import("styled-components
|
64
|
-
ref?: import("react").RefObject<unknown> | ((instance: unknown) => void) | null | undefined;
|
65
|
-
}, never>, never>> & Omit<import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<Omit<import("@strapi/design-system").FlexProps<"div">, "ref"> & import("react").RefAttributes<unknown>, "ref"> & {
|
66
|
-
ref?: import("react").RefObject<unknown> | ((instance: unknown) => void) | null | undefined;
|
67
|
-
}, never>> & Omit<import("@strapi/design-system").FlexComponent, keyof import("react").Component<any, {}, any>>, keyof import("react").Component<any, {}, any>>;
|
59
|
+
export declare const IconButtonGroupMargin: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<any, never>> | (import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<any, never>> & Omit<any, keyof import("react").Component<any, {}, any>>);
|
68
60
|
export declare const ExpandButton: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").FastOmit<Omit<Omit<import("@strapi/design-system").BaseButtonProps<import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements>>, "ref"> & import("react").RefAttributes<unknown>, "ref"> & {
|
69
61
|
ref?: ((instance: unknown) => void) | import("react").RefObject<unknown> | null | undefined;
|
70
62
|
}, never>> & Omit<(<C extends import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> = "button">(props: import("react").PropsWithoutRef<import("@strapi/design-system").BaseButtonProps<C>> & import("react").RefAttributes<unknown>) => import("react").ReactNode), keyof import("react").Component<any, {}, any>>;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
import {
|
2
|
+
import { ButtonProps } from '@strapi/design-system';
|
3
|
+
import { DialogOptions, ModalOptions, NotificationOptions } from '../../../EditView/components/DocumentActions';
|
3
4
|
import type { BulkActionComponent } from '../../../../content-manager';
|
4
5
|
interface BulkActionDescription {
|
5
6
|
dialog?: DialogOptions | NotificationOptions | ModalOptions;
|
@@ -14,35 +15,7 @@ interface BulkActionDescription {
|
|
14
15
|
/**
|
15
16
|
* @default 'secondary'
|
16
17
|
*/
|
17
|
-
variant?: '
|
18
|
-
}
|
19
|
-
interface DialogOptions {
|
20
|
-
type: 'dialog';
|
21
|
-
title: string;
|
22
|
-
content?: React.ReactNode;
|
23
|
-
onConfirm?: () => void | Promise<void>;
|
24
|
-
onCancel?: () => void | Promise<void>;
|
25
|
-
}
|
26
|
-
interface NotificationOptions {
|
27
|
-
type: 'notification';
|
28
|
-
title: string;
|
29
|
-
link?: {
|
30
|
-
label: string;
|
31
|
-
url: string;
|
32
|
-
target?: string;
|
33
|
-
};
|
34
|
-
content?: string;
|
35
|
-
onClose?: () => void;
|
36
|
-
status?: NotificationConfig['type'];
|
37
|
-
timeout?: number;
|
38
|
-
}
|
39
|
-
interface ModalOptions {
|
40
|
-
type: 'modal';
|
41
|
-
title: string;
|
42
|
-
content: React.ComponentType<{
|
43
|
-
onClose: () => void;
|
44
|
-
}>;
|
45
|
-
onClose?: () => void;
|
18
|
+
variant?: ButtonProps['variant'];
|
46
19
|
}
|
47
20
|
declare const BulkActionsRenderer: () => import("react/jsx-runtime").JSX.Element;
|
48
21
|
declare const Emphasis: (chunks: React.ReactNode) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import * as React from 'react';
|
2
|
-
|
3
|
-
|
2
|
+
interface ConfirmBulkActionDialogProps {
|
3
|
+
endAction: React.ReactNode;
|
4
4
|
onToggleDialog: () => void;
|
5
5
|
isOpen?: boolean;
|
6
6
|
dialogBody: React.ReactNode;
|
@@ -0,0 +1,14 @@
|
|
1
|
+
import { ConfirmDialogPublishAllProps } from './ConfirmBulkActionDialog';
|
2
|
+
import type { BulkActionComponent } from '../../../../content-manager';
|
3
|
+
import type { Document } from '../../../../hooks/useDocument';
|
4
|
+
interface TableRow extends Document {
|
5
|
+
}
|
6
|
+
interface SelectedEntriesModalContentProps {
|
7
|
+
listViewSelectedEntries: TableRow[];
|
8
|
+
toggleModal: ConfirmDialogPublishAllProps['onToggleDialog'];
|
9
|
+
setListViewSelectedDocuments: (documents: TableRow[]) => void;
|
10
|
+
model: string;
|
11
|
+
}
|
12
|
+
declare const SelectedEntriesModalContent: ({ listViewSelectedEntries, toggleModal, setListViewSelectedDocuments, model, }: SelectedEntriesModalContentProps) => import("react/jsx-runtime").JSX.Element;
|
13
|
+
declare const PublishAction: BulkActionComponent;
|
14
|
+
export { PublishAction, SelectedEntriesModalContent };
|
package/dist/server/index.js
CHANGED
@@ -232,6 +232,10 @@ const createServiceUtils = ({ strapi: strapi2 }) => {
|
|
232
232
|
return attributes.reduce((acc, [attributeName, attribute]) => {
|
233
233
|
switch (attribute.type) {
|
234
234
|
case "relation": {
|
235
|
+
const isMorphRelation = attribute.relation.toLowerCase().startsWith("morph");
|
236
|
+
if (isMorphRelation) {
|
237
|
+
break;
|
238
|
+
}
|
235
239
|
const isVisible2 = strapiUtils.contentTypes.isVisibleAttribute(model, attributeName);
|
236
240
|
if (isVisible2) {
|
237
241
|
acc[attributeName] = { fields: ["documentId", "locale", "publishedAt"] };
|
@@ -495,8 +499,6 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
|
|
495
499
|
deleteExpiredJob: null,
|
496
500
|
isInitialized: false
|
497
501
|
};
|
498
|
-
const query = strapi2.db.query(HISTORY_VERSION_UID);
|
499
|
-
const historyService = getService(strapi2, "history");
|
500
502
|
const serviceUtils = createServiceUtils({ strapi: strapi2 });
|
501
503
|
return {
|
502
504
|
async bootstrap() {
|
@@ -507,7 +509,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
|
|
507
509
|
if (!strapi2.requestContext.get()?.request.url.startsWith("/content-manager")) {
|
508
510
|
return next();
|
509
511
|
}
|
510
|
-
if (context.action !== "create" && context.action !== "update" && context.action !== "publish" && context.action !== "unpublish" && context.action !== "discardDraft") {
|
512
|
+
if (context.action !== "create" && context.action !== "update" && context.action !== "clone" && context.action !== "publish" && context.action !== "unpublish" && context.action !== "discardDraft") {
|
513
|
+
return next();
|
514
|
+
}
|
515
|
+
if (context.action === "update" && strapi2.requestContext.get()?.request.url.endsWith("/actions/publish")) {
|
511
516
|
return next();
|
512
517
|
}
|
513
518
|
const contentTypeUid = context.contentType.uid;
|
@@ -515,7 +520,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
|
|
515
520
|
return next();
|
516
521
|
}
|
517
522
|
const result = await next();
|
518
|
-
const documentContext =
|
523
|
+
const documentContext = {
|
524
|
+
documentId: context.action === "create" || context.action === "clone" ? result.documentId : context.params.documentId,
|
525
|
+
locale: context.params?.locale
|
526
|
+
};
|
519
527
|
const defaultLocale = await serviceUtils.getDefaultLocale();
|
520
528
|
const locale = documentContext.locale || defaultLocale;
|
521
529
|
if (Array.isArray(locale)) {
|
@@ -546,7 +554,7 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
|
|
546
554
|
}, {});
|
547
555
|
await strapi2.db.transaction(async ({ onCommit }) => {
|
548
556
|
onCommit(() => {
|
549
|
-
|
557
|
+
getService(strapi2, "history").createVersion({
|
550
558
|
contentType: contentTypeUid,
|
551
559
|
data: fp.omit(FIELDS_TO_IGNORE, document),
|
552
560
|
schema: fp.omit(FIELDS_TO_IGNORE, attributesSchema),
|
@@ -559,11 +567,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
|
|
559
567
|
});
|
560
568
|
return result;
|
561
569
|
});
|
562
|
-
const retentionDays = serviceUtils.getRetentionDays();
|
563
570
|
state.deleteExpiredJob = nodeSchedule.scheduleJob("0 0 * * *", () => {
|
564
|
-
const retentionDaysInMilliseconds =
|
571
|
+
const retentionDaysInMilliseconds = serviceUtils.getRetentionDays() * 24 * 60 * 60 * 1e3;
|
565
572
|
const expirationDate = new Date(Date.now() - retentionDaysInMilliseconds);
|
566
|
-
query.deleteMany({
|
573
|
+
strapi2.db.query(HISTORY_VERSION_UID).deleteMany({
|
567
574
|
where: {
|
568
575
|
created_at: {
|
569
576
|
$lt: expirationDate.toISOString()
|
@@ -2080,7 +2087,7 @@ const collectionTypes = {
|
|
2080
2087
|
if (permissionChecker2.cannot.read()) {
|
2081
2088
|
return ctx.forbidden();
|
2082
2089
|
}
|
2083
|
-
const
|
2090
|
+
const documents = await documentManager2.findMany(
|
2084
2091
|
{
|
2085
2092
|
filters: {
|
2086
2093
|
documentId: ids
|
@@ -2089,7 +2096,7 @@ const collectionTypes = {
|
|
2089
2096
|
},
|
2090
2097
|
model
|
2091
2098
|
);
|
2092
|
-
if (!
|
2099
|
+
if (!documents) {
|
2093
2100
|
return ctx.notFound();
|
2094
2101
|
}
|
2095
2102
|
const number = await documentManager2.countManyEntriesDraftRelations(ids, model, locale);
|
@@ -3755,22 +3762,24 @@ const getDeepPopulateDraftCount = (uid2) => {
|
|
3755
3762
|
attribute.component
|
3756
3763
|
);
|
3757
3764
|
if (childHasRelations) {
|
3758
|
-
populateAcc[attributeName] = {
|
3765
|
+
populateAcc[attributeName] = {
|
3766
|
+
populate: populate2
|
3767
|
+
};
|
3759
3768
|
hasRelations = true;
|
3760
3769
|
}
|
3761
3770
|
break;
|
3762
3771
|
}
|
3763
3772
|
case "dynamiczone": {
|
3764
|
-
const
|
3765
|
-
const { populate:
|
3766
|
-
if (
|
3773
|
+
const dzPopulateFragment = attribute.components?.reduce((acc, componentUID) => {
|
3774
|
+
const { populate: componentPopulate, hasRelations: componentHasRelations } = getDeepPopulateDraftCount(componentUID);
|
3775
|
+
if (componentHasRelations) {
|
3767
3776
|
hasRelations = true;
|
3768
|
-
return
|
3777
|
+
return { ...acc, [componentUID]: { populate: componentPopulate } };
|
3769
3778
|
}
|
3770
3779
|
return acc;
|
3771
3780
|
}, {});
|
3772
|
-
if (!fp.isEmpty(
|
3773
|
-
populateAcc[attributeName] = {
|
3781
|
+
if (!fp.isEmpty(dzPopulateFragment)) {
|
3782
|
+
populateAcc[attributeName] = { on: dzPopulateFragment };
|
3774
3783
|
}
|
3775
3784
|
break;
|
3776
3785
|
}
|