@webbio/strapi-plugin-page-builder 0.8.5-platform → 0.9.1-platform
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/admin/src/components/PlatformFilteredSelectField/Multi/index.tsx +19 -7
- package/admin/src/components/PlatformFilteredSelectField/hooks/useRelationLoad.tsx +4 -2
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/components/Relations/RelationInput.tsx +689 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/components/Relations/RelationInputDataManager.tsx +6 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/components/Relations/useRelation.ts +170 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/components/Relations/utils/getRelationLink.ts +5 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/components/Relations/utils/normalizeRelations.ts +52 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/constants/attributes.ts +3 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/hooks/useDragAndDrop.ts +253 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/hooks/useKeyboardDragAndDrop.ts +96 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/hooks/usePrev.ts +11 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/utils/dragAndDrop.ts +8 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/utils/paths.ts +29 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/utils/refs.ts +19 -0
- package/admin/src/components/StrapiCore/admin/admin/src/content-manager/utils/translations.ts +3 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/collection-types.ts +300 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/components.ts +72 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/content-types.ts +116 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/index.ts +8 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/init.ts +22 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/relations.ts +80 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/review-workflows.ts +88 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/single-types.ts +112 -0
- package/admin/src/components/StrapiCore/content-manager/shared/contracts/uid.ts +48 -0
- package/admin/src/components/StrapiCore/content-manager/shared/index.ts +1 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.server.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -5,7 +5,10 @@ import { useSelector } from 'react-redux';
|
|
|
5
5
|
import { useFetchClient } from '@strapi/helper-plugin';
|
|
6
6
|
import pick from 'lodash/pick';
|
|
7
7
|
|
|
8
|
-
import
|
|
8
|
+
import {
|
|
9
|
+
RelationInput,
|
|
10
|
+
RelationInputProps
|
|
11
|
+
} from '../../StrapiCore/admin/admin/src/content-manager/components/Relations/RelationInput';
|
|
9
12
|
|
|
10
13
|
import { useGetLocaleFromUrl } from '../../../utils/hooks/useGetLocaleFromUrl';
|
|
11
14
|
import { getSearchFilteredEntities } from '../../../api/search-filtered-entity';
|
|
@@ -53,8 +56,15 @@ const MultiPlatformFilteredSelectField = ({
|
|
|
53
56
|
const defaultLocale = locales.find((locale: any) => locale.isDefault);
|
|
54
57
|
const selectedLocale = initialData?.locale ?? urlLocale ?? defaultLocale.code;
|
|
55
58
|
|
|
56
|
-
const [searchResults, setSearchResults] = useState<
|
|
57
|
-
|
|
59
|
+
const [searchResults, setSearchResults] = useState<RelationInputProps['searchResults']>({
|
|
60
|
+
data: [],
|
|
61
|
+
isLoading: false
|
|
62
|
+
});
|
|
63
|
+
const [selectedResults, setSelectedResults] = useState<RelationInputProps['relations']>({
|
|
64
|
+
data: [],
|
|
65
|
+
isLoading: false,
|
|
66
|
+
isFetchingNextPage: false
|
|
67
|
+
});
|
|
58
68
|
|
|
59
69
|
const { formatMessage } = useIntl();
|
|
60
70
|
|
|
@@ -75,7 +85,7 @@ const MultiPlatformFilteredSelectField = ({
|
|
|
75
85
|
: '';
|
|
76
86
|
|
|
77
87
|
useEffect(() => {
|
|
78
|
-
setSelectedResults({ data: targetFieldValue });
|
|
88
|
+
setSelectedResults({ data: targetFieldValue, isLoading: false, isFetchingNextPage: false });
|
|
79
89
|
}, [targetFieldValue]);
|
|
80
90
|
|
|
81
91
|
const getItems = async (inputValue?: string) => {
|
|
@@ -97,7 +107,8 @@ const MultiPlatformFilteredSelectField = ({
|
|
|
97
107
|
publishedAt: x.publishedAt
|
|
98
108
|
}));
|
|
99
109
|
|
|
100
|
-
|
|
110
|
+
// @ts-expect-error data is fine
|
|
111
|
+
setSearchResults({ data: mapped || [], isLoading: false });
|
|
101
112
|
};
|
|
102
113
|
|
|
103
114
|
const handleRelationReorder = (oldIndex: number, newIndex: number) => {
|
|
@@ -123,7 +134,7 @@ const MultiPlatformFilteredSelectField = ({
|
|
|
123
134
|
return (
|
|
124
135
|
<RelationInput
|
|
125
136
|
id={name}
|
|
126
|
-
name={name}
|
|
137
|
+
name={name || ''}
|
|
127
138
|
error={error}
|
|
128
139
|
canReorder
|
|
129
140
|
description={hint}
|
|
@@ -181,7 +192,8 @@ const MultiPlatformFilteredSelectField = ({
|
|
|
181
192
|
)}
|
|
182
193
|
searchResults={searchResults}
|
|
183
194
|
size={8}
|
|
184
|
-
|
|
195
|
+
// @ts-ignore
|
|
196
|
+
hint={hint || ''}
|
|
185
197
|
labelAction={labelAction}
|
|
186
198
|
required={required}
|
|
187
199
|
/>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import get from 'lodash/get';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { useRelation } from '
|
|
4
|
-
import { getInitialDataPathUsingTempKeys } from '
|
|
3
|
+
import { useRelation } from '../../StrapiCore/admin/admin/src/content-manager/components/Relations/useRelation';
|
|
4
|
+
import { getInitialDataPathUsingTempKeys } from '../../StrapiCore/admin/admin/src/content-manager/utils/paths';
|
|
5
5
|
import RelationHelper, { IPlatformFilteredSelectFieldProps } from '../utils/relation-helper';
|
|
6
6
|
import { useCMEditViewDataManager } from '@strapi/helper-plugin';
|
|
7
7
|
import { useRouteMatch } from 'react-router-dom';
|
|
@@ -73,8 +73,10 @@ const useRelationLoad = ({ name, attribute }: IPlatformFilteredSelectFieldProps)
|
|
|
73
73
|
});
|
|
74
74
|
},
|
|
75
75
|
normalizeArguments: {
|
|
76
|
+
// @ts-expect-error
|
|
76
77
|
mainFieldName: relationMainFieldName,
|
|
77
78
|
shouldAddLink: true,
|
|
79
|
+
// @ts-expect-error
|
|
78
80
|
targetModel: targetAttributes?.targetModel
|
|
79
81
|
}
|
|
80
82
|
},
|