@akemona-org/strapi-plugin-content-type-builder 3.7.0 → 3.7.1

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.
Files changed (87) hide show
  1. package/admin/src/components/AllowedTypesSelect/index.js +1 -1
  2. package/admin/src/components/AttributeOption/index.js +1 -1
  3. package/admin/src/components/BooleanBox/icons/CTSelected.js +1 -1
  4. package/admin/src/components/BooleanBox/icons/CTUnselected.js +1 -1
  5. package/admin/src/components/BooleanBox/icons/STSelected.js +1 -1
  6. package/admin/src/components/BooleanBox/icons/STUnselected.js +1 -1
  7. package/admin/src/components/BooleanBox/index.js +3 -3
  8. package/admin/src/components/ComponentCard/index.js +1 -1
  9. package/admin/src/components/ComponentIconPicker/CellRenderer.js +1 -6
  10. package/admin/src/components/ComponentIconPicker/index.js +4 -4
  11. package/admin/src/components/ComponentList/index.js +1 -3
  12. package/admin/src/components/ComponentSelect/MenuList.js +5 -6
  13. package/admin/src/components/ComponentSelect/MultipleMenuList.js +15 -15
  14. package/admin/src/components/ComponentSelect/Value.js +3 -11
  15. package/admin/src/components/ComponentSelect/utils/HasSomeSubArray.js +1 -1
  16. package/admin/src/components/ComponentSelect/utils/hasSubArray.js +1 -1
  17. package/admin/src/components/CreatableSelect/index.js +2 -2
  18. package/admin/src/components/CustomCheckbox/index.js +1 -1
  19. package/admin/src/components/DynamicZoneList/index.js +1 -1
  20. package/admin/src/components/HeaderNavLink/index.js +2 -4
  21. package/admin/src/components/List/index.js +1 -1
  22. package/admin/src/components/ListHeader/index.js +1 -1
  23. package/admin/src/components/ListRow/index.js +3 -3
  24. package/admin/src/components/ModalHeader/DropdownInfos.js +1 -1
  25. package/admin/src/components/ModalHeader/index.js +2 -8
  26. package/admin/src/components/RelationForm/index.js +2 -8
  27. package/admin/src/components/RelationFormBox/index.js +1 -3
  28. package/admin/src/components/RelationFormNaturePicker/index.js +1 -1
  29. package/admin/src/components/RelationTargetPicker/index.js +2 -2
  30. package/admin/src/components/SelectMenuUl/index.js +1 -1
  31. package/admin/src/components/WrapperSelect/index.js +2 -2
  32. package/admin/src/containers/DataManagerProvider/constants.js +10 -5
  33. package/admin/src/containers/DataManagerProvider/index.js +15 -17
  34. package/admin/src/containers/DataManagerProvider/reducer.js +25 -25
  35. package/admin/src/containers/DataManagerProvider/selectors.js +2 -2
  36. package/admin/src/containers/DataManagerProvider/utils/cleanData.js +8 -8
  37. package/admin/src/containers/DataManagerProvider/utils/createDataObject.js +1 -1
  38. package/admin/src/containers/DataManagerProvider/utils/createModifiedDataSchema.js +25 -42
  39. package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsFromSchema.js +6 -21
  40. package/admin/src/containers/DataManagerProvider/utils/retrieveComponentsThatHaveComponents.js +12 -18
  41. package/admin/src/containers/DataManagerProvider/utils/retrieveNestedComponents.js +4 -10
  42. package/admin/src/containers/DataManagerProvider/utils/retrieveSpecificInfoFromComponents.js +1 -1
  43. package/admin/src/containers/FormModal/attributes/advancedForm.js +6 -6
  44. package/admin/src/containers/FormModal/attributes/baseForm.js +5 -5
  45. package/admin/src/containers/FormModal/attributes/types.js +10 -23
  46. package/admin/src/containers/FormModal/attributes/validation/common.js +8 -16
  47. package/admin/src/containers/FormModal/category/createCategorySchema.js +2 -2
  48. package/admin/src/containers/FormModal/component/createComponentSchema.js +2 -2
  49. package/admin/src/containers/FormModal/constants.js +10 -5
  50. package/admin/src/containers/FormModal/contentType/createContentTypeSchema.js +2 -2
  51. package/admin/src/containers/FormModal/contentType/form.js +1 -1
  52. package/admin/src/containers/FormModal/forms/index.js +5 -5
  53. package/admin/src/containers/FormModal/index.js +15 -15
  54. package/admin/src/containers/FormModal/reducer.js +9 -9
  55. package/admin/src/containers/FormModal/selectors.js +2 -2
  56. package/admin/src/containers/FormModal/utils/createHeadersArray.js +3 -6
  57. package/admin/src/containers/FormModal/utils/createHeadersObjectFromArray.js +1 -1
  58. package/admin/src/containers/FormModal/utils/createUid.js +2 -2
  59. package/admin/src/containers/FormModal/utils/getModalTitleSubHeader.js +1 -1
  60. package/admin/src/containers/FormModal/utils/relations.js +2 -2
  61. package/admin/src/containers/LeftMenu/index.js +11 -11
  62. package/admin/src/containers/ListView/index.js +4 -4
  63. package/admin/src/icons/Curve.js +1 -1
  64. package/admin/src/icons/ManyToMany.js +3 -12
  65. package/admin/src/icons/ManyToOne.js +1 -4
  66. package/admin/src/icons/OneToMany.js +2 -8
  67. package/admin/src/index.js +1 -1
  68. package/admin/src/pluginId.js +1 -1
  69. package/admin/src/utils/convertAttrObjToArray.js +1 -1
  70. package/admin/src/utils/formAPI.js +2 -2
  71. package/admin/src/utils/getAttributeDisplayedType.js +1 -1
  72. package/admin/src/utils/getComponents.js +2 -2
  73. package/admin/src/utils/getTrad.js +1 -1
  74. package/admin/src/utils/makeUnique.js +1 -1
  75. package/controllers/Components.js +7 -15
  76. package/controllers/validation/common.js +12 -18
  77. package/controllers/validation/data-transform.js +4 -4
  78. package/controllers/validation/model-schema.js +5 -14
  79. package/controllers/validation/relations.js +8 -20
  80. package/controllers/validation/types.js +12 -35
  81. package/package.json +6 -6
  82. package/services/Components.js +4 -4
  83. package/services/ContentTypes.js +2 -1
  84. package/services/api-handler.js +5 -5
  85. package/services/schema-builder/index.js +12 -14
  86. package/services/schema-builder/schema-handler.js +5 -5
  87. package/utils/helpers.js +1 -1
@@ -21,7 +21,7 @@ const AllowedTypesSelect = ({ name, changeMediaAllowedTypes, styles, value }) =>
21
21
  ? formatMessage({ id: getTrad('form.attribute.media.allowed-types.none') })
22
22
  : value
23
23
  .sort()
24
- .map(v => upperFirst(v))
24
+ .map((v) => upperFirst(v))
25
25
  .join(', ');
26
26
 
27
27
  /* eslint-enable indent */
@@ -103,7 +103,7 @@ const AttributeOption = forwardRef(({ tabIndex, type }, ref) => {
103
103
  <Card>
104
104
  <AttributeIcon type={type} style={{ marginRight: 10 }} className="attributeIcon" />
105
105
  <FormattedMessage id={getTrad(`attribute.${type}`)}>
106
- {message => <span className="attributeType">{message}</span>}
106
+ {(message) => <span className="attributeType">{message}</span>}
107
107
  </FormattedMessage>
108
108
  <FormattedMessage id={getTrad(`attribute.${type}.description`)} />
109
109
  </Card>
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import React from 'react';
3
3
 
4
- const CTSelected = props => (
4
+ const CTSelected = (props) => (
5
5
  <svg width="60px" height="67px" viewBox="0 0 79 86" {...props}>
6
6
  <defs>
7
7
  <filter
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import React from 'react';
3
3
 
4
- const CTUnSelected = props => (
4
+ const CTUnSelected = (props) => (
5
5
  <svg width="60px" height="67px" viewBox="0 0 79 86" {...props}>
6
6
  <defs>
7
7
  <filter
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import React from 'react';
3
3
 
4
- const STSelected = props => (
4
+ const STSelected = (props) => (
5
5
  <svg width="53px" height="60px" viewBox="0 0 61 68" {...props}>
6
6
  <defs>
7
7
  <filter
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import React from 'react';
3
3
 
4
- const STUnselected = props => (
4
+ const STUnselected = (props) => (
5
5
  <svg width="53px" height="60px" viewBox="0 0 61 68" {...props}>
6
6
  <defs>
7
7
  <filter
@@ -27,7 +27,7 @@ const STHackSpan = styled.span`
27
27
  const BooleanBox = ({ label, name, onChange, onChangeCallback, options, value }) => {
28
28
  const { formatMessage } = useGlobalContext();
29
29
 
30
- const handleChange = e => {
30
+ const handleChange = (e) => {
31
31
  onChange(e);
32
32
  onChangeCallback();
33
33
  };
@@ -36,7 +36,7 @@ const BooleanBox = ({ label, name, onChange, onChangeCallback, options, value })
36
36
  <div>
37
37
  <CustomLabel htmlFor={name}>{label}</CustomLabel>
38
38
  <Wrapper>
39
- {options.map(option => (
39
+ {options.map((option) => (
40
40
  <Enumeration
41
41
  {...option}
42
42
  key={option.value}
@@ -49,7 +49,7 @@ const BooleanBox = ({ label, name, onChange, onChangeCallback, options, value })
49
49
  value={option.value}
50
50
  />
51
51
  ))}
52
- {options.map(option => {
52
+ {options.map((option) => {
53
53
  const isST = option.value === 'singleType';
54
54
  const isCT = option.value === 'collectionType';
55
55
 
@@ -32,7 +32,7 @@ function ComponentCard({ component, dzName, index, isActive, isInDevelopmentMode
32
32
  <p>{name}</p>
33
33
  <div
34
34
  className="close-btn"
35
- onClick={e => {
35
+ onClick={(e) => {
36
36
  e.stopPropagation();
37
37
  removeComponentFromDynamicZone(dzName, index);
38
38
  }}
@@ -10,12 +10,7 @@ const CellRenderer = ({ icon, name, onChange, style, value }) => {
10
10
  };
11
11
 
12
12
  return (
13
- <Cell
14
- className="cell"
15
- style={style}
16
- isSelected={isSelected}
17
- onClick={handleClick}
18
- >
13
+ <Cell className="cell" style={style} isSelected={isSelected} onClick={handleClick}>
19
14
  <FontAwesomeIcon icon={icon} />
20
15
  </Cell>
21
16
  );
@@ -15,20 +15,20 @@ import Wrapper from './Wrapper';
15
15
  const ComponentIconPicker = ({ error, isCreating, label, name, onChange, value }) => {
16
16
  const { allIcons, allComponentsIconAlreadyTaken } = useDataManager();
17
17
  const [originalIcon] = useState(value);
18
- const initialIcons = allIcons.filter(ico => {
18
+ const initialIcons = allIcons.filter((ico) => {
19
19
  if (isCreating) {
20
20
  return !allComponentsIconAlreadyTaken.includes(ico);
21
21
  }
22
22
 
23
23
  // Edition
24
- return !allComponentsIconAlreadyTaken.filter(icon => icon !== originalIcon).includes(ico);
24
+ return !allComponentsIconAlreadyTaken.filter((icon) => icon !== originalIcon).includes(ico);
25
25
  });
26
26
  const ref = useRef();
27
27
  const searchWrapperRef = useRef();
28
28
  const [showSearch, setShowSearch] = useState(false);
29
29
  const [search, setSearch] = useState('');
30
30
  const [icons, setIcons] = useState(initialIcons);
31
- const toggleSearch = () => setShowSearch(prev => !prev);
31
+ const toggleSearch = () => setShowSearch((prev) => !prev);
32
32
 
33
33
  useClickAwayListener(searchWrapperRef, () => {
34
34
  setShowSearch(false);
@@ -66,7 +66,7 @@ const ComponentIconPicker = ({ error, isCreating, label, name, onChange, value }
66
66
 
67
67
  const handleChangeSearch = ({ target: { value } }) => {
68
68
  setSearch(value);
69
- setIcons(() => initialIcons.filter(icon => icon.includes(value)));
69
+ setIcons(() => initialIcons.filter((icon) => icon.includes(value)));
70
70
  };
71
71
 
72
72
  return (
@@ -44,9 +44,7 @@ function ComponentList({
44
44
  isFromDynamicZone={isFromDynamicZone}
45
45
  isNestedInDZComponent={isNestedInDZComponent}
46
46
  isSub
47
- secondLoopComponentName={
48
- firstLoopComponentName ? componentName : null
49
- }
47
+ secondLoopComponentName={firstLoopComponentName ? componentName : null}
50
48
  secondLoopComponentUid={firstLoopComponentUid ? component : null}
51
49
  />
52
50
  </Td>
@@ -15,10 +15,8 @@ const MenuList = ({
15
15
  selectProps: { isAddingAComponentToAnotherComponent, name, onClickOption, refState, value },
16
16
  ...rest
17
17
  }) => {
18
- const {
19
- componentsGroupedByCategory,
20
- componentsThatHaveOtherComponentInTheirAttributes,
21
- } = useDataManager();
18
+ const { componentsGroupedByCategory, componentsThatHaveOtherComponentInTheirAttributes } =
19
+ useDataManager();
22
20
 
23
21
  const query = useQuery();
24
22
  const Component = components.MenuList;
@@ -31,12 +29,12 @@ const MenuList = ({
31
29
  <Ul>
32
30
  {Object.keys(componentsGroupedByCategory)
33
31
  .sort()
34
- .map(categoryName => {
32
+ .map((categoryName) => {
35
33
  return (
36
34
  <li key={categoryName}>
37
35
  <Category categoryName={categoryName} />
38
36
  <Ul style={{ marginTop: '-4px' }} maxHeight="100%">
39
- {componentsGroupedByCategory[categoryName].map(component => {
37
+ {componentsGroupedByCategory[categoryName].map((component) => {
40
38
  if (
41
39
  (isAddingAComponentToAnotherComponent &&
42
40
  componentsThatHaveOtherComponentInTheirAttributes.includes(
@@ -61,6 +59,7 @@ const MenuList = ({
61
59
  }}
62
60
  >
63
61
  <p
62
+ // eslint-disable-next-line react/no-unknown-property
64
63
  datadescr={upperFirst(component.schema.name)}
65
64
  style={{
66
65
  color: isSelected ? '#007eff' : '',
@@ -83,25 +83,25 @@ const MultipleMenuList = ({
83
83
  if (inputValue !== '') {
84
84
  // Close collapses
85
85
  Object.keys(filteredComponentsGroupedByCategory)
86
- .filter(cat => categoriesToOpen.indexOf(cat) === -1)
87
- .forEach(catName => {
88
- setCollapses(prevState => ({ ...prevState, [catName]: false }));
86
+ .filter((cat) => categoriesToOpen.indexOf(cat) === -1)
87
+ .forEach((catName) => {
88
+ setCollapses((prevState) => ({ ...prevState, [catName]: false }));
89
89
  });
90
90
 
91
- categoriesToOpen.forEach(catName => {
92
- setCollapses(prevState => ({ ...prevState, [catName]: true }));
91
+ categoriesToOpen.forEach((catName) => {
92
+ setCollapses((prevState) => ({ ...prevState, [catName]: true }));
93
93
  });
94
94
  } else {
95
95
  // Close all collapses
96
96
  categoriesToOpen.forEach((catName, index) => {
97
- setCollapses(prevState => ({ ...prevState, [catName]: index === 0 }));
97
+ setCollapses((prevState) => ({ ...prevState, [catName]: index === 0 }));
98
98
  });
99
99
  }
100
100
  // eslint-disable-next-line react-hooks/exhaustive-deps
101
101
  }, [inputValue]);
102
102
 
103
- const toggleCollapse = catName => {
104
- setCollapses(prevState => ({
103
+ const toggleCollapse = (catName) => {
104
+ setCollapses((prevState) => ({
105
105
  ...prevState,
106
106
  [catName]: !prevState[catName],
107
107
  }));
@@ -110,7 +110,7 @@ const MultipleMenuList = ({
110
110
  const Component = components.MenuList;
111
111
 
112
112
  const allComponentsCategory = Object.keys(options).reduce((acc, current) => {
113
- const categoryCompos = options[current].map(compo => {
113
+ const categoryCompos = options[current].map((compo) => {
114
114
  return compo.uid;
115
115
  });
116
116
 
@@ -119,13 +119,13 @@ const MultipleMenuList = ({
119
119
  return acc;
120
120
  }, {});
121
121
 
122
- const getCategoryValue = categoryName => {
122
+ const getCategoryValue = (categoryName) => {
123
123
  const componentsCategory = allComponentsCategory[categoryName];
124
124
 
125
125
  return hasSubArray(value.value, componentsCategory);
126
126
  };
127
127
 
128
- const doesCategoryHasSomeElements = categoryName => {
128
+ const doesCategoryHasSomeElements = (categoryName) => {
129
129
  const componentsCategory = allComponentsCategory[categoryName];
130
130
 
131
131
  return hasSomeSubArray(value.value, componentsCategory);
@@ -162,10 +162,10 @@ const MultipleMenuList = ({
162
162
  }`
163
163
  )}
164
164
  >
165
- {msg => <li style={{ paddingTop: 11 }}>{msg}</li>}
165
+ {(msg) => <li style={{ paddingTop: 11 }}>{msg}</li>}
166
166
  </FormattedMessage>
167
167
  )}
168
- {Object.keys(options).map(categoryName => {
168
+ {Object.keys(options).map((categoryName) => {
169
169
  const isChecked = getCategoryValue(categoryName);
170
170
  const someChecked = !isChecked && doesCategoryHasSomeElements(categoryName);
171
171
  const target = { name: categoryName, value: !isChecked };
@@ -195,7 +195,7 @@ const MultipleMenuList = ({
195
195
  textAlign: 'right',
196
196
  flexGrow: 2,
197
197
  }}
198
- onClick={e => {
198
+ onClick={(e) => {
199
199
  e.stopPropagation();
200
200
  toggleCollapse(categoryName);
201
201
  }}
@@ -208,7 +208,7 @@ const MultipleMenuList = ({
208
208
  </CheckboxWrapper>
209
209
  </div>
210
210
  <SubUl tag="ul" isOpen={collapses[categoryName]}>
211
- {options[categoryName].map(component => {
211
+ {options[categoryName].map((component) => {
212
212
  const isChecked = get(value, 'value', []).includes(component.uid);
213
213
  const target = { name: component.uid, value: !isChecked };
214
214
 
@@ -20,12 +20,7 @@ const Value = ({ children, ...props }) => {
20
20
  schema: { name },
21
21
  } = selectedComponent;
22
22
  const {
23
- selectProps: {
24
- componentCategory,
25
- componentName,
26
- isCreatingComponent,
27
- isMultiple,
28
- },
23
+ selectProps: { componentCategory, componentName, isCreatingComponent, isMultiple },
29
24
  } = props;
30
25
 
31
26
  const displayedCategory = isCreatingComponent ? componentCategory : category;
@@ -50,7 +45,7 @@ const Value = ({ children, ...props }) => {
50
45
  )}
51
46
  {isMultiple && (
52
47
  <FormattedMessage id={message} values={{ number: valueLength }}>
53
- {msg => <span style={style}>{msg}</span>}
48
+ {(msg) => <span style={style}>{msg}</span>}
54
49
  </FormattedMessage>
55
50
  )}
56
51
  </SingleValue>
@@ -68,10 +63,7 @@ Value.defaultProps = {
68
63
  };
69
64
 
70
65
  Value.propTypes = {
71
- children: PropTypes.oneOfType([
72
- PropTypes.string,
73
- PropTypes.arrayOf(PropTypes.string),
74
- ]),
66
+ children: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]),
75
67
  selectProps: PropTypes.shape({
76
68
  componentCategory: PropTypes.string,
77
69
  componentName: PropTypes.string,
@@ -1,5 +1,5 @@
1
1
  const hasSomeSubArray = (master, sub) => {
2
- return sub.some(v => master.indexOf(v) !== -1);
2
+ return sub.some((v) => master.indexOf(v) !== -1);
3
3
  };
4
4
 
5
5
  export default hasSomeSubArray;
@@ -1,5 +1,5 @@
1
1
  const hasSubArray = (master, sub) => {
2
- return sub.every(v => master.indexOf(v) !== -1);
2
+ return sub.every((v) => master.indexOf(v) !== -1);
3
3
  };
4
4
 
5
5
  export default hasSubArray;
@@ -20,7 +20,7 @@ const CreatableSelect = ({ onChange, name, styles, value }) => {
20
20
  };
21
21
 
22
22
  const formatOptions = () => {
23
- const options = allComponentsCategories.map(cat => ({ value: cat, label: cat }));
23
+ const options = allComponentsCategories.map((cat) => ({ value: cat, label: cat }));
24
24
 
25
25
  if (value) {
26
26
  return uniqBy(options.concat({ value, label: value }), 'value');
@@ -30,7 +30,7 @@ const CreatableSelect = ({ onChange, name, styles, value }) => {
30
30
  };
31
31
 
32
32
  const getValue = () => {
33
- return formatOptions().find(el => el.value === value);
33
+ return formatOptions().find((el) => el.value === value);
34
34
  };
35
35
 
36
36
  return (
@@ -33,7 +33,7 @@ const CustomCheckbox = ({ label, modifiedData, name, onChange, value, ...rest })
33
33
  },
34
34
  });
35
35
  }
36
- setChecked(prev => !prev);
36
+ setChecked((prev) => !prev);
37
37
  }}
38
38
  />
39
39
  {checked && (
@@ -28,7 +28,7 @@ function DynamicZoneList({
28
28
  const { isInDevelopmentMode } = useDataManager();
29
29
  const [activeTab, setActiveTab] = useState('0');
30
30
 
31
- const toggle = tab => {
31
+ const toggle = (tab) => {
32
32
  if (activeTab !== tab) {
33
33
  setActiveTab(tab);
34
34
  }
@@ -16,7 +16,7 @@ function HeaderNavLink({ custom, isDisabled, id, isActive, onClick }) {
16
16
  <Wrapper
17
17
  isActive={isActive}
18
18
  style={{ cursor: isDisabled ? 'not-allowed' : 'pointer' }}
19
- onClick={e => {
19
+ onClick={(e) => {
20
20
  if (isDisabled) {
21
21
  e.preventDefault();
22
22
 
@@ -25,9 +25,7 @@ function HeaderNavLink({ custom, isDisabled, id, isActive, onClick }) {
25
25
  onClick(id);
26
26
  }}
27
27
  >
28
- <FormattedMessage
29
- id={`${pluginId}.popUpForm.navContainer.${custom || id}`}
30
- />
28
+ <FormattedMessage id={`${pluginId}.popUpForm.navContainer.${custom || id}`} />
31
29
  </Wrapper>
32
30
  );
33
31
  }
@@ -188,7 +188,7 @@ function List({
188
188
  <Wrapper className={className} isFromDynamicZone={isFromDynamicZone}>
189
189
  <table>
190
190
  <tbody>
191
- {items.map(item => {
191
+ {items.map((item) => {
192
192
  const { type } = item;
193
193
  const CustomRow = customRowComponent;
194
194
 
@@ -10,7 +10,7 @@ function ListHeader({ actions, title }) {
10
10
  <Wrapper>
11
11
  <div className="list-header-actions">{actions}</div>
12
12
  <div className="list-header-title">
13
- {title.map(item => {
13
+ {title.map((item) => {
14
14
  return <Title key={item}>{item}&nbsp;</Title>;
15
15
  })}
16
16
  </div>
@@ -219,7 +219,7 @@ function ListRow({
219
219
  />
220
220
  &nbsp;
221
221
  <FormattedMessage id={`${pluginId}.from`}>
222
- {msg => (
222
+ {(msg) => (
223
223
  <span style={{ fontStyle: 'italic' }}>
224
224
  <UpperFist content={contentTypeFriendlyName} />
225
225
  &nbsp;
@@ -250,7 +250,7 @@ function ListRow({
250
250
  },
251
251
  {
252
252
  icon: <FontAwesomeIcon icon="trash-alt" />,
253
- onClick: e => {
253
+ onClick: (e) => {
254
254
  e.stopPropagation();
255
255
  removeAttribute(
256
256
  editTarget,
@@ -266,7 +266,7 @@ function ListRow({
266
266
  links={[
267
267
  {
268
268
  icon: <FontAwesomeIcon icon="trash-alt" />,
269
- onClick: e => {
269
+ onClick: (e) => {
270
270
  e.stopPropagation();
271
271
  removeAttribute(
272
272
  editTarget,
@@ -12,7 +12,7 @@ import Wrapper from './Wrapper';
12
12
  const DropdownInfos = ({ headers, shouldDisplaySecondHeader }) => {
13
13
  const [dropdownOpen, setDropdownOpen] = useState(false);
14
14
 
15
- const toggle = () => setDropdownOpen(prevState => !prevState);
15
+ const toggle = () => setDropdownOpen((prevState) => !prevState);
16
16
 
17
17
  return (
18
18
  <Wrapper isOpen={dropdownOpen} toggle={toggle} style={{ margin: 'auto 0' }}>
@@ -22,10 +22,7 @@ const ModalHeader = ({ headerId, headers }) => {
22
22
  {headerId && (
23
23
  <>
24
24
  <Icon type={get(headers, [0, 'icon', 'name'], '')} />
25
- <FormattedMessage
26
- id={headerId}
27
- values={{ name: get(headers, [0, 'label'], '') }}
28
- />
25
+ <FormattedMessage id={headerId} values={{ name: get(headers, [0, 'label'], '') }} />
29
26
  </>
30
27
  )}
31
28
  {!headerId &&
@@ -79,10 +76,7 @@ const ModalHeader = ({ headerId, headers }) => {
79
76
  <UpperFirst content={get(header, ['label'], '')} />
80
77
  </span>
81
78
  {header.info.category && (
82
- <ComponentInfos
83
- category={header.info.category}
84
- name={header.info.name}
85
- />
79
+ <ComponentInfos category={header.info.category} name={header.info.name} />
86
80
  )}
87
81
  </Fragment>
88
82
  );
@@ -6,15 +6,9 @@ import RelationFormBox from '../RelationFormBox';
6
6
  import RelationFormNaturePicker from '../RelationFormNaturePicker';
7
7
  import Wrapper from './Wrapper';
8
8
 
9
- const RelationForm = ({
10
- errors,
11
- mainBoxHeader,
12
- modifiedData,
13
- naturePickerType,
14
- onChange,
15
- }) => {
9
+ const RelationForm = ({ errors, mainBoxHeader, modifiedData, naturePickerType, onChange }) => {
16
10
  const { formatMessage } = useGlobalContext();
17
- const getError = name => {
11
+ const getError = (name) => {
18
12
  const errorId = get(errors, [name, 'id'], null);
19
13
 
20
14
  return isEmpty(errorId) ? null : formatMessage({ id: errorId });
@@ -35,9 +35,7 @@ const RelationFormBox = ({
35
35
  <RelationTargetPicker
36
36
  target={target}
37
37
  onChange={onChange}
38
- oneThatIsCreatingARelationWithAnother={
39
- oneThatIsCreatingARelationWithAnother
40
- }
38
+ oneThatIsCreatingARelationWithAnother={oneThatIsCreatingARelationWithAnother}
41
39
  />
42
40
  )}
43
41
  </div>
@@ -58,7 +58,7 @@ const RelationFormNaturePicker = ({
58
58
  <Wrapper>
59
59
  <div className="nature-container">
60
60
  <div className="nature-buttons">
61
- {relationsType.map(relationNature => {
61
+ {relationsType.map((relationNature) => {
62
62
  const Asset = relations[relationNature];
63
63
  const isEnabled =
64
64
  restrictedRelations === null || restrictedRelations.includes(relationNature);
@@ -14,9 +14,9 @@ const RelationTargetPicker = ({ onChange, oneThatIsCreatingARelationWithAnother,
14
14
  const allowedContentTypesForRelation = useMemo(
15
15
  () =>
16
16
  sortedContentTypesList
17
- .filter(obj => obj.kind === 'collectionType')
17
+ .filter((obj) => obj.kind === 'collectionType')
18
18
  .filter(
19
- obj =>
19
+ (obj) =>
20
20
  obj.restrictRelationsTo === null ||
21
21
  (Array.isArray(obj.restrictRelationsTo) && obj.restrictRelationsTo.length > 0)
22
22
  ),
@@ -1,7 +1,7 @@
1
1
  import styled from 'styled-components';
2
2
 
3
3
  const Ul = styled.ul`
4
- max-height: ${props => props.maxHeight};
4
+ max-height: ${(props) => props.maxHeight};
5
5
  padding: 0 15px;
6
6
  background-color: #fff;
7
7
  list-style: none;
@@ -10,7 +10,7 @@ import CreatableSelect from '../CreatableSelect';
10
10
 
11
11
  const WrapperSelect = ({ error, label, name, type, ...rest }) => {
12
12
  const styles = {
13
- container: base => ({
13
+ container: (base) => ({
14
14
  ...base,
15
15
  'z-index': 9999,
16
16
  //
@@ -25,7 +25,7 @@ const WrapperSelect = ({ error, label, name, type, ...rest }) => {
25
25
  : '1px solid #E3E9F3 !important',
26
26
  borderRadius: '2px !important',
27
27
  }),
28
- menu: base => {
28
+ menu: (base) => {
29
29
  return {
30
30
  ...base,
31
31
  padding: '0 15px',
@@ -1,15 +1,20 @@
1
1
  export const ADD_ATTRIBUTE = 'ContentTypeBuilder/DataManagerProvider/ADD_ATTRIBUTE';
2
- export const ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE = 'ContentTypeBuilder/DataManagerProvider/ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE';
2
+ export const ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE =
3
+ 'ContentTypeBuilder/DataManagerProvider/ADD_CREATED_COMPONENT_TO_DYNAMIC_ZONE';
3
4
  export const CANCEL_CHANGES = 'ContentTypeBuilder/DataManagerProvider/CANCEL_CHANGES';
4
- export const CHANGE_DYNAMIC_ZONE_COMPONENTS = 'ContentTypeBuilder/DataManagerProvider/CHANGE_DYNAMIC_ZONE_COMPONENTS';
5
+ export const CHANGE_DYNAMIC_ZONE_COMPONENTS =
6
+ 'ContentTypeBuilder/DataManagerProvider/CHANGE_DYNAMIC_ZONE_COMPONENTS';
5
7
  export const CREATE_SCHEMA = 'ContentTypeBuilder/DataManagerProvider/CREATE_SCHEMA';
6
- export const CREATE_COMPONENT_SCHEMA = 'ContentTypeBuilder/DataManagerProvider/CREATE_COMPONENT_SCHEMA';
8
+ export const CREATE_COMPONENT_SCHEMA =
9
+ 'ContentTypeBuilder/DataManagerProvider/CREATE_COMPONENT_SCHEMA';
7
10
  export const DELETE_NOT_SAVED_TYPE = 'ContentTypeBuilder/DataManagerProvider/DELETE_NOT_SAVED_TYPE';
8
11
  export const EDIT_ATTRIBUTE = 'ContentTypeBuilder/DataManagerProvider/EDIT_ATTRIBUTE';
9
12
  export const GET_DATA_SUCCEEDED = 'ContentTypeBuilder/DataManagerProvider/GET_DATA_SUCCEEDED';
10
13
  export const RELOAD_PLUGIN = 'ContentTypeBuilder/DataManagerProvider/RELOAD_PLUGIN';
11
- export const REMOVE_FIELD_FROM_DISPLAYED_COMPONENT = 'ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD_FROM_DISPLAYED_COMPONENT';
12
- export const REMOVE_COMPONENT_FROM_DYNAMIC_ZONE = 'ContentTypeBuilder/DataManagerProvider/REMOVE_COMPONENT_FROM_DYNAMIC_ZONE';
14
+ export const REMOVE_FIELD_FROM_DISPLAYED_COMPONENT =
15
+ 'ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD_FROM_DISPLAYED_COMPONENT';
16
+ export const REMOVE_COMPONENT_FROM_DYNAMIC_ZONE =
17
+ 'ContentTypeBuilder/DataManagerProvider/REMOVE_COMPONENT_FROM_DYNAMIC_ZONE';
13
18
  export const REMOVE_FIELD = 'ContentTypeBuilder/DataManagerProvider/REMOVE_FIELD';
14
19
  export const SET_MODIFIED_DATA = 'ContentTypeBuilder/DataManagerProvider/SET_MODIFIED_DATA';
15
20
  export const UPDATE_SCHEMA = 'ContentTypeBuilder/DataManagerProvider/UPDATE_SCHEMA';