@akemona-org/strapi-plugin-content-manager 3.7.0 → 3.7.2
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/InjectedComponents/ContentTypeBuilder/ConfigureViewButton/index.js +2 -5
- package/admin/src/components/AddDropdown/index.js +5 -12
- package/admin/src/components/Block/index.js +2 -4
- package/admin/src/components/ComponentInitializer/index.js +1 -1
- package/admin/src/components/CustomTable/ActionCollapse/index.js +2 -2
- package/admin/src/components/CustomTable/Row/Cell.js +1 -1
- package/admin/src/components/CustomTable/Row/index.js +6 -6
- package/admin/src/components/CustomTable/index.js +5 -5
- package/admin/src/components/CustomTable/styledComponents.js +2 -2
- package/admin/src/components/DragLayer/index.js +1 -1
- package/admin/src/components/DraggedField/Wrapper.js +2 -7
- package/admin/src/components/DraggedField/index.js +3 -3
- package/admin/src/components/DraggedField/utils/getHeight.js +1 -1
- package/admin/src/components/DraggedFieldWithPreview/DynamicComponent.js +2 -2
- package/admin/src/components/DraggedFieldWithPreview/Wrapper.js +1 -2
- package/admin/src/components/DraggedFieldWithPreview/index.js +4 -4
- package/admin/src/components/DynamicComponentCard/index.js +2 -8
- package/admin/src/components/DynamicZone/Picker/index.js +3 -3
- package/admin/src/components/DynamicZone/index.js +4 -4
- package/admin/src/components/DynamicZone/utils/select.js +1 -1
- package/admin/src/components/FieldComponent/index.js +1 -1
- package/admin/src/components/FieldComponent/utils/select.js +6 -6
- package/admin/src/components/FieldsReorder/Item.js +6 -9
- package/admin/src/components/FieldsReorder/index.js +6 -17
- package/admin/src/components/FilterOptionsCTA/index.js +1 -1
- package/admin/src/components/FilterPicker/components.js +2 -2
- package/admin/src/components/FilterPicker/index.js +7 -7
- package/admin/src/components/FilterPicker/reducer.js +2 -2
- package/admin/src/components/FilterPickerOption/Input.js +1 -1
- package/admin/src/components/FilterPickerOption/Option.js +1 -3
- package/admin/src/components/FilterPickerOption/components.js +2 -2
- package/admin/src/components/FilterPickerOption/index.js +4 -4
- package/admin/src/components/FormTitle/index.js +1 -5
- package/admin/src/components/InputJSON/index.js +3 -3
- package/admin/src/components/InputJSON/jsonlint.js +639 -383
- package/admin/src/components/InputJSONWithErrors/index.js +2 -2
- package/admin/src/components/InputUID/Options/index.js +2 -2
- package/admin/src/components/InputUID/Options/wrapper.js +1 -1
- package/admin/src/components/InputUID/index.js +2 -2
- package/admin/src/components/Inputs/index.js +4 -4
- package/admin/src/components/Inputs/utils/generateOptions.js +2 -2
- package/admin/src/components/Inputs/utils/getStep.js +1 -1
- package/admin/src/components/MediaPreviewList/index.js +5 -5
- package/admin/src/components/NonRepeatableComponent/index.js +4 -4
- package/admin/src/components/PreviewWysiwyg/Wrapper.js +1 -1
- package/admin/src/components/PreviewWysiwyg/utils/satinizeHtml.js +1 -1
- package/admin/src/components/RelationPreviewList/RelationPreviewTooltip.js +3 -3
- package/admin/src/components/RelationPreviewList/index.js +1 -1
- package/admin/src/components/RepeatableComponent/Banner.js +2 -2
- package/admin/src/components/RepeatableComponent/BannerWrapper.js +1 -2
- package/admin/src/components/RepeatableComponent/DraggedItem/index.js +3 -9
- package/admin/src/components/RepeatableComponent/index.js +8 -8
- package/admin/src/components/RepeatableComponent/reducer.js +9 -9
- package/admin/src/components/Search/index.js +2 -2
- package/admin/src/components/SectionTitle/index.js +1 -3
- package/admin/src/components/SelectMany/ListItem.js +2 -2
- package/admin/src/components/SelectMany/index.js +3 -3
- package/admin/src/components/SelectOne/SingleValue.js +1 -1
- package/admin/src/components/SelectWrapper/ClearIndicator.js +1 -1
- package/admin/src/components/SelectWrapper/Option.js +1 -1
- package/admin/src/components/SelectWrapper/index.js +17 -27
- package/admin/src/components/SelectWrapper/utils/styles.js +6 -6
- package/admin/src/components/SettingsViewWrapper/index.js +9 -9
- package/admin/src/components/SortableList/Item.js +5 -11
- package/admin/src/components/Wysiwyg/MediaLib.js +1 -1
- package/admin/src/components/Wysiwyg/index.js +17 -25
- package/admin/src/components/Wysiwyg/toggleMode.js +3 -7
- package/admin/src/components/Wysiwyg/utils.js +2 -10
- package/admin/src/components/WysiwygDropUpload/index.js +1 -1
- package/admin/src/components/WysiwygInlineControls/Button.js +1 -1
- package/admin/src/components/WysiwygInlineControls/index.js +1 -1
- package/admin/src/components/WysiwygWithErrors/index.js +1 -1
- package/admin/src/containers/CollectionTypeFormWrapper/index.js +7 -12
- package/admin/src/containers/CollectionTypeFormWrapper/utils/getRequestUrl.js +1 -1
- package/admin/src/containers/CollectionTypeRecursivePath/index.js +1 -1
- package/admin/src/containers/ComponentSetttingsView/index.js +2 -2
- package/admin/src/containers/EditSettingsView/index.js +17 -17
- package/admin/src/containers/EditSettingsView/reducer.js +10 -10
- package/admin/src/containers/EditSettingsView/utils/createPossibleMainFieldsForModelsAndComponents.js +2 -2
- package/admin/src/containers/EditSettingsView/utils/getInputProps.js +1 -1
- package/admin/src/containers/EditSettingsView/utils/layout.js +9 -9
- package/admin/src/containers/EditView/DeleteLink/index.js +1 -1
- package/admin/src/containers/EditView/Header/index.js +10 -9
- package/admin/src/containers/EditView/Header/utils/getDraftRelations.js +3 -3
- package/admin/src/containers/EditView/index.js +7 -10
- package/admin/src/containers/EditView/utils/createAttributesLayout.js +4 -9
- package/admin/src/containers/EditView/utils/getFieldsActionMatchingPermissions.js +1 -1
- package/admin/src/containers/EditViewDataManagerProvider/index.js +7 -12
- package/admin/src/containers/EditViewDataManagerProvider/reducer.js +14 -14
- package/admin/src/containers/EditViewDataManagerProvider/utils/cleanData.js +4 -4
- package/admin/src/containers/EditViewDataManagerProvider/utils/getYupInnerErrors.js +2 -8
- package/admin/src/containers/EditViewDataManagerProvider/utils/schema.js +12 -12
- package/admin/src/containers/EditViewLayoutManager/Permissions.js +1 -1
- package/admin/src/containers/EditViewLayoutManager/reducer.js +1 -1
- package/admin/src/containers/EditViewLayoutManager/selectors.js +1 -1
- package/admin/src/containers/ListSettingsView/Label.js +2 -11
- package/admin/src/containers/ListSettingsView/index.js +9 -9
- package/admin/src/containers/ListSettingsView/reducer.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/Fields/Wrapper.js +1 -1
- package/admin/src/containers/ListView/FieldPicker/Fields/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/index.js +2 -2
- package/admin/src/containers/ListView/Filter.js +1 -4
- package/admin/src/containers/ListView/actions.js +2 -2
- package/admin/src/containers/ListView/index.js +8 -7
- package/admin/src/containers/ListView/reducer.js +5 -5
- package/admin/src/containers/ListView/selectors.js +2 -2
- package/admin/src/containers/ListView/utils/createPluginsFilter.js +1 -1
- package/admin/src/containers/ListView/utils/getAllAllowedHeaders.js +1 -1
- package/admin/src/containers/ListView/utils/getFirstSortableHeader.js +2 -2
- package/admin/src/containers/ListViewLayoutManager/Permissions.js +1 -1
- package/admin/src/containers/ListViewProvider/index.js +1 -3
- package/admin/src/containers/Main/index.js +2 -2
- package/admin/src/containers/Main/reducer.js +1 -1
- package/admin/src/containers/Main/selectors.js +2 -2
- package/admin/src/containers/RBACManager/reducer.js +1 -1
- package/admin/src/containers/SingleTypeFormWrapper/index.js +6 -11
- package/admin/src/containers/SingleTypeFormWrapper/utils/getRequestUrl.js +1 -1
- package/admin/src/containers/WysiwygProvider/index.js +1 -3
- package/admin/src/hooks/useContentTypeLayout/index.js +1 -1
- package/admin/src/hooks/useFetchContentTypeLayout/index.js +3 -3
- package/admin/src/hooks/useFetchContentTypeLayout/reducer.js +1 -1
- package/admin/src/hooks/useFetchContentTypeLayout/utils/formatLayouts.js +8 -8
- package/admin/src/hooks/useFindRedirectionLink/index.js +1 -1
- package/admin/src/hooks/useFindRedirectionLink/selectors.js +1 -1
- package/admin/src/icons/Cross/index.js +1 -6
- package/admin/src/icons/Na/index.js +3 -22
- package/admin/src/index.js +1 -1
- package/admin/src/pluginId.js +1 -1
- package/admin/src/selectors.js +2 -2
- package/admin/src/sharedReducers/crudReducer/actions.js +3 -3
- package/admin/src/sharedReducers/crudReducer/reducer.js +1 -1
- package/admin/src/sharedReducers/crudReducer/selectors.js +1 -1
- package/admin/src/utils/checkIfAttributeIsDisplayable.js +1 -1
- package/admin/src/utils/formatFiltersFromQuery.js +2 -2
- package/admin/src/utils/formatLayoutToApi.js +2 -2
- package/admin/src/utils/generatePermissionsObject.js +3 -2
- package/admin/src/utils/getComponents.js +3 -5
- package/admin/src/utils/getFieldName.js +2 -2
- package/admin/src/utils/getMaxTempKey.js +2 -2
- package/admin/src/utils/getRequestUrl.js +1 -1
- package/admin/src/utils/getTrad.js +1 -1
- package/admin/src/utils/mergeMetasWithSchema.js +2 -2
- package/admin/src/utils/removeKeyInObject.js +1 -1
- package/admin/src/utils/removePasswordFieldsFromData.js +2 -2
- package/controllers/content-types.js +4 -4
- package/package.json +4 -4
- package/services/components.js +1 -1
- package/services/configuration.js +9 -9
- package/services/permission-checker.js +6 -6
- package/services/uid.js +1 -1
- package/services/utils/configuration/layouts.js +14 -35
- package/services/utils/configuration/metadatas.js +1 -1
- package/services/utils/store.js +9 -9
- package/utils/index.js +1 -1
- package/utils/wrap-bad-request.js +14 -12
|
@@ -16,11 +16,8 @@ const StyledButton = styled(Base)`
|
|
|
16
16
|
const Button = ({ isTemporary, isInContentTypeView, contentTypeKind, targetUid }) => {
|
|
17
17
|
const { formatMessage } = useIntl();
|
|
18
18
|
const { push } = useHistory();
|
|
19
|
-
const {
|
|
20
|
-
|
|
21
|
-
componentsConfigurations,
|
|
22
|
-
singleTypesConfigurations,
|
|
23
|
-
} = pluginPermissions;
|
|
19
|
+
const { collectionTypesConfigurations, componentsConfigurations, singleTypesConfigurations } =
|
|
20
|
+
pluginPermissions;
|
|
24
21
|
const icon = <LayoutIcon className="colored" fill={isTemporary ? '#B4B6BA' : '#007eff'} />;
|
|
25
22
|
const label = formatMessage({ id: 'content-type-builder.form.button.configure-view' });
|
|
26
23
|
let permissionsToApply = collectionTypesConfigurations;
|
|
@@ -2,12 +2,7 @@ import React, { memo, useState } from 'react';
|
|
|
2
2
|
import { FormattedMessage } from 'react-intl';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
import { Plus } from '@buffetjs/icons';
|
|
5
|
-
import {
|
|
6
|
-
ButtonDropdown,
|
|
7
|
-
DropdownToggle,
|
|
8
|
-
DropdownMenu,
|
|
9
|
-
DropdownItem,
|
|
10
|
-
} from 'reactstrap';
|
|
5
|
+
import { ButtonDropdown, DropdownToggle, DropdownMenu, DropdownItem } from 'reactstrap';
|
|
11
6
|
import getTrad from '../../utils/getTrad';
|
|
12
7
|
import { Wrapper } from './components';
|
|
13
8
|
|
|
@@ -20,19 +15,17 @@ function Add({ data, isRelation, onClick, pStyle, style }) {
|
|
|
20
15
|
isOpen={isOpen}
|
|
21
16
|
toggle={() => {
|
|
22
17
|
if (data.length > 0) {
|
|
23
|
-
setIsOpen(prevState => !prevState);
|
|
18
|
+
setIsOpen((prevState) => !prevState);
|
|
24
19
|
}
|
|
25
20
|
}}
|
|
26
21
|
>
|
|
27
22
|
<DropdownToggle>
|
|
28
23
|
<FormattedMessage
|
|
29
24
|
id={getTrad(
|
|
30
|
-
`containers.SettingPage.${
|
|
31
|
-
isRelation ? 'add.relational-field' : 'add.field'
|
|
32
|
-
}`
|
|
25
|
+
`containers.SettingPage.${isRelation ? 'add.relational-field' : 'add.field'}`
|
|
33
26
|
)}
|
|
34
27
|
>
|
|
35
|
-
{msg => (
|
|
28
|
+
{(msg) => (
|
|
36
29
|
<p style={pStyle}>
|
|
37
30
|
<Plus fill="#007eff" height="11px" width="11px" />
|
|
38
31
|
{msg}
|
|
@@ -41,7 +34,7 @@ function Add({ data, isRelation, onClick, pStyle, style }) {
|
|
|
41
34
|
</FormattedMessage>
|
|
42
35
|
</DropdownToggle>
|
|
43
36
|
<DropdownMenu>
|
|
44
|
-
{data.map(item => (
|
|
37
|
+
{data.map((item) => (
|
|
45
38
|
<DropdownItem
|
|
46
39
|
key={item}
|
|
47
40
|
onClick={() => {
|
|
@@ -8,7 +8,7 @@ import PropTypes from 'prop-types';
|
|
|
8
8
|
import { FormattedMessage } from 'react-intl';
|
|
9
9
|
import { Wrapper, Sub } from './components';
|
|
10
10
|
|
|
11
|
-
const renderMsg = msg => <p>{msg}</p>;
|
|
11
|
+
const renderMsg = (msg) => <p>{msg}</p>;
|
|
12
12
|
|
|
13
13
|
const Block = ({ children, description, style, title }) => (
|
|
14
14
|
<div className="col-md-12">
|
|
@@ -19,9 +19,7 @@ const Block = ({ children, description, style, title }) => (
|
|
|
19
19
|
<FormattedMessage id={title} />
|
|
20
20
|
</p>
|
|
21
21
|
)}
|
|
22
|
-
{!!description &&
|
|
23
|
-
<FormattedMessage id={description}>{renderMsg}</FormattedMessage>
|
|
24
|
-
)}
|
|
22
|
+
{!!description && <FormattedMessage id={description}>{renderMsg}</FormattedMessage>}
|
|
25
23
|
</Sub>
|
|
26
24
|
{children}
|
|
27
25
|
</Wrapper>
|
|
@@ -23,7 +23,7 @@ const ComponentInitializer = ({ componentUid, isReadOnly, name }) => {
|
|
|
23
23
|
>
|
|
24
24
|
<PlusButton type="button" />
|
|
25
25
|
<FormattedMessage id={`${pluginId}.components.empty-repeatable`}>
|
|
26
|
-
{msg => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
|
26
|
+
{(msg) => <P style={{ paddingTop: 78 }}>{msg}</P>}
|
|
27
27
|
</FormattedMessage>
|
|
28
28
|
</NonRepeatableWrapper>
|
|
29
29
|
);
|
|
@@ -21,10 +21,10 @@ function ActionCollapse({ colSpan }) {
|
|
|
21
21
|
id={`${pluginId}.components.TableDelete.entries.${suffix}`}
|
|
22
22
|
values={{ number }}
|
|
23
23
|
>
|
|
24
|
-
{message => <Delete>{message}</Delete>}
|
|
24
|
+
{(message) => <Delete>{message}</Delete>}
|
|
25
25
|
</FormattedMessage>
|
|
26
26
|
<FormattedMessage id={`${pluginId}.components.TableDelete.${deleteMessageId}`}>
|
|
27
|
-
{message => <DeleteAll onClick={toggleModalDeleteAll}>{message}</DeleteAll>}
|
|
27
|
+
{(message) => <DeleteAll onClick={toggleModalDeleteAll}>{message}</DeleteAll>}
|
|
28
28
|
</FormattedMessage>
|
|
29
29
|
</td>
|
|
30
30
|
</Wrapper>
|
|
@@ -10,7 +10,7 @@ const Cell = ({ options }) => {
|
|
|
10
10
|
const [tooltipIsDisplayed, setDisplayTooltip] = useState(false);
|
|
11
11
|
|
|
12
12
|
const handleTooltipToggle = () => {
|
|
13
|
-
setDisplayTooltip(prev => !prev);
|
|
13
|
+
setDisplayTooltip((prev) => !prev);
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const { type, cellId, value } = options;
|
|
@@ -28,14 +28,14 @@ function Row({ canCreate, canDelete, canUpdate, isBulkable, row, headers, goTo }
|
|
|
28
28
|
const links = [
|
|
29
29
|
{
|
|
30
30
|
icon: canCreate ? <Duplicate fill="black" /> : null,
|
|
31
|
-
onClick: e => {
|
|
31
|
+
onClick: (e) => {
|
|
32
32
|
e.stopPropagation();
|
|
33
33
|
goTo(`create/clone/${row.id}`);
|
|
34
34
|
},
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
icon: canUpdate ? <FontAwesomeIcon icon="pencil-alt" /> : null,
|
|
38
|
-
onClick: e => {
|
|
38
|
+
onClick: (e) => {
|
|
39
39
|
e.stopPropagation();
|
|
40
40
|
emitEventRef.current('willDeleteEntryFromList');
|
|
41
41
|
goTo(row.id);
|
|
@@ -43,23 +43,23 @@ function Row({ canCreate, canDelete, canUpdate, isBulkable, row, headers, goTo }
|
|
|
43
43
|
},
|
|
44
44
|
{
|
|
45
45
|
icon: canDelete ? <FontAwesomeIcon icon="trash-alt" /> : null,
|
|
46
|
-
onClick: e => {
|
|
46
|
+
onClick: (e) => {
|
|
47
47
|
e.stopPropagation();
|
|
48
48
|
emitEventRef.current('willDeleteEntryFromList');
|
|
49
49
|
onClickDelete(row.id);
|
|
50
50
|
},
|
|
51
51
|
},
|
|
52
|
-
].filter(icon => icon);
|
|
52
|
+
].filter((icon) => icon);
|
|
53
53
|
|
|
54
54
|
return (
|
|
55
55
|
<>
|
|
56
56
|
{isBulkable && (
|
|
57
57
|
// eslint-disable-next-line jsx-a11y/click-events-have-key-events
|
|
58
|
-
<td key="i" onClick={e => e.stopPropagation()}>
|
|
58
|
+
<td key="i" onClick={(e) => e.stopPropagation()}>
|
|
59
59
|
<CustomInputCheckbox
|
|
60
60
|
name={row.id}
|
|
61
61
|
onChange={onChangeBulk}
|
|
62
|
-
value={entriesToDelete.filter(id => toString(id) === toString(row.id)).length > 0}
|
|
62
|
+
value={entriesToDelete.filter((id) => toString(id) === toString(row.id)).length > 0}
|
|
63
63
|
/>
|
|
64
64
|
</td>
|
|
65
65
|
)}
|
|
@@ -48,7 +48,7 @@ const CustomTable = ({
|
|
|
48
48
|
searchable: false,
|
|
49
49
|
sortable: true,
|
|
50
50
|
},
|
|
51
|
-
cellFormatter: cellData => {
|
|
51
|
+
cellFormatter: (cellData) => {
|
|
52
52
|
const isPublished = !isEmpty(cellData.published_at);
|
|
53
53
|
|
|
54
54
|
return <State isPublished={isPublished} />;
|
|
@@ -62,7 +62,7 @@ const CustomTable = ({
|
|
|
62
62
|
|
|
63
63
|
const colSpanLength = isBulkable && canDelete ? headers.length + 2 : headers.length + 1;
|
|
64
64
|
|
|
65
|
-
const handleRowGoTo = id => {
|
|
65
|
+
const handleRowGoTo = (id) => {
|
|
66
66
|
emitEvent('willEditEntryFromList');
|
|
67
67
|
push({
|
|
68
68
|
pathname: `${pathname}/${id}`,
|
|
@@ -70,7 +70,7 @@ const CustomTable = ({
|
|
|
70
70
|
search: searchToPersist,
|
|
71
71
|
});
|
|
72
72
|
};
|
|
73
|
-
const handleEditGoTo = id => {
|
|
73
|
+
const handleEditGoTo = (id) => {
|
|
74
74
|
emitEvent('willEditEntryFromButton');
|
|
75
75
|
push({
|
|
76
76
|
pathname: `${pathname}/${id}`,
|
|
@@ -97,11 +97,11 @@ const CustomTable = ({
|
|
|
97
97
|
</td>
|
|
98
98
|
</TableEmpty>
|
|
99
99
|
) : (
|
|
100
|
-
data.map(row => {
|
|
100
|
+
data.map((row) => {
|
|
101
101
|
return (
|
|
102
102
|
<TableRow
|
|
103
103
|
key={row.id}
|
|
104
|
-
onClick={e => {
|
|
104
|
+
onClick={(e) => {
|
|
105
105
|
e.preventDefault();
|
|
106
106
|
e.stopPropagation();
|
|
107
107
|
|
|
@@ -73,8 +73,8 @@ const LoadingWrapper = styled.div`
|
|
|
73
73
|
width: 100%;
|
|
74
74
|
height: 108px;
|
|
75
75
|
display: flex;
|
|
76
|
-
background: ${props => props.theme.main.colors.white};
|
|
77
|
-
box-shadow: 0 2px 4px ${props => props.theme.main.colors.darkGrey};
|
|
76
|
+
background: ${(props) => props.theme.main.colors.white};
|
|
77
|
+
box-shadow: 0 2px 4px ${(props) => props.theme.main.colors.darkGrey};
|
|
78
78
|
clip-path: inset(0px -5px -5px -5px);
|
|
79
79
|
`;
|
|
80
80
|
|
|
@@ -36,7 +36,7 @@ function getItemStyles(initialOffset, currentOffset, mouseOffset) {
|
|
|
36
36
|
|
|
37
37
|
const CustomDragLayer = () => {
|
|
38
38
|
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(
|
|
39
|
-
monitor => ({
|
|
39
|
+
(monitor) => ({
|
|
40
40
|
item: monitor.getItem(),
|
|
41
41
|
itemType: monitor.getItemType(),
|
|
42
42
|
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
@@ -13,7 +13,7 @@ const Wrapper = styled.div`
|
|
|
13
13
|
`};
|
|
14
14
|
min-height: ${({ withLongerHeight }) => getHeight(withLongerHeight)};
|
|
15
15
|
padding: 0 10px 0 0;
|
|
16
|
-
flex-basis: calc(100% / ${props => props.count});
|
|
16
|
+
flex-basis: calc(100% / ${(props) => props.count});
|
|
17
17
|
flex-shrink: 1;
|
|
18
18
|
min-width: 130px;
|
|
19
19
|
position: relative;
|
|
@@ -21,12 +21,7 @@ const Wrapper = styled.div`
|
|
|
21
21
|
.sub_wrapper {
|
|
22
22
|
position: relative;
|
|
23
23
|
cursor: pointer;
|
|
24
|
-
background-color: ${({
|
|
25
|
-
isOverEditBlock,
|
|
26
|
-
isOverRemove,
|
|
27
|
-
isSelected,
|
|
28
|
-
isSub,
|
|
29
|
-
}) => {
|
|
24
|
+
background-color: ${({ isOverEditBlock, isOverRemove, isSelected, isSub }) => {
|
|
30
25
|
if (isOverRemove) {
|
|
31
26
|
return '#ffe9e0';
|
|
32
27
|
} else if (isSelected || isOverEditBlock) {
|
|
@@ -84,7 +84,7 @@ const DraggedField = forwardRef(
|
|
|
84
84
|
isOverEditBlock={showEditBlockOverState}
|
|
85
85
|
isOverRemove={isOverRemove}
|
|
86
86
|
ref={ref}
|
|
87
|
-
onClick={e => {
|
|
87
|
+
onClick={(e) => {
|
|
88
88
|
e.stopPropagation();
|
|
89
89
|
e.preventDefault();
|
|
90
90
|
}}
|
|
@@ -134,9 +134,9 @@ const DraggedField = forwardRef(
|
|
|
134
134
|
{type === 'component' && (
|
|
135
135
|
<CheckPermissions permissions={pluginPermissions.componentsConfigurations}>
|
|
136
136
|
<FormattedMessage id={`${pluginId}.components.FieldItem.linkToComponentLayout`}>
|
|
137
|
-
{msg => (
|
|
137
|
+
{(msg) => (
|
|
138
138
|
<Link
|
|
139
|
-
onClick={e => {
|
|
139
|
+
onClick={(e) => {
|
|
140
140
|
e.stopPropagation();
|
|
141
141
|
|
|
142
142
|
goTo(`/plugins/${pluginId}/components/${componentUid}/configurations/edit`);
|
|
@@ -32,8 +32,8 @@ const DynamicComponent = ({ componentUid, friendlyName, icon, setIsOverDynamicZo
|
|
|
32
32
|
}, []);
|
|
33
33
|
|
|
34
34
|
const handleMouseEvent = () => {
|
|
35
|
-
setIsOverDynamicZone(v => !v);
|
|
36
|
-
setIsOver(v => !v);
|
|
35
|
+
setIsOverDynamicZone((v) => !v);
|
|
36
|
+
setIsOver((v) => !v);
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
return (
|
|
@@ -4,8 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
const Wrapper = styled.div`
|
|
5
5
|
display: flex;
|
|
6
6
|
position: relative;
|
|
7
|
-
min-height: ${({ withLongerHeight }) =>
|
|
8
|
-
withLongerHeight ? '102px' : '30px'};
|
|
7
|
+
min-height: ${({ withLongerHeight }) => (withLongerHeight ? '102px' : '30px')};
|
|
9
8
|
|
|
10
9
|
.sub {
|
|
11
10
|
width: 100%;
|
|
@@ -40,11 +40,11 @@ const DraggedFieldWithPreview = forwardRef(
|
|
|
40
40
|
const width = isFullSize && dragStart ? 0 : '100%';
|
|
41
41
|
const higherFields = ['json', 'text', 'file', 'media', 'component', 'richtext', 'dynamiczone'];
|
|
42
42
|
const withLongerHeight = higherFields.includes(type) && !dragStart;
|
|
43
|
-
const getCompoInfos = uid => get(componentLayouts, [uid, 'info'], { name: '', icon: '' });
|
|
43
|
+
const getCompoInfos = (uid) => get(componentLayouts, [uid, 'info'], { name: '', icon: '' });
|
|
44
44
|
|
|
45
45
|
const componentData = get(componentLayouts, [componentUid], {});
|
|
46
46
|
const componentLayout = get(componentData, ['layouts', 'edit'], []);
|
|
47
|
-
const getWrapperWitdh = colNum => `${(1 / 12) * colNum * 100}%`;
|
|
47
|
+
const getWrapperWitdh = (colNum) => `${(1 / 12) * colNum * 100}%`;
|
|
48
48
|
|
|
49
49
|
return (
|
|
50
50
|
<div
|
|
@@ -95,7 +95,7 @@ const DraggedFieldWithPreview = forwardRef(
|
|
|
95
95
|
}}
|
|
96
96
|
key={i}
|
|
97
97
|
>
|
|
98
|
-
{row.map(field => {
|
|
98
|
+
{row.map((field) => {
|
|
99
99
|
const fieldType = get(
|
|
100
100
|
componentData,
|
|
101
101
|
['attributes', field.name, 'type'],
|
|
@@ -129,7 +129,7 @@ const DraggedFieldWithPreview = forwardRef(
|
|
|
129
129
|
})}
|
|
130
130
|
{type === 'dynamiczone' && (
|
|
131
131
|
<DynamicZoneWrapper>
|
|
132
|
-
{dynamicZoneComponents.map(compo => {
|
|
132
|
+
{dynamicZoneComponents.map((compo) => {
|
|
133
133
|
const { name, icon } = getCompoInfos(compo);
|
|
134
134
|
|
|
135
135
|
return (
|
|
@@ -3,16 +3,10 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
4
4
|
import Wrapper from './Wrapper';
|
|
5
5
|
|
|
6
|
-
const DynamicComponentCard = ({
|
|
7
|
-
children,
|
|
8
|
-
componentUid,
|
|
9
|
-
friendlyName,
|
|
10
|
-
icon,
|
|
11
|
-
onClick,
|
|
12
|
-
}) => {
|
|
6
|
+
const DynamicComponentCard = ({ children, componentUid, friendlyName, icon, onClick }) => {
|
|
13
7
|
return (
|
|
14
8
|
<Wrapper
|
|
15
|
-
onClick={e => {
|
|
9
|
+
onClick={(e) => {
|
|
16
10
|
e.preventDefault();
|
|
17
11
|
e.stopPropagation();
|
|
18
12
|
|
|
@@ -13,7 +13,7 @@ const Picker = ({ components, isOpen, onClickAddComponent }) => {
|
|
|
13
13
|
const [categoryToOpen, setCategoryToOpen] = useState('');
|
|
14
14
|
|
|
15
15
|
const dynamicComponentCategories = useMemo(() => {
|
|
16
|
-
const componentsWithInfo = components.map(componentUid => {
|
|
16
|
+
const componentsWithInfo = components.map((componentUid) => {
|
|
17
17
|
const { category, info } = getComponentLayout(componentUid);
|
|
18
18
|
|
|
19
19
|
return { componentUid, category, info };
|
|
@@ -35,7 +35,7 @@ const Picker = ({ components, isOpen, onClickAddComponent }) => {
|
|
|
35
35
|
}, [isOpen, dynamicComponentCategories]);
|
|
36
36
|
|
|
37
37
|
const handleAddComponentToDz = useCallback(
|
|
38
|
-
componentUid => {
|
|
38
|
+
(componentUid) => {
|
|
39
39
|
onClickAddComponent(componentUid);
|
|
40
40
|
setCategoryToOpen('');
|
|
41
41
|
},
|
|
@@ -43,7 +43,7 @@ const Picker = ({ components, isOpen, onClickAddComponent }) => {
|
|
|
43
43
|
);
|
|
44
44
|
|
|
45
45
|
const handleClickToggle = useCallback(
|
|
46
|
-
categoryName => {
|
|
46
|
+
(categoryName) => {
|
|
47
47
|
const nextCategoryToOpen = categoryToOpen === categoryName ? '' : categoryName;
|
|
48
48
|
|
|
49
49
|
setCategoryToOpen(nextCategoryToOpen);
|
|
@@ -41,10 +41,10 @@ const DynamicZone = ({
|
|
|
41
41
|
const { max = Infinity, min = -Infinity } = fieldSchema;
|
|
42
42
|
const dynamicZoneErrors = useMemo(() => {
|
|
43
43
|
return Object.keys(formErrors)
|
|
44
|
-
.filter(key => {
|
|
44
|
+
.filter((key) => {
|
|
45
45
|
return key === name;
|
|
46
46
|
})
|
|
47
|
-
.map(key => formErrors[key]);
|
|
47
|
+
.map((key) => formErrors[key]);
|
|
48
48
|
}, [formErrors, name]);
|
|
49
49
|
|
|
50
50
|
const dynamicZoneAvailableComponents = useMemo(() => fieldSchema.components || [], [fieldSchema]);
|
|
@@ -59,7 +59,7 @@ const DynamicZone = ({
|
|
|
59
59
|
hasError && get(dynamicZoneErrors, [0, 'id'], '') === 'components.Input.error.validation.max';
|
|
60
60
|
|
|
61
61
|
const handleAddComponent = useCallback(
|
|
62
|
-
componentUid => {
|
|
62
|
+
(componentUid) => {
|
|
63
63
|
setIsOpen(false);
|
|
64
64
|
|
|
65
65
|
addComponentToDynamicZone(name, componentUid, hasError);
|
|
@@ -69,7 +69,7 @@ const DynamicZone = ({
|
|
|
69
69
|
|
|
70
70
|
const handleClickOpenPicker = () => {
|
|
71
71
|
if (dynamicDisplayedComponentsLength < max) {
|
|
72
|
-
setIsOpen(prev => !prev);
|
|
72
|
+
setIsOpen((prev) => !prev);
|
|
73
73
|
} else {
|
|
74
74
|
strapi.notification.info(`${pluginId}.components.notification.info.maximum-requirement`);
|
|
75
75
|
}
|
|
@@ -17,7 +17,7 @@ function useSelect(name) {
|
|
|
17
17
|
} = useContentManagerEditViewDataManager();
|
|
18
18
|
|
|
19
19
|
const dynamicDisplayedComponents = useMemo(
|
|
20
|
-
() => get(modifiedData, [name], []).map(data => data.__component),
|
|
20
|
+
() => get(modifiedData, [name], []).map((data) => data.__component),
|
|
21
21
|
[modifiedData, name]
|
|
22
22
|
);
|
|
23
23
|
|
|
@@ -20,7 +20,7 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
20
20
|
const allDynamicZoneFields = useMemo(() => {
|
|
21
21
|
const attributes = get(contentType, ['attributes'], {});
|
|
22
22
|
|
|
23
|
-
const dynamicZoneFields = Object.keys(attributes).filter(attrName => {
|
|
23
|
+
const dynamicZoneFields = Object.keys(attributes).filter((attrName) => {
|
|
24
24
|
return get(attributes, [attrName, 'type'], '') === 'dynamiczone';
|
|
25
25
|
});
|
|
26
26
|
|
|
@@ -41,17 +41,17 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
41
41
|
return true;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
const includedDynamicZoneFields = allowedFields.filter(name => name === compoName[0]);
|
|
44
|
+
const includedDynamicZoneFields = allowedFields.filter((name) => name === compoName[0]);
|
|
45
45
|
|
|
46
46
|
if (includedDynamicZoneFields.length > 0) {
|
|
47
47
|
return true;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const relatedChildrenAllowedFields = allowedFields
|
|
51
|
-
.map(fieldName => {
|
|
51
|
+
.map((fieldName) => {
|
|
52
52
|
return fieldName.split('.');
|
|
53
53
|
})
|
|
54
|
-
.filter(fieldName => {
|
|
54
|
+
.filter((fieldName) => {
|
|
55
55
|
if (fieldName.length < compoName.length) {
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
@@ -76,10 +76,10 @@ function useSelect({ isFromDynamicZone, name }) {
|
|
|
76
76
|
const allowedFields = isCreatingEntry ? [] : readActionAllowedFields;
|
|
77
77
|
|
|
78
78
|
const relatedChildrenAllowedFields = allowedFields
|
|
79
|
-
.map(fieldName => {
|
|
79
|
+
.map((fieldName) => {
|
|
80
80
|
return fieldName.split('.');
|
|
81
81
|
})
|
|
82
|
-
.filter(fieldName => {
|
|
82
|
+
.filter((fieldName) => {
|
|
83
83
|
if (fieldName.length < compoName.length) {
|
|
84
84
|
return false;
|
|
85
85
|
}
|
|
@@ -59,8 +59,7 @@ const Item = ({
|
|
|
59
59
|
const hoverBoundingRect = dropRef.current.getBoundingClientRect();
|
|
60
60
|
|
|
61
61
|
// Get vertical middle
|
|
62
|
-
const hoverMiddleY =
|
|
63
|
-
(hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
62
|
+
const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;
|
|
64
63
|
// Determine mouse position
|
|
65
64
|
const clientOffset = monitor.getClientOffset();
|
|
66
65
|
|
|
@@ -136,7 +135,7 @@ const Item = ({
|
|
|
136
135
|
item.itemIndex = hoverIndex;
|
|
137
136
|
item.rowIndex = targetRow;
|
|
138
137
|
},
|
|
139
|
-
collect: monitor => ({
|
|
138
|
+
collect: (monitor) => ({
|
|
140
139
|
canDrop: monitor.canDrop(),
|
|
141
140
|
clientOffset: monitor.getClientOffset(),
|
|
142
141
|
isOver: monitor.isOver(),
|
|
@@ -156,7 +155,7 @@ const Item = ({
|
|
|
156
155
|
// We will need to add a 12 size _TEMP_ div to offer a drop target between each existing row.
|
|
157
156
|
return name !== '_TEMP_';
|
|
158
157
|
},
|
|
159
|
-
collect: monitor => ({
|
|
158
|
+
collect: (monitor) => ({
|
|
160
159
|
isDragging: monitor.isDragging(),
|
|
161
160
|
getItem: monitor.getItem(),
|
|
162
161
|
}),
|
|
@@ -189,13 +188,11 @@ const Item = ({
|
|
|
189
188
|
showLeftCarret =
|
|
190
189
|
isOver &&
|
|
191
190
|
getItem.size !== 12 &&
|
|
192
|
-
Math.abs(clientOffset.x - hoverBoundingRect.left) <
|
|
193
|
-
hoverBoundingRect.width / 2;
|
|
191
|
+
Math.abs(clientOffset.x - hoverBoundingRect.left) < hoverBoundingRect.width / 2;
|
|
194
192
|
showRightCarret =
|
|
195
193
|
isOver &&
|
|
196
194
|
getItem.size !== 12 &&
|
|
197
|
-
Math.abs(clientOffset.x - hoverBoundingRect.left) >
|
|
198
|
-
hoverBoundingRect.width / 2;
|
|
195
|
+
Math.abs(clientOffset.x - hoverBoundingRect.left) > hoverBoundingRect.width / 2;
|
|
199
196
|
|
|
200
197
|
if (name === '_TEMP_') {
|
|
201
198
|
showLeftCarret = isOver && getItem.size !== 12;
|
|
@@ -213,7 +210,7 @@ const Item = ({
|
|
|
213
210
|
label={get(metadatas, [name, 'edit', 'label'], '')}
|
|
214
211
|
name={name}
|
|
215
212
|
onClickEdit={setEditFieldToSelect}
|
|
216
|
-
onClickRemove={e => {
|
|
213
|
+
onClickRemove={(e) => {
|
|
217
214
|
e.stopPropagation();
|
|
218
215
|
removeField(rowIndex, itemIndex);
|
|
219
216
|
}}
|
|
@@ -10,24 +10,17 @@ import Wrapper from './components';
|
|
|
10
10
|
import Item from './Item';
|
|
11
11
|
|
|
12
12
|
const FieldsReorder = ({ className }) => {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
buttonData,
|
|
16
|
-
layout,
|
|
17
|
-
moveItem,
|
|
18
|
-
moveRow,
|
|
19
|
-
onAddData,
|
|
20
|
-
removeField,
|
|
21
|
-
} = useLayoutDnd();
|
|
13
|
+
const { attributes, buttonData, layout, moveItem, moveRow, onAddData, removeField } =
|
|
14
|
+
useLayoutDnd();
|
|
22
15
|
|
|
23
16
|
const getComponent = useCallback(
|
|
24
|
-
attributeName => {
|
|
17
|
+
(attributeName) => {
|
|
25
18
|
return get(attributes, [attributeName, 'component'], '');
|
|
26
19
|
},
|
|
27
20
|
[attributes]
|
|
28
21
|
);
|
|
29
22
|
const getType = useCallback(
|
|
30
|
-
attributeName => {
|
|
23
|
+
(attributeName) => {
|
|
31
24
|
const attribute = get(attributes, [attributeName], {});
|
|
32
25
|
|
|
33
26
|
return attribute.type;
|
|
@@ -35,7 +28,7 @@ const FieldsReorder = ({ className }) => {
|
|
|
35
28
|
[attributes]
|
|
36
29
|
);
|
|
37
30
|
const getDynamicZoneComponents = useCallback(
|
|
38
|
-
attributeName => {
|
|
31
|
+
(attributeName) => {
|
|
39
32
|
const attribute = get(attributes, [attributeName], {});
|
|
40
33
|
|
|
41
34
|
return attribute.components || [];
|
|
@@ -80,11 +73,7 @@ const FieldsReorder = ({ className }) => {
|
|
|
80
73
|
);
|
|
81
74
|
})}
|
|
82
75
|
<Wrapper style={{ marginBottom: 10 }}>
|
|
83
|
-
<Add
|
|
84
|
-
data={buttonData}
|
|
85
|
-
onClick={onAddData}
|
|
86
|
-
style={{ width: '100%', margin: '0 5px' }}
|
|
87
|
-
/>
|
|
76
|
+
<Add data={buttonData} onClick={onAddData} style={{ width: '100%', margin: '0 5px' }} />
|
|
88
77
|
</Wrapper>
|
|
89
78
|
</SortWrapper>
|
|
90
79
|
</div>
|
|
@@ -38,11 +38,11 @@ const Flex = styled.div`
|
|
|
38
38
|
|
|
39
39
|
const Div = styled.div`
|
|
40
40
|
width: calc(100% + 60px);
|
|
41
|
-
margin: ${props => (props.show ? '-100px -30px 30px' : `-${props.number}px -30px 103px`)};
|
|
41
|
+
margin: ${(props) => (props.show ? '-100px -30px 30px' : `-${props.number}px -30px 103px`)};
|
|
42
42
|
background: #fff;
|
|
43
43
|
box-shadow: 3px 2px 4px #e3e9f3;
|
|
44
44
|
padding: 18px 30px 0px 30px;
|
|
45
|
-
transition: ${props => {
|
|
45
|
+
transition: ${(props) => {
|
|
46
46
|
if (props.anim) {
|
|
47
47
|
return props.show
|
|
48
48
|
? 'margin-top .3s ease-out, margin-bottom .2s ease-out'
|
|
@@ -69,7 +69,7 @@ function FilterPicker({
|
|
|
69
69
|
];
|
|
70
70
|
|
|
71
71
|
const allowedAttributes = Object.keys(get(contentType, ['attributes']), {})
|
|
72
|
-
.filter(attr => {
|
|
72
|
+
.filter((attr) => {
|
|
73
73
|
const current = get(contentType, ['attributes', attr], {});
|
|
74
74
|
|
|
75
75
|
if (!readActionAllowedFields.includes(attr) && attr !== 'id' && !timestamps.includes(attr)) {
|
|
@@ -79,7 +79,7 @@ function FilterPicker({
|
|
|
79
79
|
return !NOT_ALLOWED_FILTERS.includes(current.type) && current.type !== undefined;
|
|
80
80
|
})
|
|
81
81
|
.sort()
|
|
82
|
-
.map(attr => {
|
|
82
|
+
.map((attr) => {
|
|
83
83
|
const current = get(contentType, ['attributes', attr], {});
|
|
84
84
|
|
|
85
85
|
return { name: attr, type: current.type, options: current.enum || null };
|
|
@@ -100,7 +100,7 @@ function FilterPicker({
|
|
|
100
100
|
|
|
101
101
|
const renderTitle = () => (
|
|
102
102
|
<FormattedMessage id={`${pluginId}.components.FiltersPickWrapper.PluginHeader.title.filter`}>
|
|
103
|
-
{message => (
|
|
103
|
+
{(message) => (
|
|
104
104
|
<span>
|
|
105
105
|
{capitalize(name)} -
|
|
106
106
|
<span>{message}</span>
|
|
@@ -162,10 +162,10 @@ function FilterPicker({
|
|
|
162
162
|
};
|
|
163
163
|
|
|
164
164
|
const handleSubmit = useCallback(
|
|
165
|
-
e => {
|
|
165
|
+
(e) => {
|
|
166
166
|
e.preventDefault();
|
|
167
167
|
const nextFilters = formatFiltersToQuery(modifiedData, metadatas);
|
|
168
|
-
const useRelation = nextFilters._where.some(obj => Object.keys(obj)[0].includes('.'));
|
|
168
|
+
const useRelation = nextFilters._where.some((obj) => Object.keys(obj)[0].includes('.'));
|
|
169
169
|
|
|
170
170
|
emitEventRef.current('didFilterEntries', { useRelation });
|
|
171
171
|
setQuery({ ...nextFilters, page: 1 });
|
|
@@ -174,7 +174,7 @@ function FilterPicker({
|
|
|
174
174
|
[modifiedData, setQuery, toggleFilterPickerState, metadatas]
|
|
175
175
|
);
|
|
176
176
|
|
|
177
|
-
const handleRemoveFilter = index => {
|
|
177
|
+
const handleRemoveFilter = (index) => {
|
|
178
178
|
if (index === 0 && modifiedData.length === 1) {
|
|
179
179
|
toggleFilterPickerState();
|
|
180
180
|
|
|
@@ -188,7 +188,7 @@ function FilterPicker({
|
|
|
188
188
|
};
|
|
189
189
|
|
|
190
190
|
const getAttributeType = useCallback(
|
|
191
|
-
filter => {
|
|
191
|
+
(filter) => {
|
|
192
192
|
const attributeType = get(contentType, ['attributes', filter.name, 'type'], '');
|
|
193
193
|
|
|
194
194
|
if (attributeType === 'relation') {
|