@akemona-org/strapi-plugin-content-manager 3.12.3 → 3.13.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/admin/src/InjectedComponents/ContentTypeBuilder/ConfigureViewButton/index.js +2 -2
- package/admin/src/components/Block/index.js +3 -3
- package/admin/src/components/ComponentInitializer/index.js +2 -2
- package/admin/src/components/CustomTable/Headers/Header.js +2 -2
- package/admin/src/components/CustomTable/Row/Cell.js +2 -2
- package/admin/src/components/CustomTable/index.js +3 -3
- package/admin/src/components/DragLayer/index.js +2 -2
- package/admin/src/components/DraggedFieldWithPreview/DynamicComponent.js +2 -2
- package/admin/src/components/DynamicComponentCard/index.js +2 -2
- package/admin/src/components/DynamicZone/Component/index.js +3 -3
- package/admin/src/components/DynamicZone/Picker/Category/Banner/index.js +2 -2
- package/admin/src/components/DynamicZone/Picker/Category/index.js +2 -2
- package/admin/src/components/DynamicZone/Picker/index.js +2 -2
- package/admin/src/components/DynamicZone/index.js +3 -3
- package/admin/src/components/FieldComponent/index.js +3 -3
- package/admin/src/components/FieldsReorder/Item.js +3 -3
- package/admin/src/components/FieldsReorder/index.js +2 -2
- package/admin/src/components/FilterPickerOption/Option.js +2 -2
- package/admin/src/components/FormTitle/index.js +3 -3
- package/admin/src/components/InputUID/Options/index.js +3 -3
- package/admin/src/components/InputUID/RightLabel.js +2 -2
- package/admin/src/components/InputUID/index.js +3 -3
- package/admin/src/components/NonRepeatableComponent/index.js +2 -2
- package/admin/src/components/PopupForm/index.js +3 -3
- package/admin/src/components/PreviewCarret/index.js +3 -3
- package/admin/src/components/PreviewWysiwyg/index.js +2 -2
- package/admin/src/components/RelationPreviewList/RelationPreviewTooltip.js +3 -3
- package/admin/src/components/RelationPreviewList/index.js +3 -3
- package/admin/src/components/RepeatableComponent/CarretTop.js +2 -2
- package/admin/src/components/RepeatableComponent/DraggedItem/index.js +3 -3
- package/admin/src/components/RepeatableComponent/index.js +3 -3
- package/admin/src/components/SectionTitle/index.js +2 -2
- package/admin/src/components/SelectMany/Relation.js +3 -3
- package/admin/src/components/SelectOne/SingleValue.js +2 -2
- package/admin/src/components/SelectWrapper/ClearIndicator.js +2 -2
- package/admin/src/components/SelectWrapper/IndicatorSeparator.js +3 -1
- package/admin/src/components/SelectWrapper/Option.js +2 -2
- package/admin/src/components/SettingsViewWrapper/index.js +3 -3
- package/admin/src/components/SortableList/Item.js +2 -2
- package/admin/src/components/SortableList/index.js +2 -2
- package/admin/src/components/State/index.js +2 -2
- package/admin/src/components/Wysiwyg/MediaLib.js +2 -2
- package/admin/src/components/Wysiwyg/customSelect.js +2 -2
- package/admin/src/components/Wysiwyg/previewControl.js +3 -3
- package/admin/src/components/Wysiwyg/toggleMode.js +2 -2
- package/admin/src/components/WysiwygBottomControls/index.js +2 -2
- package/admin/src/components/WysiwygDropUpload/index.js +2 -2
- package/admin/src/components/WysiwygInlineControls/Button.js +3 -3
- package/admin/src/components/WysiwygInlineControls/StyledButton.js +3 -1
- package/admin/src/components/WysiwygInlineControls/index.js +3 -3
- package/admin/src/containers/CollectionTypeFormWrapper/index.js +2 -2
- package/admin/src/containers/CollectionTypeRecursivePath/index.js +3 -3
- package/admin/src/containers/ComponentSetttingsView/index.js +2 -2
- package/admin/src/containers/EditSettingsView/index.js +2 -2
- package/admin/src/containers/EditView/DeleteLink/index.js +2 -2
- package/admin/src/containers/EditView/Header/index.js +3 -3
- package/admin/src/containers/EditView/InformationCard.js +2 -2
- package/admin/src/containers/EditView/index.js +3 -3
- package/admin/src/containers/EditViewDataManagerProvider/index.js +3 -3
- package/admin/src/containers/EditViewLayoutManager/Permissions.js +2 -2
- package/admin/src/containers/EditViewLayoutManager/index.js +2 -2
- package/admin/src/containers/ListSettingsView/Label.js +2 -2
- package/admin/src/containers/ListSettingsView/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/ConfigureLink/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/Field/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/Fields/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/Header/index.js +2 -2
- package/admin/src/containers/ListView/FieldPicker/index.js +2 -2
- package/admin/src/containers/ListView/index.js +1 -3
- package/admin/src/containers/ListViewLayoutManager/Permissions.js +2 -2
- package/admin/src/containers/ListViewLayoutManager/index.js +2 -2
- package/admin/src/containers/SingleTypeFormWrapper/index.js +2 -2
- package/admin/src/containers/SingleTypeRecursivePath/index.js +3 -3
- package/admin/src/icons/Bold/index.js +2 -2
- package/admin/src/icons/Code/index.js +2 -2
- package/admin/src/icons/Cross/index.js +2 -2
- package/admin/src/icons/Italic/index.js +2 -2
- package/admin/src/icons/Link/index.js +2 -2
- package/admin/src/icons/Media/index.js +2 -2
- package/admin/src/icons/Na/index.js +2 -2
- package/admin/src/icons/Ol/index.js +2 -2
- package/admin/src/icons/Quote/index.js +2 -2
- package/admin/src/icons/Striked/index.js +2 -2
- package/admin/src/icons/Ul/index.js +2 -2
- package/admin/src/icons/Underline/index.js +2 -2
- package/package.json +4 -4
|
@@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
5
5
|
import pluginId from '../../pluginId';
|
|
6
6
|
import Title from './Title';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function SectionTitle({ isSettings }) {
|
|
9
9
|
const suffix = isSettings ? 'settings' : 'view';
|
|
10
10
|
const msgId = `${pluginId}.containers.SettingPage.${suffix}`;
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ const SectionTitle = ({ isSettings }) => {
|
|
|
14
14
|
<FormattedMessage id={msgId}>{(msg) => <Title>{msg}</Title>}</FormattedMessage>
|
|
15
15
|
</div>
|
|
16
16
|
);
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
SectionTitle.propTypes = {
|
|
20
20
|
isSettings: PropTypes.bool,
|
|
@@ -11,7 +11,7 @@ import { Span } from './components';
|
|
|
11
11
|
|
|
12
12
|
/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function Relation({
|
|
15
15
|
data,
|
|
16
16
|
displayNavigationLink,
|
|
17
17
|
hasDraftAndPublish,
|
|
@@ -21,7 +21,7 @@ const Relation = ({
|
|
|
21
21
|
onRemove,
|
|
22
22
|
searchToPersist,
|
|
23
23
|
to,
|
|
24
|
-
})
|
|
24
|
+
}) {
|
|
25
25
|
const { formatMessage } = useIntl();
|
|
26
26
|
const cursor = useMemo(() => {
|
|
27
27
|
if (isDisabled) {
|
|
@@ -77,7 +77,7 @@ const Relation = ({
|
|
|
77
77
|
</div>
|
|
78
78
|
</>
|
|
79
79
|
);
|
|
80
|
-
}
|
|
80
|
+
}
|
|
81
81
|
|
|
82
82
|
Relation.defaultProps = {
|
|
83
83
|
isDragging: false,
|
|
@@ -6,7 +6,7 @@ import { Flex, Padded, Text } from '@buffetjs/core';
|
|
|
6
6
|
import { RelationDPState } from '@akemona-org/strapi-helper-plugin';
|
|
7
7
|
import { getDisplayedValue } from '../../utils';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function SingleValue(props) {
|
|
10
10
|
const Component = components.SingleValue;
|
|
11
11
|
const hasDraftAndPublish = has(get(props, 'data.value'), 'published_at');
|
|
12
12
|
const isDraft = isEmpty(get(props, 'data.value.published_at'));
|
|
@@ -41,7 +41,7 @@ const SingleValue = (props) => {
|
|
|
41
41
|
</Padded>
|
|
42
42
|
</Component>
|
|
43
43
|
);
|
|
44
|
-
}
|
|
44
|
+
}
|
|
45
45
|
|
|
46
46
|
SingleValue.propTypes = {
|
|
47
47
|
data: PropTypes.object.isRequired,
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import { Remove } from '@buffetjs/icons';
|
|
3
3
|
import { components } from 'react-select';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function ClearIndicator(props) {
|
|
6
6
|
const Component = components.ClearIndicator;
|
|
7
7
|
|
|
8
8
|
return (
|
|
@@ -10,6 +10,6 @@ const ClearIndicator = (props) => {
|
|
|
10
10
|
<Remove width="11px" height="11px" fill="#9EA7B8" />
|
|
11
11
|
</Component>
|
|
12
12
|
);
|
|
13
|
-
}
|
|
13
|
+
}
|
|
14
14
|
|
|
15
15
|
export default ClearIndicator;
|
|
@@ -12,7 +12,7 @@ const TextGrow = styled(Text)`
|
|
|
12
12
|
flex-grow: 2;
|
|
13
13
|
`;
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function Option(props) {
|
|
16
16
|
const { formatMessage } = useIntl();
|
|
17
17
|
const Component = components.Option;
|
|
18
18
|
const hasDraftAndPublish = has(get(props, 'data.value'), 'published_at');
|
|
@@ -53,7 +53,7 @@ const Option = (props) => {
|
|
|
53
53
|
</Text>
|
|
54
54
|
</Component>
|
|
55
55
|
);
|
|
56
|
-
}
|
|
56
|
+
}
|
|
57
57
|
|
|
58
58
|
Option.defaultProps = {
|
|
59
59
|
label: '',
|
|
@@ -18,7 +18,7 @@ import Container from '../Container';
|
|
|
18
18
|
import SectionTitle from '../SectionTitle';
|
|
19
19
|
import Separator from '../Separator';
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function SettingsViewWrapper({
|
|
22
22
|
children,
|
|
23
23
|
history: { goBack },
|
|
24
24
|
displayedFields,
|
|
@@ -32,7 +32,7 @@ const SettingsViewWrapper = ({
|
|
|
32
32
|
onConfirmReset,
|
|
33
33
|
onConfirmSubmit,
|
|
34
34
|
onModalConfirmClosed,
|
|
35
|
-
})
|
|
35
|
+
}) {
|
|
36
36
|
const { emitEvent, formatMessage } = useGlobalContext();
|
|
37
37
|
const [showWarningCancel, setWarningCancel] = useState(false);
|
|
38
38
|
const [showWarningSubmit, setWarningSubmit] = useState(false);
|
|
@@ -226,7 +226,7 @@ const SettingsViewWrapper = ({
|
|
|
226
226
|
</Container>
|
|
227
227
|
</>
|
|
228
228
|
);
|
|
229
|
-
}
|
|
229
|
+
}
|
|
230
230
|
|
|
231
231
|
SettingsViewWrapper.defaultProps = {
|
|
232
232
|
displayedFields: [],
|
|
@@ -9,7 +9,7 @@ import DraggedFieldWithPreview from '../DraggedFieldWithPreview';
|
|
|
9
9
|
|
|
10
10
|
import ItemTypes from '../../utils/ItemTypes';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function Item({ index, move, name, removeItem }) {
|
|
13
13
|
const { goTo, metadatas, selectedItemName, setEditFieldToSelect, setIsDraggingSibling } =
|
|
14
14
|
useLayoutDnd();
|
|
15
15
|
const dragRef = useRef(null);
|
|
@@ -104,7 +104,7 @@ const Item = ({ index, move, name, removeItem }) => {
|
|
|
104
104
|
i={index === 0}
|
|
105
105
|
/>
|
|
106
106
|
);
|
|
107
|
-
}
|
|
107
|
+
}
|
|
108
108
|
|
|
109
109
|
Item.defaultProps = {
|
|
110
110
|
move: () => {},
|
|
@@ -6,7 +6,7 @@ import Add from '../AddDropdown';
|
|
|
6
6
|
import SortWrapper from '../SortWrapper';
|
|
7
7
|
import Item from './Item';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function SortableList({ addItem, buttonData, moveItem, removeItem }) {
|
|
10
10
|
const { relationsLayout } = useLayoutDnd();
|
|
11
11
|
|
|
12
12
|
return (
|
|
@@ -44,7 +44,7 @@ const SortableList = ({ addItem, buttonData, moveItem, removeItem }) => {
|
|
|
44
44
|
</SortWrapper>
|
|
45
45
|
</div>
|
|
46
46
|
);
|
|
47
|
-
}
|
|
47
|
+
}
|
|
48
48
|
|
|
49
49
|
SortableList.defaultProps = {
|
|
50
50
|
buttonData: [],
|
|
@@ -5,7 +5,7 @@ import { Text } from '@buffetjs/core';
|
|
|
5
5
|
import { getTrad } from '../../utils';
|
|
6
6
|
import Wrapper from './Wrapper';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function State({ isPublished }) {
|
|
9
9
|
const { formatMessage } = useIntl();
|
|
10
10
|
|
|
11
11
|
return (
|
|
@@ -17,7 +17,7 @@ const State = ({ isPublished }) => {
|
|
|
17
17
|
</Text>
|
|
18
18
|
</Wrapper>
|
|
19
19
|
);
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
State.propTypes = {
|
|
23
23
|
isPublished: PropTypes.bool.isRequired,
|
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState } from 'react';
|
|
|
2
2
|
import { useStrapi, prefixFileUrlWithBackendUrl } from '@akemona-org/strapi-helper-plugin';
|
|
3
3
|
import PropTypes from 'prop-types';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
function MediaLib({ isOpen, onChange, onToggle }) {
|
|
6
6
|
const {
|
|
7
7
|
strapi: {
|
|
8
8
|
componentApi: { getComponent },
|
|
@@ -54,7 +54,7 @@ const MediaLib = ({ isOpen, onChange, onToggle }) => {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
return null;
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
|
|
59
59
|
MediaLib.defaultProps = {
|
|
60
60
|
isOpen: false,
|
|
@@ -12,7 +12,7 @@ import useWysiwyg from '../../hooks/useWysiwyg';
|
|
|
12
12
|
import { SELECT_OPTIONS } from './constants';
|
|
13
13
|
import SelectWrapper from './SelectWrapper';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function CustomSelect({ disabled }) {
|
|
16
16
|
const { headerValue, isFullscreen, handleChangeSelect } = useWysiwyg();
|
|
17
17
|
|
|
18
18
|
return (
|
|
@@ -26,7 +26,7 @@ const CustomSelect = ({ disabled }) => {
|
|
|
26
26
|
/>
|
|
27
27
|
</SelectWrapper>
|
|
28
28
|
);
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
|
|
31
31
|
CustomSelect.defaultProps = {
|
|
32
32
|
disabled: false,
|
|
@@ -9,14 +9,14 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import { FormattedMessage } from 'react-intl';
|
|
10
10
|
import PreviewControlWrapper from './PreviewControlWrapper';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
<PreviewControlWrapper onClick={onClick}>
|
|
12
|
+
function PreviewControl({ onClick }) {
|
|
13
|
+
return <PreviewControlWrapper onClick={onClick}>
|
|
14
14
|
<div />
|
|
15
15
|
<div className="wysiwygCollapse">
|
|
16
16
|
<FormattedMessage id="components.Wysiwyg.collapse" />
|
|
17
17
|
</div>
|
|
18
18
|
</PreviewControlWrapper>
|
|
19
|
-
|
|
19
|
+
}
|
|
20
20
|
|
|
21
21
|
PreviewControl.defaultProps = {
|
|
22
22
|
onClick: () => {},
|
|
@@ -9,7 +9,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
9
9
|
import PropTypes from 'prop-types';
|
|
10
10
|
import ToggleModeWrapper from './ToggleModeWrapper';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function ToggleMode(props) {
|
|
13
13
|
const label = props.isPreviewMode
|
|
14
14
|
? 'components.Wysiwyg.ToggleMode.markdown'
|
|
15
15
|
: 'components.Wysiwyg.ToggleMode.preview';
|
|
@@ -25,7 +25,7 @@ const ToggleMode = (props) => {
|
|
|
25
25
|
</FormattedMessage>
|
|
26
26
|
</ToggleModeWrapper>
|
|
27
27
|
);
|
|
28
|
-
}
|
|
28
|
+
}
|
|
29
29
|
|
|
30
30
|
ToggleMode.defaultProps = {
|
|
31
31
|
isPreviewMode: false,
|
|
@@ -11,7 +11,7 @@ import PropTypes from 'prop-types';
|
|
|
11
11
|
import { FormattedMessage } from 'react-intl';
|
|
12
12
|
import { Wrapper } from './components';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function WysiwygBottomControls({ onClick }) {
|
|
15
15
|
return (
|
|
16
16
|
<Wrapper>
|
|
17
17
|
<div />
|
|
@@ -20,7 +20,7 @@ const WysiwygBottomControls = ({ onClick }) => {
|
|
|
20
20
|
</div>
|
|
21
21
|
</Wrapper>
|
|
22
22
|
);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
WysiwygBottomControls.defaultProps = {
|
|
26
26
|
onClick: () => {},
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import React from 'react';
|
|
8
8
|
import Label from './Label';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function WysiwygDropUpload(props) {
|
|
11
11
|
return (
|
|
12
12
|
<Label {...props}>
|
|
13
13
|
<input onChange={() => {}} type="file" tabIndex="-1" />
|
|
14
14
|
</Label>
|
|
15
15
|
);
|
|
16
|
-
}
|
|
16
|
+
}
|
|
17
17
|
|
|
18
18
|
export default WysiwygDropUpload;
|
|
@@ -25,7 +25,7 @@ const icons = {
|
|
|
25
25
|
img: Media,
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
function Button({
|
|
29
29
|
active,
|
|
30
30
|
disabled,
|
|
31
31
|
className: type,
|
|
@@ -35,7 +35,7 @@ const Button = ({
|
|
|
35
35
|
label,
|
|
36
36
|
style,
|
|
37
37
|
text,
|
|
38
|
-
})
|
|
38
|
+
}) {
|
|
39
39
|
const handleClick = (e) => {
|
|
40
40
|
e.preventDefault();
|
|
41
41
|
|
|
@@ -50,7 +50,7 @@ const Button = ({
|
|
|
50
50
|
{!hideLabel && label}
|
|
51
51
|
</StyledButton>
|
|
52
52
|
);
|
|
53
|
-
}
|
|
53
|
+
}
|
|
54
54
|
|
|
55
55
|
Button.defaultProps = {
|
|
56
56
|
active: false,
|
|
@@ -26,7 +26,9 @@ const Button = styled.button`
|
|
|
26
26
|
return css`
|
|
27
27
|
border: 0;
|
|
28
28
|
background: rgba(16, 22, 34, 0);
|
|
29
|
-
box-shadow:
|
|
29
|
+
box-shadow:
|
|
30
|
+
inset 0 -1px 0 0 rgba(16, 22, 34, 0.04),
|
|
31
|
+
inset 0 1px 0 0 rgba(16, 22, 34, 0.04);
|
|
30
32
|
`;
|
|
31
33
|
}
|
|
32
34
|
|
|
@@ -9,14 +9,14 @@ import PropTypes from 'prop-types';
|
|
|
9
9
|
import Button from './Button';
|
|
10
10
|
import Wrapper from './Wrapper';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function WysiwygInlineControls({
|
|
13
13
|
buttons,
|
|
14
14
|
disabled,
|
|
15
15
|
editorState,
|
|
16
16
|
handlers,
|
|
17
17
|
onToggle,
|
|
18
18
|
onToggleBlock,
|
|
19
|
-
})
|
|
19
|
+
}) {
|
|
20
20
|
const selection = editorState.getSelection();
|
|
21
21
|
const blockType = editorState
|
|
22
22
|
.getCurrentContent()
|
|
@@ -45,7 +45,7 @@ const WysiwygInlineControls = ({
|
|
|
45
45
|
))}
|
|
46
46
|
</Wrapper>
|
|
47
47
|
);
|
|
48
|
-
}
|
|
48
|
+
}
|
|
49
49
|
|
|
50
50
|
WysiwygInlineControls.defaultProps = {
|
|
51
51
|
buttons: [],
|
|
@@ -27,7 +27,7 @@ import selectCrudReducer from '../../sharedReducers/crudReducer/selectors';
|
|
|
27
27
|
import { getRequestUrl } from './utils';
|
|
28
28
|
|
|
29
29
|
// This container is used to handle the CRUD
|
|
30
|
-
|
|
30
|
+
function CollectionTypeFormWrapper({ allLayoutData, children, slug, id, origin }) {
|
|
31
31
|
const { emitEvent } = useGlobalContext();
|
|
32
32
|
const { push, replace } = useHistory();
|
|
33
33
|
const [{ rawQuery }] = useQueryParams();
|
|
@@ -338,7 +338,7 @@ const CollectionTypeFormWrapper = ({ allLayoutData, children, slug, id, origin }
|
|
|
338
338
|
status,
|
|
339
339
|
redirectionLink,
|
|
340
340
|
});
|
|
341
|
-
}
|
|
341
|
+
}
|
|
342
342
|
|
|
343
343
|
CollectionTypeFormWrapper.defaultProps = {
|
|
344
344
|
id: null,
|
|
@@ -17,12 +17,12 @@ import EditSettingsView from '../EditSettingsView';
|
|
|
17
17
|
import ListViewLayout from '../ListViewLayoutManager';
|
|
18
18
|
import ListSettingsView from '../ListSettingsView';
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
function CollectionTypeRecursivePath({
|
|
21
21
|
match: {
|
|
22
22
|
params: { slug },
|
|
23
23
|
url,
|
|
24
24
|
},
|
|
25
|
-
})
|
|
25
|
+
}) {
|
|
26
26
|
const { isLoading, layout, updateLayout } = useFetchContentTypeLayout(slug);
|
|
27
27
|
|
|
28
28
|
const { rawContentTypeLayout, rawComponentsLayouts } = useMemo(() => {
|
|
@@ -115,7 +115,7 @@ const CollectionTypeRecursivePath = ({
|
|
|
115
115
|
</ContentTypeLayoutContext.Provider>
|
|
116
116
|
</ErrorBoundary>
|
|
117
117
|
);
|
|
118
|
-
}
|
|
118
|
+
}
|
|
119
119
|
|
|
120
120
|
CollectionTypeRecursivePath.propTypes = {
|
|
121
121
|
match: PropTypes.shape({
|
|
@@ -13,7 +13,7 @@ import crudReducer, { crudInitialState } from '../../sharedReducers/crudReducer/
|
|
|
13
13
|
import { getData, getDataSucceeded } from '../../sharedReducers/crudReducer/actions';
|
|
14
14
|
import EditSettingsView from '../EditSettingsView';
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
function ComponentSettingsView() {
|
|
17
17
|
const [{ isLoading, data: layout }, dispatch] = useReducer(crudReducer, crudInitialState);
|
|
18
18
|
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
|
19
19
|
const { schemas } = useSelector((state) => schemasSelector(state), shallowEqual);
|
|
@@ -54,6 +54,6 @@ const ComponentSettingsView = () => {
|
|
|
54
54
|
<EditSettingsView components={layout.components} mainLayout={layout.component} slug={uid} />
|
|
55
55
|
</CheckPagePermissions>
|
|
56
56
|
);
|
|
57
|
-
}
|
|
57
|
+
}
|
|
58
58
|
|
|
59
59
|
export default memo(ComponentSettingsView);
|
|
@@ -21,7 +21,7 @@ import reducer, { initialState } from './reducer';
|
|
|
21
21
|
import { createPossibleMainFieldsForModelsAndComponents, getInputProps } from './utils';
|
|
22
22
|
import { unformatLayout } from './utils/layout';
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
function EditSettingsView({ components, mainLayout, isContentTypeView, slug, updateLayout }) {
|
|
25
25
|
const { push } = useHistory();
|
|
26
26
|
const { currentEnvironment, emitEvent, plugins } = useGlobalContext();
|
|
27
27
|
|
|
@@ -379,7 +379,7 @@ const EditSettingsView = ({ components, mainLayout, isContentTypeView, slug, upd
|
|
|
379
379
|
/>
|
|
380
380
|
</LayoutDndProvider>
|
|
381
381
|
);
|
|
382
|
-
}
|
|
382
|
+
}
|
|
383
383
|
|
|
384
384
|
EditSettingsView.defaultProps = {
|
|
385
385
|
isContentTypeView: false,
|
|
@@ -11,7 +11,7 @@ import { getTrad } from '../../../utils';
|
|
|
11
11
|
import { DeleteButton } from '../components';
|
|
12
12
|
import { connect, select } from './utils';
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
function DeleteLink({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerProperty }) {
|
|
15
15
|
const [showWarningDelete, setWarningDelete] = useState(false);
|
|
16
16
|
const [didDeleteEntry, setDidDeleteEntry] = useState(false);
|
|
17
17
|
const [isModalConfirmButtonLoading, setIsModalConfirmButtonLoading] = useState(false);
|
|
@@ -80,7 +80,7 @@ const DeleteLink = ({ isCreatingEntry, onDelete, onDeleteSucceeded, trackerPrope
|
|
|
80
80
|
/>
|
|
81
81
|
</>
|
|
82
82
|
);
|
|
83
|
-
}
|
|
83
|
+
}
|
|
84
84
|
|
|
85
85
|
DeleteLink.propTypes = {
|
|
86
86
|
isCreatingEntry: PropTypes.bool.isRequired,
|
|
@@ -18,7 +18,7 @@ const primaryButtonObject = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
function Header({
|
|
22
22
|
allowedActions: { canUpdate, canCreate, canPublish },
|
|
23
23
|
componentLayouts,
|
|
24
24
|
initialData,
|
|
@@ -30,7 +30,7 @@ const Header = ({
|
|
|
30
30
|
onPublish,
|
|
31
31
|
onUnpublish,
|
|
32
32
|
status,
|
|
33
|
-
})
|
|
33
|
+
}) {
|
|
34
34
|
const [showWarningUnpublish, setWarningUnpublish] = useState(false);
|
|
35
35
|
const { formatMessage } = useIntl();
|
|
36
36
|
const formatMessageRef = useRef(formatMessage);
|
|
@@ -234,7 +234,7 @@ const Header = ({
|
|
|
234
234
|
)}
|
|
235
235
|
</>
|
|
236
236
|
);
|
|
237
|
-
}
|
|
237
|
+
}
|
|
238
238
|
|
|
239
239
|
Header.propTypes = {
|
|
240
240
|
allowedActions: PropTypes.shape({
|
|
@@ -16,7 +16,7 @@ const BaselineAlignment = styled.div`
|
|
|
16
16
|
padding-top: ${({ size }) => size};
|
|
17
17
|
`;
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
function InformationCard() {
|
|
20
20
|
const { initialData, hasDraftAndPublish, layout } = useContentManagerEditViewDataManager();
|
|
21
21
|
const { formatMessage } = useIntl();
|
|
22
22
|
|
|
@@ -98,6 +98,6 @@ const InformationCard = () => {
|
|
|
98
98
|
<BaselineAlignment size="2px" />
|
|
99
99
|
</>
|
|
100
100
|
);
|
|
101
|
-
}
|
|
101
|
+
}
|
|
102
102
|
|
|
103
103
|
export default InformationCard;
|
|
@@ -28,7 +28,7 @@ import DeleteLink from './DeleteLink';
|
|
|
28
28
|
import InformationCard from './InformationCard';
|
|
29
29
|
|
|
30
30
|
/* eslint-disable react/no-array-index-key */
|
|
31
|
-
|
|
31
|
+
function EditView({
|
|
32
32
|
allowedActions,
|
|
33
33
|
isSingleType,
|
|
34
34
|
goBack,
|
|
@@ -37,7 +37,7 @@ const EditView = ({
|
|
|
37
37
|
id,
|
|
38
38
|
origin,
|
|
39
39
|
userPermissions,
|
|
40
|
-
})
|
|
40
|
+
}) {
|
|
41
41
|
const { currentEnvironment, plugins } = useGlobalContext();
|
|
42
42
|
|
|
43
43
|
const { createActionAllowedFields, readActionAllowedFields, updateActionAllowedFields } =
|
|
@@ -256,7 +256,7 @@ const EditView = ({
|
|
|
256
256
|
}}
|
|
257
257
|
</DataManagementWrapper>
|
|
258
258
|
);
|
|
259
|
-
}
|
|
259
|
+
}
|
|
260
260
|
|
|
261
261
|
EditView.defaultProps = {
|
|
262
262
|
id: null,
|
|
@@ -12,7 +12,7 @@ import { getTrad, removeKeyInObject } from '../../utils';
|
|
|
12
12
|
import reducer, { initialState } from './reducer';
|
|
13
13
|
import { cleanData, createYupSchema, getYupInnerErrors } from './utils';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
function EditViewDataManagerProvider({
|
|
16
16
|
allLayoutData,
|
|
17
17
|
allowedActions: { canRead, canUpdate },
|
|
18
18
|
children,
|
|
@@ -34,7 +34,7 @@ const EditViewDataManagerProvider = ({
|
|
|
34
34
|
slug,
|
|
35
35
|
status,
|
|
36
36
|
updateActionAllowedFields,
|
|
37
|
-
})
|
|
37
|
+
}) {
|
|
38
38
|
const [reducerState, dispatch] = useReducer(reducer, initialState);
|
|
39
39
|
const { formErrors, initialData, modifiedData, modifiedDZName, shouldCheckErrors } =
|
|
40
40
|
reducerState.toJS();
|
|
@@ -481,7 +481,7 @@ const EditViewDataManagerProvider = ({
|
|
|
481
481
|
</>
|
|
482
482
|
</ContentManagerEditViewDataManagerContext.Provider>
|
|
483
483
|
);
|
|
484
|
-
}
|
|
484
|
+
}
|
|
485
485
|
|
|
486
486
|
EditViewDataManagerProvider.defaultProps = {
|
|
487
487
|
from: '/',
|
|
@@ -5,7 +5,7 @@ import isEqual from 'react-fast-compare';
|
|
|
5
5
|
import EditView from '../EditView';
|
|
6
6
|
import { generatePermissionsObject } from '../../utils';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function Permissions(props) {
|
|
9
9
|
const viewPermissions = useMemo(() => generatePermissionsObject(props.slug), [props.slug]);
|
|
10
10
|
const { isLoading, allowedActions } = useUserPermissions(viewPermissions, props.userPermissions);
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@ const Permissions = (props) => {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
return <EditView {...props} allowedActions={allowedActions} />;
|
|
17
|
-
}
|
|
17
|
+
}
|
|
18
18
|
|
|
19
19
|
Permissions.defaultProps = {
|
|
20
20
|
permissions: [],
|
|
@@ -7,7 +7,7 @@ import { resetProps, setLayout } from './actions';
|
|
|
7
7
|
import selectLayout from './selectors';
|
|
8
8
|
import Permissions from './Permissions';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
function EditViewLayoutManager({ layout, ...rest }) {
|
|
11
11
|
const currentLayout = useSelector(selectLayout);
|
|
12
12
|
const dispatch = useDispatch();
|
|
13
13
|
const [{ query }] = useQueryParams();
|
|
@@ -26,7 +26,7 @@ const EditViewLayoutManager = ({ layout, ...rest }) => {
|
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
return <Permissions {...rest} layout={currentLayout} userPermissions={permissions} />;
|
|
29
|
-
}
|
|
29
|
+
}
|
|
30
30
|
|
|
31
31
|
EditViewLayoutManager.propTypes = {
|
|
32
32
|
layout: PropTypes.shape({
|
|
@@ -6,7 +6,7 @@ import ItemTypes from '../../utils/ItemTypes';
|
|
|
6
6
|
import DraggedField from '../../components/DraggedField';
|
|
7
7
|
import useLayoutDnd from '../../hooks/useLayoutDnd';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function Label({ count, index, label, move, name, onClick, onRemove, selectedItem }) {
|
|
10
10
|
const ref = useRef(null);
|
|
11
11
|
const { setIsDraggingSibling } = useLayoutDnd();
|
|
12
12
|
|
|
@@ -60,7 +60,7 @@ const Label = ({ count, index, label, move, name, onClick, onRemove, selectedIte
|
|
|
60
60
|
selectedItem={selectedItem}
|
|
61
61
|
/>
|
|
62
62
|
);
|
|
63
|
-
}
|
|
63
|
+
}
|
|
64
64
|
|
|
65
65
|
Label.defaultProps = {
|
|
66
66
|
index: 0,
|
|
@@ -21,7 +21,7 @@ import init from './init';
|
|
|
21
21
|
import reducer, { initialState } from './reducer';
|
|
22
22
|
import forms from './forms.json';
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
function ListSettingsView({ layout, slug, updateLayout }) {
|
|
25
25
|
const [reducerState, dispatch] = useReducer(reducer, initialState, () =>
|
|
26
26
|
init(initialState, layout)
|
|
27
27
|
);
|
|
@@ -281,7 +281,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
281
281
|
/>
|
|
282
282
|
</LayoutDndProvider>
|
|
283
283
|
);
|
|
284
|
-
}
|
|
284
|
+
}
|
|
285
285
|
|
|
286
286
|
ListSettingsView.propTypes = {
|
|
287
287
|
layout: PropTypes.shape({
|
|
@@ -5,7 +5,7 @@ import { FormattedMessage } from 'react-intl';
|
|
|
5
5
|
import Link from './StyledLink';
|
|
6
6
|
import Wrapper from './Wrapper';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
function ConfigureLink({ slug }) {
|
|
9
9
|
const { emitEvent } = useGlobalContext();
|
|
10
10
|
|
|
11
11
|
const handleClick = () => {
|
|
@@ -20,7 +20,7 @@ const ConfigureLink = ({ slug }) => {
|
|
|
20
20
|
</Link>
|
|
21
21
|
</Wrapper>
|
|
22
22
|
);
|
|
23
|
-
}
|
|
23
|
+
}
|
|
24
24
|
|
|
25
25
|
ConfigureLink.propTypes = {
|
|
26
26
|
slug: PropTypes.string.isRequired,
|