@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
|
@@ -30,7 +30,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
30
30
|
const [isDraggingSibling, setIsDraggingSibling] = useState(false);
|
|
31
31
|
const { formatMessage } = useIntl();
|
|
32
32
|
const { emitEvent, updateMenu } = useGlobalContext();
|
|
33
|
-
const toggleModalForm = () => setIsModalFormOpen(prevState => !prevState);
|
|
33
|
+
const toggleModalForm = () => setIsModalFormOpen((prevState) => !prevState);
|
|
34
34
|
const { labelForm, labelToEdit, initialData, modifiedData } = reducerState.toJS();
|
|
35
35
|
const attributes = useMemo(() => {
|
|
36
36
|
return get(modifiedData, ['attributes'], {});
|
|
@@ -48,16 +48,16 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
48
48
|
const metadatas = get(modifiedData, ['metadatas'], {});
|
|
49
49
|
|
|
50
50
|
return Object.keys(metadatas)
|
|
51
|
-
.filter(key => {
|
|
51
|
+
.filter((key) => {
|
|
52
52
|
return checkIfAttributeIsDisplayable(get(attributes, key, {}));
|
|
53
53
|
})
|
|
54
|
-
.filter(field => {
|
|
54
|
+
.filter((field) => {
|
|
55
55
|
return !displayedFields.includes(field);
|
|
56
56
|
})
|
|
57
57
|
.sort();
|
|
58
58
|
}, [displayedFields, attributes, modifiedData]);
|
|
59
59
|
|
|
60
|
-
const handleClickEditLabel = labelToEdit => {
|
|
60
|
+
const handleClickEditLabel = (labelToEdit) => {
|
|
61
61
|
dispatch({
|
|
62
62
|
type: 'SET_LABEL_TO_EDIT',
|
|
63
63
|
labelToEdit,
|
|
@@ -147,7 +147,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
147
147
|
{shouldDisplaySortToggle && (
|
|
148
148
|
<div className="col-6" style={{ marginBottom: 4 }}>
|
|
149
149
|
<FormattedMessage id={`${pluginId}.form.Input.sort.field`}>
|
|
150
|
-
{label => (
|
|
150
|
+
{(label) => (
|
|
151
151
|
<Input
|
|
152
152
|
label={label}
|
|
153
153
|
type="bool"
|
|
@@ -207,7 +207,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
207
207
|
move={move}
|
|
208
208
|
name={item}
|
|
209
209
|
onClick={handleClickEditLabel}
|
|
210
|
-
onRemove={e => {
|
|
210
|
+
onRemove={(e) => {
|
|
211
211
|
e.stopPropagation();
|
|
212
212
|
|
|
213
213
|
if (displayedFields.length === 1) {
|
|
@@ -234,7 +234,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
234
234
|
isOpen={isOpen}
|
|
235
235
|
toggle={() => {
|
|
236
236
|
if (listRemainingFields.length > 0) {
|
|
237
|
-
setIsOpen(prevState => !prevState);
|
|
237
|
+
setIsOpen((prevState) => !prevState);
|
|
238
238
|
}
|
|
239
239
|
}}
|
|
240
240
|
direction="down"
|
|
@@ -246,7 +246,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
246
246
|
>
|
|
247
247
|
<Toggle disabled={listRemainingFields.length === 0} />
|
|
248
248
|
<MenuDropdown>
|
|
249
|
-
{listRemainingFields.map(item => (
|
|
249
|
+
{listRemainingFields.map((item) => (
|
|
250
250
|
<DropdownItem
|
|
251
251
|
key={item}
|
|
252
252
|
onClick={() => {
|
|
@@ -267,7 +267,7 @@ const ListSettingsView = ({ layout, slug, updateLayout }) => {
|
|
|
267
267
|
headerId={`${pluginId}.containers.ListSettingsView.modal-form.edit-label`}
|
|
268
268
|
isOpen={isModalFormOpen}
|
|
269
269
|
onClosed={handleClosed}
|
|
270
|
-
onSubmit={e => {
|
|
270
|
+
onSubmit={(e) => {
|
|
271
271
|
e.preventDefault();
|
|
272
272
|
toggleModalForm();
|
|
273
273
|
dispatch({
|
|
@@ -13,10 +13,10 @@ const reducer = (state, action) => {
|
|
|
13
13
|
|
|
14
14
|
switch (action.type) {
|
|
15
15
|
case 'ADD_FIELD':
|
|
16
|
-
return state.updateIn(layoutPath, list => list.push(action.item));
|
|
16
|
+
return state.updateIn(layoutPath, (list) => list.push(action.item));
|
|
17
17
|
|
|
18
18
|
case 'MOVE_FIELD':
|
|
19
|
-
return state.updateIn(['modifiedData', 'layouts', 'list'], list => {
|
|
19
|
+
return state.updateIn(['modifiedData', 'layouts', 'list'], (list) => {
|
|
20
20
|
return list
|
|
21
21
|
.delete(action.originalIndex)
|
|
22
22
|
.insert(action.atIndex, list.get(action.originalIndex));
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
import { themePropTypes } from 'strapi-helper-plugin';
|
|
4
4
|
import { Text } from '@buffetjs/core';
|
|
5
5
|
|
|
6
|
-
const Wrapper = styled(props => <Text as="ul" fontSize="md" {...props} />)`
|
|
6
|
+
const Wrapper = styled((props) => <Text as="ul" fontSize="md" {...props} />)`
|
|
7
7
|
margin-bottom: 0;
|
|
8
8
|
padding: 9px 0 0 0;
|
|
9
9
|
min-width: 228px;
|
|
@@ -5,13 +5,13 @@ import Wrapper from './Wrapper';
|
|
|
5
5
|
|
|
6
6
|
const Fields = ({ displayedHeaders, items, onChange }) => {
|
|
7
7
|
const getInputValue = useCallback(
|
|
8
|
-
headerName => displayedHeaders.findIndex(({ name }) => name === headerName) !== -1,
|
|
8
|
+
(headerName) => displayedHeaders.findIndex(({ name }) => name === headerName) !== -1,
|
|
9
9
|
[displayedHeaders]
|
|
10
10
|
);
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
13
|
<Wrapper>
|
|
14
|
-
{items.map(header => (
|
|
14
|
+
{items.map((header) => (
|
|
15
15
|
<Field key={header} name={header} onChange={onChange} value={getInputValue(header)} />
|
|
16
16
|
))}
|
|
17
17
|
</Wrapper>
|
|
@@ -13,7 +13,7 @@ const FieldPicker = ({ displayedHeaders, items, onChange, onClickReset, slug })
|
|
|
13
13
|
<Wrapper>
|
|
14
14
|
<Picker
|
|
15
15
|
position="right"
|
|
16
|
-
renderButtonContent={isOpen => (
|
|
16
|
+
renderButtonContent={(isOpen) => (
|
|
17
17
|
<Flex>
|
|
18
18
|
<div>
|
|
19
19
|
<FontAwesomeIcon icon="cog" style={{ marginRight: 5 }} />
|
|
@@ -23,7 +23,7 @@ const FieldPicker = ({ displayedHeaders, items, onChange, onClickReset, slug })
|
|
|
23
23
|
</Padded>
|
|
24
24
|
</Flex>
|
|
25
25
|
)}
|
|
26
|
-
renderSectionContent={onToggle => (
|
|
26
|
+
renderSectionContent={(onToggle) => (
|
|
27
27
|
<>
|
|
28
28
|
<ConfigureLink slug={slug} />
|
|
29
29
|
<Header onClick={onClickReset} onToggle={onToggle} />
|
|
@@ -36,10 +36,7 @@ function Filter({
|
|
|
36
36
|
format = dateFormats.datetime;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
displayedValue = moment
|
|
40
|
-
.parseZone(date)
|
|
41
|
-
.utc()
|
|
42
|
-
.format(format);
|
|
39
|
+
displayedValue = moment.parseZone(date).utc().format(format);
|
|
43
40
|
}
|
|
44
41
|
const displayedName = name.split('.')[0];
|
|
45
42
|
|
|
@@ -78,7 +78,7 @@ export function toggleModalDelete() {
|
|
|
78
78
|
};
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
export const setLayout = contentType => {
|
|
81
|
+
export const setLayout = (contentType) => {
|
|
82
82
|
const { layouts } = contentType;
|
|
83
83
|
|
|
84
84
|
return {
|
|
@@ -88,4 +88,4 @@ export const setLayout = contentType => {
|
|
|
88
88
|
};
|
|
89
89
|
};
|
|
90
90
|
|
|
91
|
-
export const onChangeListHeaders = target => ({ type: ON_CHANGE_LIST_HEADERS, target });
|
|
91
|
+
export const onChangeListHeaders = (target) => ({ type: ON_CHANGE_LIST_HEADERS, target });
|
|
@@ -114,9 +114,10 @@ function ListView({
|
|
|
114
114
|
|
|
115
115
|
const label = contentType.info.label;
|
|
116
116
|
|
|
117
|
-
const firstSortableHeader = useMemo(
|
|
118
|
-
displayedHeaders,
|
|
119
|
-
|
|
117
|
+
const firstSortableHeader = useMemo(
|
|
118
|
+
() => getFirstSortableHeader(displayedHeaders),
|
|
119
|
+
[displayedHeaders]
|
|
120
|
+
);
|
|
120
121
|
|
|
121
122
|
useEffect(() => {
|
|
122
123
|
setFilterPickerState(false);
|
|
@@ -197,7 +198,7 @@ function ListView({
|
|
|
197
198
|
let trackerProperty = {};
|
|
198
199
|
|
|
199
200
|
if (hasDraftAndPublish) {
|
|
200
|
-
const dataToDelete = data.find(obj => obj.id.toString() === idToDelete.toString());
|
|
201
|
+
const dataToDelete = data.find((obj) => obj.id.toString() === idToDelete.toString());
|
|
201
202
|
const isDraftEntry = isEmpty(dataToDelete.published_at);
|
|
202
203
|
const status = isDraftEntry ? 'draft' : 'published';
|
|
203
204
|
|
|
@@ -261,7 +262,7 @@ function ListView({
|
|
|
261
262
|
};
|
|
262
263
|
}, [canRead, getData, slug, params, getDataSucceeded, fetchData]);
|
|
263
264
|
|
|
264
|
-
const handleClickDelete = id => {
|
|
265
|
+
const handleClickDelete = (id) => {
|
|
265
266
|
setIdToDelete(id);
|
|
266
267
|
toggleModalDelete();
|
|
267
268
|
};
|
|
@@ -275,7 +276,7 @@ function ListView({
|
|
|
275
276
|
}, [fetchData, didDeleteData, slug, params]);
|
|
276
277
|
|
|
277
278
|
const toggleFilterPickerState = useCallback(() => {
|
|
278
|
-
setFilterPickerState(prevState => {
|
|
279
|
+
setFilterPickerState((prevState) => {
|
|
279
280
|
if (!prevState) {
|
|
280
281
|
emitEventRef.current('willFilterEntries');
|
|
281
282
|
}
|
|
@@ -341,7 +342,7 @@ function ListView({
|
|
|
341
342
|
};
|
|
342
343
|
}, [total, headerAction, label, canRead, formatMessage]);
|
|
343
344
|
|
|
344
|
-
const handleToggleModalDeleteAll = e => {
|
|
345
|
+
const handleToggleModalDeleteAll = (e) => {
|
|
345
346
|
emitEventRef.current('willBulkDeleteEntries');
|
|
346
347
|
toggleModalDeleteAll(e);
|
|
347
348
|
};
|
|
@@ -39,7 +39,7 @@ export const initialState = {
|
|
|
39
39
|
|
|
40
40
|
const listViewReducer = (state = initialState, action) =>
|
|
41
41
|
// eslint-disable-next-line consistent-return
|
|
42
|
-
produce(state, drafState => {
|
|
42
|
+
produce(state, (drafState) => {
|
|
43
43
|
switch (action.type) {
|
|
44
44
|
case GET_DATA: {
|
|
45
45
|
return {
|
|
@@ -57,10 +57,10 @@ const listViewReducer = (state = initialState, action) =>
|
|
|
57
57
|
break;
|
|
58
58
|
}
|
|
59
59
|
case ON_CHANGE_BULK: {
|
|
60
|
-
const hasElement = state.entriesToDelete.some(el => el === action.name);
|
|
60
|
+
const hasElement = state.entriesToDelete.some((el) => el === action.name);
|
|
61
61
|
|
|
62
62
|
if (hasElement) {
|
|
63
|
-
drafState.entriesToDelete = drafState.entriesToDelete.filter(el => el !== action.name);
|
|
63
|
+
drafState.entriesToDelete = drafState.entriesToDelete.filter((el) => el !== action.name);
|
|
64
64
|
break;
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -74,7 +74,7 @@ const listViewReducer = (state = initialState, action) =>
|
|
|
74
74
|
break;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
drafState.data.forEach(value => {
|
|
77
|
+
drafState.data.forEach((value) => {
|
|
78
78
|
drafState.entriesToDelete.push(value.id.toString());
|
|
79
79
|
});
|
|
80
80
|
|
|
@@ -109,7 +109,7 @@ const listViewReducer = (state = initialState, action) =>
|
|
|
109
109
|
}
|
|
110
110
|
} else {
|
|
111
111
|
drafState.displayedHeaders = state.displayedHeaders.filter(
|
|
112
|
-
header => header.name !== name
|
|
112
|
+
(header) => header.name !== name
|
|
113
113
|
);
|
|
114
114
|
}
|
|
115
115
|
|
|
@@ -5,7 +5,7 @@ import { initialState } from './reducer';
|
|
|
5
5
|
/**
|
|
6
6
|
* Direct selector to the listView state domain
|
|
7
7
|
*/
|
|
8
|
-
const listViewDomain = () => state => state.get(`${pluginId}_listView`) || initialState;
|
|
8
|
+
const listViewDomain = () => (state) => state.get(`${pluginId}_listView`) || initialState;
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Other specific selectors
|
|
@@ -16,7 +16,7 @@ const listViewDomain = () => state => state.get(`${pluginId}_listView`) || initi
|
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
18
|
const makeSelectListView = () =>
|
|
19
|
-
createSelector(listViewDomain(), substate => {
|
|
19
|
+
createSelector(listViewDomain(), (substate) => {
|
|
20
20
|
return substate;
|
|
21
21
|
});
|
|
22
22
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { checkIfAttributeIsDisplayable } from '../../../utils';
|
|
2
2
|
|
|
3
|
-
const getAllAllowedHeaders = attributes => {
|
|
3
|
+
const getAllAllowedHeaders = (attributes) => {
|
|
4
4
|
const allowedAttributes = Object.keys(attributes).reduce((acc, current) => {
|
|
5
5
|
const attribute = attributes[current];
|
|
6
6
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { get } from 'lodash';
|
|
2
2
|
|
|
3
|
-
const getFirstSortableHeader = headers => {
|
|
4
|
-
const matched = headers.find(header => header.metadatas.sortable === true);
|
|
3
|
+
const getFirstSortableHeader = (headers) => {
|
|
4
|
+
const matched = headers.find((header) => header.metadatas.sortable === true);
|
|
5
5
|
const fieldName = get(matched, 'name', 'id');
|
|
6
6
|
|
|
7
7
|
if (get(matched, 'fieldSchema.type', '') === 'relation') {
|
|
@@ -5,7 +5,7 @@ import isEqual from 'react-fast-compare';
|
|
|
5
5
|
import ListView from '../ListView';
|
|
6
6
|
import { generatePermissionsObject } from '../../utils';
|
|
7
7
|
|
|
8
|
-
const Permissions = props => {
|
|
8
|
+
const Permissions = (props) => {
|
|
9
9
|
const viewPermissions = useMemo(() => generatePermissionsObject(props.slug), [props.slug]);
|
|
10
10
|
const { isLoading, allowedActions } = useUserPermissions(viewPermissions, props.permissions);
|
|
11
11
|
|
|
@@ -4,9 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import ListViewContext from '../../contexts/ListView';
|
|
5
5
|
|
|
6
6
|
function ListViewProvider({ children, ...rest }) {
|
|
7
|
-
return
|
|
8
|
-
<ListViewContext.Provider value={rest}>{children}</ListViewContext.Provider>
|
|
9
|
-
);
|
|
7
|
+
return <ListViewContext.Provider value={rest}>{children}</ListViewContext.Provider>;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
ListViewProvider.propTypes = {
|
|
@@ -26,12 +26,12 @@ function Main({ getData, getDataSucceeded, isLoading, resetProps }) {
|
|
|
26
26
|
const abortController = new AbortController();
|
|
27
27
|
const { signal } = abortController;
|
|
28
28
|
|
|
29
|
-
const fetchData = async signal => {
|
|
29
|
+
const fetchData = async (signal) => {
|
|
30
30
|
getData();
|
|
31
31
|
|
|
32
32
|
try {
|
|
33
33
|
const [{ data: components }, { data: models }] = await Promise.all(
|
|
34
|
-
['components', 'content-types'].map(endPoint =>
|
|
34
|
+
['components', 'content-types'].map((endPoint) =>
|
|
35
35
|
request(getRequestUrl(endPoint), { method: 'GET', signal })
|
|
36
36
|
)
|
|
37
37
|
);
|
|
@@ -2,12 +2,12 @@ import { createSelector } from 'reselect';
|
|
|
2
2
|
import pluginId from '../../pluginId';
|
|
3
3
|
import { initialState } from './reducer';
|
|
4
4
|
|
|
5
|
-
const selectMainDomain = () => state => {
|
|
5
|
+
const selectMainDomain = () => (state) => {
|
|
6
6
|
return state.get(`${pluginId}_main`) || initialState;
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const makeSelectMain = () =>
|
|
10
|
-
createSelector(selectMainDomain(), substate => {
|
|
10
|
+
createSelector(selectMainDomain(), (substate) => {
|
|
11
11
|
return substate;
|
|
12
12
|
});
|
|
13
13
|
|
|
@@ -12,7 +12,7 @@ export const initialState = {
|
|
|
12
12
|
|
|
13
13
|
const rbacManagerReducer = (state = initialState, action) =>
|
|
14
14
|
// eslint-disable-next-line consistent-return
|
|
15
|
-
produce(state, draftState => {
|
|
15
|
+
produce(state, (draftState) => {
|
|
16
16
|
switch (action.type) {
|
|
17
17
|
case SET_PERMISSIONS: {
|
|
18
18
|
draftState.permissions = Object.entries(action.permissions).reduce((acc, current) => {
|
|
@@ -33,16 +33,11 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
33
33
|
const searchToSend = buildQueryString(query);
|
|
34
34
|
|
|
35
35
|
const dispatch = useDispatch();
|
|
36
|
-
const {
|
|
37
|
-
|
|
38
|
-
contentTypeDataStructure,
|
|
39
|
-
data,
|
|
40
|
-
isLoading,
|
|
41
|
-
status,
|
|
42
|
-
} = useSelector(selectCrudReducer);
|
|
36
|
+
const { componentsDataStructure, contentTypeDataStructure, data, isLoading, status } =
|
|
37
|
+
useSelector(selectCrudReducer);
|
|
43
38
|
|
|
44
39
|
const cleanReceivedData = useCallback(
|
|
45
|
-
data => {
|
|
40
|
+
(data) => {
|
|
46
41
|
const cleaned = removePasswordFieldsFromData(
|
|
47
42
|
data,
|
|
48
43
|
allLayoutData.contentType,
|
|
@@ -95,7 +90,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
95
90
|
const abortController = new AbortController();
|
|
96
91
|
const { signal } = abortController;
|
|
97
92
|
|
|
98
|
-
const fetchData = async signal => {
|
|
93
|
+
const fetchData = async (signal) => {
|
|
99
94
|
dispatch(getData());
|
|
100
95
|
|
|
101
96
|
setIsCreatingEntry(true);
|
|
@@ -134,7 +129,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
134
129
|
return () => abortController.abort();
|
|
135
130
|
}, [cleanReceivedData, push, slug, dispatch, searchToSend, rawQuery]);
|
|
136
131
|
|
|
137
|
-
const displayErrors = useCallback(err => {
|
|
132
|
+
const displayErrors = useCallback((err) => {
|
|
138
133
|
const errorPayload = err.response.payload;
|
|
139
134
|
console.error(errorPayload);
|
|
140
135
|
|
|
@@ -151,7 +146,7 @@ const SingleTypeFormWrapper = ({ allLayoutData, children, slug }) => {
|
|
|
151
146
|
}, []);
|
|
152
147
|
|
|
153
148
|
const onDelete = useCallback(
|
|
154
|
-
async trackerProperty => {
|
|
149
|
+
async (trackerProperty) => {
|
|
155
150
|
try {
|
|
156
151
|
emitEventRef.current('willDeleteEntry', trackerProperty);
|
|
157
152
|
|
|
@@ -4,9 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import WysiwygContext from '../../contexts/Wysiwyg';
|
|
5
5
|
|
|
6
6
|
function WysiwygProvider({ children, ...rest }) {
|
|
7
|
-
return
|
|
8
|
-
<WysiwygContext.Provider value={rest}>{children}</WysiwygContext.Provider>
|
|
9
|
-
);
|
|
7
|
+
return <WysiwygContext.Provider value={rest}>{children}</WysiwygContext.Provider>;
|
|
10
8
|
}
|
|
11
9
|
|
|
12
10
|
WysiwygProvider.propTypes = {
|
|
@@ -5,10 +5,10 @@ import formatLayouts from './utils/formatLayouts';
|
|
|
5
5
|
import reducer, { initialState } from './reducer';
|
|
6
6
|
import { makeSelectModelAndComponentSchemas } from '../../containers/Main/selectors';
|
|
7
7
|
|
|
8
|
-
const useFetchContentTypeLayout = contentTypeUID => {
|
|
8
|
+
const useFetchContentTypeLayout = (contentTypeUID) => {
|
|
9
9
|
const [{ error, isLoading, layout, layouts }, dispatch] = useReducer(reducer, initialState);
|
|
10
10
|
const schemasSelector = useMemo(makeSelectModelAndComponentSchemas, []);
|
|
11
|
-
const { schemas } = useSelector(state => schemasSelector(state), shallowEqual);
|
|
11
|
+
const { schemas } = useSelector((state) => schemasSelector(state), shallowEqual);
|
|
12
12
|
const isMounted = useRef(true);
|
|
13
13
|
|
|
14
14
|
const getData = useCallback(
|
|
@@ -63,7 +63,7 @@ const useFetchContentTypeLayout = contentTypeUID => {
|
|
|
63
63
|
}, [contentTypeUID, getData]);
|
|
64
64
|
|
|
65
65
|
const updateLayout = useCallback(
|
|
66
|
-
newLayout => {
|
|
66
|
+
(newLayout) => {
|
|
67
67
|
dispatch({
|
|
68
68
|
type: 'UPDATE_LAYOUT',
|
|
69
69
|
newLayout: formatLayouts({ contentType: newLayout, components: {} }, schemas),
|
|
@@ -2,7 +2,7 @@ import { cloneDeep, get, set } from 'lodash';
|
|
|
2
2
|
import { mergeMetasWithSchema } from '../../../utils';
|
|
3
3
|
import pluginId from '../../../pluginId';
|
|
4
4
|
|
|
5
|
-
const getRelationModel = (targetModel, models) => models.find(model => model.uid === targetModel);
|
|
5
|
+
const getRelationModel = (targetModel, models) => models.find((model) => model.uid === targetModel);
|
|
6
6
|
|
|
7
7
|
// editRelations is an array of strings...
|
|
8
8
|
const formatEditRelationsLayoutWithMetas = (contentTypeConfiguration, models) => {
|
|
@@ -47,7 +47,7 @@ const formatLayouts = (initialData, models) => {
|
|
|
47
47
|
set(data, ['contentType', 'layouts', 'editRelations'], formattedEditRelationsLayout);
|
|
48
48
|
set(data, ['contentType', 'layouts', 'list'], formattedListLayout);
|
|
49
49
|
|
|
50
|
-
Object.keys(data.components).forEach(compoUID => {
|
|
50
|
+
Object.keys(data.components).forEach((compoUID) => {
|
|
51
51
|
const formattedCompoEditLayout = formatLayoutWithMetas(
|
|
52
52
|
data.components[compoUID],
|
|
53
53
|
ctUid,
|
|
@@ -64,7 +64,7 @@ const createMetasSchema = (initialData, models) => {
|
|
|
64
64
|
const data = mergeMetasWithSchema(cloneDeep(initialData), models, 'contentType');
|
|
65
65
|
const { components, contentType } = data;
|
|
66
66
|
|
|
67
|
-
const formatMetadatas = targetSchema => {
|
|
67
|
+
const formatMetadatas = (targetSchema) => {
|
|
68
68
|
return Object.keys(targetSchema.metadatas).reduce((acc, current) => {
|
|
69
69
|
const schema = get(targetSchema, ['attributes', current], {});
|
|
70
70
|
let metadatas = targetSchema.metadatas[current];
|
|
@@ -97,7 +97,7 @@ const createMetasSchema = (initialData, models) => {
|
|
|
97
97
|
|
|
98
98
|
set(data, ['contentType', 'metadatas'], formatMetadatas(contentType));
|
|
99
99
|
|
|
100
|
-
Object.keys(components).forEach(compoUID => {
|
|
100
|
+
Object.keys(components).forEach((compoUID) => {
|
|
101
101
|
const currentCompo = components[compoUID];
|
|
102
102
|
const updatedMetas = formatMetadatas(currentCompo);
|
|
103
103
|
|
|
@@ -109,7 +109,7 @@ const createMetasSchema = (initialData, models) => {
|
|
|
109
109
|
|
|
110
110
|
const formatLayoutWithMetas = (contentTypeConfiguration, ctUid, models) => {
|
|
111
111
|
const formatted = contentTypeConfiguration.layouts.edit.reduce((acc, current) => {
|
|
112
|
-
const row = current.map(attribute => {
|
|
112
|
+
const row = current.map((attribute) => {
|
|
113
113
|
const fieldSchema = get(contentTypeConfiguration, ['attributes', attribute.name], {});
|
|
114
114
|
|
|
115
115
|
const data = {
|
|
@@ -147,7 +147,7 @@ const formatLayoutWithMetas = (contentTypeConfiguration, ctUid, models) => {
|
|
|
147
147
|
return formatted;
|
|
148
148
|
};
|
|
149
149
|
|
|
150
|
-
const formatListLayoutWithMetas = contentTypeConfiguration => {
|
|
150
|
+
const formatListLayoutWithMetas = (contentTypeConfiguration) => {
|
|
151
151
|
const formatted = contentTypeConfiguration.layouts.list.reduce((acc, current) => {
|
|
152
152
|
const fieldSchema = get(contentTypeConfiguration, ['attributes', current], {});
|
|
153
153
|
const metadatas = get(contentTypeConfiguration, ['metadatas', current, 'list'], {});
|
|
@@ -221,8 +221,8 @@ const generateRelationQueryInfosForComponents = (
|
|
|
221
221
|
return queryInfos;
|
|
222
222
|
};
|
|
223
223
|
|
|
224
|
-
const getDisplayedModels = models =>
|
|
225
|
-
models.filter(model => model.isDisplayed).map(({ uid }) => uid);
|
|
224
|
+
const getDisplayedModels = (models) =>
|
|
225
|
+
models.filter((model) => model.isDisplayed).map(({ uid }) => uid);
|
|
226
226
|
|
|
227
227
|
export default formatLayouts;
|
|
228
228
|
export {
|
|
@@ -3,7 +3,7 @@ import { useQueryParams } from 'strapi-helper-plugin';
|
|
|
3
3
|
import selectMenuLinks from './selectors';
|
|
4
4
|
import getRedirectionLink from './utils/getRedirectionLink';
|
|
5
5
|
|
|
6
|
-
const useFindRedirectionLink = slug => {
|
|
6
|
+
const useFindRedirectionLink = (slug) => {
|
|
7
7
|
const [{ rawQuery }] = useQueryParams();
|
|
8
8
|
const collectionTypesMenuLinks = useSelector(selectMenuLinks);
|
|
9
9
|
const redirectionLink = getRedirectionLink(collectionTypesMenuLinks, slug, rawQuery);
|
|
@@ -3,12 +3,7 @@ import PropTypes from 'prop-types';
|
|
|
3
3
|
|
|
4
4
|
const Cross = ({ fill, height, width, ...rest }) => {
|
|
5
5
|
return (
|
|
6
|
-
<svg
|
|
7
|
-
{...rest}
|
|
8
|
-
width={width}
|
|
9
|
-
height={height}
|
|
10
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
11
|
-
>
|
|
6
|
+
<svg {...rest} width={width} height={height} xmlns="http://www.w3.org/2000/svg">
|
|
12
7
|
<path
|
|
13
8
|
d="M7.78 6.72L5.06 4l2.72-2.72a.748.748 0 0 0 0-1.06.748.748 0 0 0-1.06 0L4 2.94 1.28.22a.748.748 0 0 0-1.06 0 .748.748 0 0 0 0 1.06L2.94 4 .22 6.72a.748.748 0 0 0 0 1.06.748.748 0 0 0 1.06 0L4 5.06l2.72 2.72a.748.748 0 0 0 1.06 0 .752.752 0 0 0 0-1.06z"
|
|
14
9
|
fill={fill}
|
|
@@ -1,31 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
|
|
4
|
-
const Na = ({
|
|
5
|
-
fill,
|
|
6
|
-
fontFamily,
|
|
7
|
-
fontSize,
|
|
8
|
-
fontWeight,
|
|
9
|
-
height,
|
|
10
|
-
textFill,
|
|
11
|
-
width,
|
|
12
|
-
...rest
|
|
13
|
-
}) => {
|
|
4
|
+
const Na = ({ fill, fontFamily, fontSize, fontWeight, height, textFill, width, ...rest }) => {
|
|
14
5
|
return (
|
|
15
|
-
<svg
|
|
16
|
-
{...rest}
|
|
17
|
-
width={width}
|
|
18
|
-
height={height}
|
|
19
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
20
|
-
>
|
|
6
|
+
<svg {...rest} width={width} height={height} xmlns="http://www.w3.org/2000/svg">
|
|
21
7
|
<g fill="none" fillRule="evenodd">
|
|
22
8
|
<rect fill={fill} width={width} height={height} rx="17.5" />
|
|
23
|
-
<text
|
|
24
|
-
fontFamily={fontFamily}
|
|
25
|
-
fontSize={fontSize}
|
|
26
|
-
fontWeight={fontWeight}
|
|
27
|
-
fill={textFill}
|
|
28
|
-
>
|
|
9
|
+
<text fontFamily={fontFamily} fontSize={fontSize} fontWeight={fontWeight} fill={textFill}>
|
|
29
10
|
<tspan x="6" y="22">
|
|
30
11
|
N/A
|
|
31
12
|
</tspan>
|
package/admin/src/index.js
CHANGED
|
@@ -15,7 +15,7 @@ import lifecycles from './lifecycles';
|
|
|
15
15
|
import reducers from './reducers';
|
|
16
16
|
import trads from './translations';
|
|
17
17
|
|
|
18
|
-
export default strapi => {
|
|
18
|
+
export default (strapi) => {
|
|
19
19
|
const pluginDescription = pluginPkg.strapi.description || pluginPkg.description;
|
|
20
20
|
const plugin = {
|
|
21
21
|
blockerComponent: null,
|
package/admin/src/pluginId.js
CHANGED
package/admin/src/selectors.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import pluginId from './pluginId';
|
|
2
2
|
|
|
3
|
-
export const selectPermissions = state => state.get(`${pluginId}_rbacManager`).permissions;
|
|
3
|
+
export const selectPermissions = (state) => state.get(`${pluginId}_rbacManager`).permissions;
|
|
4
4
|
|
|
5
|
-
export const selectCollectionTypePermissions = state =>
|
|
5
|
+
export const selectCollectionTypePermissions = (state) =>
|
|
6
6
|
state.get('permissionsManager').collectionTypesRelatedPermissions;
|