@akemona-org/strapi-plugin-upload 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/components/BrowseAssets/index.js +8 -8
- package/admin/src/components/Card/index.js +1 -1
- package/admin/src/components/CardControl/index.js +1 -1
- package/admin/src/components/CardErrorMessage/index.js +1 -1
- package/admin/src/components/CardImgWrapper/index.js +1 -1
- package/admin/src/components/CardTitle/index.js +1 -1
- package/admin/src/components/CheckControl/index.js +3 -3
- package/admin/src/components/DragLayer/index.js +1 -1
- package/admin/src/components/DropdownButton/index.js +1 -1
- package/admin/src/components/Duration/utils/formatDuration.js +1 -1
- package/admin/src/components/EditForm/FileDetailsBox.js +1 -1
- package/admin/src/components/EditForm/SizeBox.js +1 -1
- package/admin/src/components/EditForm/index.js +6 -6
- package/admin/src/components/EditForm/utils/isImageType.js +1 -1
- package/admin/src/components/EditForm/utils/isVideoType.js +1 -1
- package/admin/src/components/FileIcon/index.js +1 -1
- package/admin/src/components/FiltersList/utils/formatFilter.js +1 -1
- package/admin/src/components/FiltersPicker/FiltersCard/FilterInput.js +1 -1
- package/admin/src/components/FiltersPicker/FiltersCard/index.js +2 -2
- package/admin/src/components/FiltersPicker/FiltersCard/init.js +1 -1
- package/admin/src/components/FiltersPicker/FiltersCard/reducer.js +1 -7
- package/admin/src/components/FiltersPicker/index.js +2 -2
- package/admin/src/components/FiltersPicker/utils/formatFilter.js +1 -1
- package/admin/src/components/InputFileModal/index.js +2 -2
- package/admin/src/components/InputMedia/index.js +7 -7
- package/admin/src/components/IntlText/index.js +1 -1
- package/admin/src/components/List/index.js +3 -3
- package/admin/src/components/ListEmpty/index.js +2 -2
- package/admin/src/components/ListEmpty/utils/generateRows.js +1 -1
- package/admin/src/components/ListModal/index.js +2 -2
- package/admin/src/components/ModalNavWrapper/index.js +2 -2
- package/admin/src/components/ModalTab/index.js +1 -1
- package/admin/src/components/SelectedAssets/DraggableCard.js +1 -1
- package/admin/src/components/SelectedAssets/SortableList.js +4 -4
- package/admin/src/components/SortList/Wrapper.js +1 -1
- package/admin/src/components/SortList/index.js +1 -1
- package/admin/src/components/SortListItem/Wrapper.js +1 -1
- package/admin/src/components/SortPicker/index.js +3 -3
- package/admin/src/components/UploadForm/index.js +2 -2
- package/admin/src/components/UploadList/ListTitle.js +1 -1
- package/admin/src/components/UploadList/index.js +1 -1
- package/admin/src/components/VideoPreview/index.js +2 -9
- package/admin/src/containers/HomePage/HomePageContent/index.js +4 -4
- package/admin/src/containers/HomePage/index.js +10 -10
- package/admin/src/containers/HomePage/reducer.js +11 -9
- package/admin/src/containers/HomePage/utils/generateParamsFromQuery.js +1 -1
- package/admin/src/containers/HomePage/utils/generateStringFromParams.js +2 -2
- package/admin/src/containers/HomePage/utils/getHeaderLabel.js +1 -1
- package/admin/src/containers/Initializer/index.js +1 -1
- package/admin/src/containers/InputModalStepper/InputModalStepper.js +6 -4
- package/admin/src/containers/InputModalStepper/Search.js +1 -1
- package/admin/src/containers/InputModalStepper/index.js +1 -1
- package/admin/src/containers/InputModalStepperProvider/index.js +17 -17
- package/admin/src/containers/InputModalStepperProvider/init.js +1 -1
- package/admin/src/containers/InputModalStepperProvider/reducer.js +10 -10
- package/admin/src/containers/ModalStepper/index.js +16 -15
- package/admin/src/containers/ModalStepper/init.js +1 -1
- package/admin/src/containers/ModalStepper/reducer.js +15 -18
- package/admin/src/containers/SettingsPage/init.js +1 -1
- package/admin/src/icons/BrokenFile/index.js +1 -1
- package/admin/src/icons/Cloud/index.js +1 -1
- package/admin/src/icons/DoubleFile/index.js +1 -1
- package/admin/src/icons/Download/index.js +1 -1
- package/admin/src/icons/File/index.js +1 -1
- package/admin/src/index.js +1 -1
- package/admin/src/pluginId.js +1 -1
- package/admin/src/utils/canDownloadFile.js +1 -1
- package/admin/src/utils/compactParams.js +2 -2
- package/admin/src/utils/createMatrix.js +1 -1
- package/admin/src/utils/createNewFilesToDownloadArray.js +3 -3
- package/admin/src/utils/createNewFilesToUploadArray.js +1 -1
- package/admin/src/utils/formatFileForEditing.js +1 -1
- package/admin/src/utils/formatFilters.js +1 -1
- package/admin/src/utils/getFileModelTimestamps.js +1 -1
- package/admin/src/utils/getFilesToDownload.js +2 -2
- package/admin/src/utils/getRequestUrl.js +1 -1
- package/admin/src/utils/getTrad.js +1 -1
- package/admin/src/utils/getType.js +1 -1
- package/admin/src/utils/getYupError.js +5 -8
- package/admin/src/utils/unformatBytes.js +1 -1
- package/admin/src/utils/urlYupSchema.js +1 -1
- package/config/functions/bootstrap.js +10 -8
- package/config/schema.graphql.js +2 -2
- package/errors.js +3 -3
- package/middlewares/upload/index.js +2 -2
- package/package.json +5 -5
- package/services/image-manipulation.js +11 -14
- package/utils/file.js +3 -3
|
@@ -45,7 +45,7 @@ const BrowseAssets = () => {
|
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
|
|
48
|
-
const handleDeleteFilter = index => {
|
|
48
|
+
const handleDeleteFilter = (index) => {
|
|
49
49
|
removeFilter(index);
|
|
50
50
|
};
|
|
51
51
|
|
|
@@ -61,7 +61,7 @@ const BrowseAssets = () => {
|
|
|
61
61
|
handleListCardClick(name);
|
|
62
62
|
};
|
|
63
63
|
|
|
64
|
-
const handleListCardClick = id => {
|
|
64
|
+
const handleListCardClick = (id) => {
|
|
65
65
|
if (!canSelectFile && id !== selectedFiles[0].id) {
|
|
66
66
|
handleFileSelection({
|
|
67
67
|
target: {
|
|
@@ -81,7 +81,7 @@ const BrowseAssets = () => {
|
|
|
81
81
|
/* eslint-disable react/jsx-indent */
|
|
82
82
|
const renderCardControl = noNavigation
|
|
83
83
|
? null
|
|
84
|
-
: id => {
|
|
84
|
+
: (id) => {
|
|
85
85
|
if (!allowedActions.canUpdate) {
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
@@ -92,7 +92,7 @@ const BrowseAssets = () => {
|
|
|
92
92
|
title="edit"
|
|
93
93
|
color="#9EA7B8"
|
|
94
94
|
type="pencil"
|
|
95
|
-
onClick={e => {
|
|
95
|
+
onClick={(e) => {
|
|
96
96
|
e.stopPropagation();
|
|
97
97
|
handleGoToEditFile(id);
|
|
98
98
|
}}
|
|
@@ -108,14 +108,14 @@ const BrowseAssets = () => {
|
|
|
108
108
|
_page: generatePageFromStart(start, limit),
|
|
109
109
|
};
|
|
110
110
|
|
|
111
|
-
const hasSomeCheckboxSelected = files.some(file =>
|
|
112
|
-
selectedFiles.find(selectedFile => file.id === selectedFile.id)
|
|
111
|
+
const hasSomeCheckboxSelected = files.some((file) =>
|
|
112
|
+
selectedFiles.find((selectedFile) => file.id === selectedFile.id)
|
|
113
113
|
);
|
|
114
114
|
const areAllCheckboxesSelected =
|
|
115
|
-
files.every(file => selectedFiles.find(selectedFile => file.id === selectedFile.id)) &&
|
|
115
|
+
files.every((file) => selectedFiles.find((selectedFile) => file.id === selectedFile.id)) &&
|
|
116
116
|
hasSomeCheckboxSelected;
|
|
117
117
|
|
|
118
|
-
const hasFilters = !isEmpty(params.filters.filter(filter => !filter.isDisabled));
|
|
118
|
+
const hasFilters = !isEmpty(params.filters.filter((filter) => !filter.isDisabled));
|
|
119
119
|
const hasSearch = !isEmpty(params._q);
|
|
120
120
|
const areResultsEmptyWithSearchOrFilters = isEmpty(files) && (hasSearch || hasFilters);
|
|
121
121
|
|
|
@@ -14,7 +14,7 @@ const CardControl = ({ title, color, onClick, small, type, iconStyle }) => {
|
|
|
14
14
|
const [tooltipIsDisplayed, setTooltipIsDisplayed] = useState(false);
|
|
15
15
|
|
|
16
16
|
const handleToggleTooltip = () => {
|
|
17
|
-
setTooltipIsDisplayed(prev => !prev);
|
|
17
|
+
setTooltipIsDisplayed((prev) => !prev);
|
|
18
18
|
};
|
|
19
19
|
|
|
20
20
|
return (
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Text } from '@buffetjs/core';
|
|
4
4
|
|
|
5
|
-
const ErrorMessage = styled(props => <Text {...props} color="orange" fontSize="md" ellipsis />)`
|
|
5
|
+
const ErrorMessage = styled((props) => <Text {...props} color="orange" fontSize="md" ellipsis />)`
|
|
6
6
|
margin-top: 3px;
|
|
7
7
|
`;
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Text } from '@buffetjs/core';
|
|
4
4
|
|
|
5
|
-
const Title = styled(props => (
|
|
5
|
+
const Title = styled((props) => (
|
|
6
6
|
<Text {...props} fontSize="md" fontWeight="bold" color="black" ellipsis />
|
|
7
7
|
))`
|
|
8
8
|
width: 100%;
|
|
@@ -19,20 +19,20 @@ const CheckControl = ({ title, onSubmitEdit }) => {
|
|
|
19
19
|
|
|
20
20
|
useClickAwayListener(dropdownRef, () => setIsOpen(false));
|
|
21
21
|
|
|
22
|
-
const handleClick = e => {
|
|
22
|
+
const handleClick = (e) => {
|
|
23
23
|
e.persist();
|
|
24
24
|
setIsOpen(false);
|
|
25
25
|
onSubmitEdit(e);
|
|
26
26
|
};
|
|
27
27
|
|
|
28
|
-
const handleClickDuplicate = e => {
|
|
28
|
+
const handleClickDuplicate = (e) => {
|
|
29
29
|
e.persist();
|
|
30
30
|
setIsOpen(false);
|
|
31
31
|
onSubmitEdit(e, true);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const handleToggle = () => {
|
|
35
|
-
setIsOpen(v => !v);
|
|
35
|
+
setIsOpen((v) => !v);
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
return (
|
|
@@ -24,7 +24,7 @@ function getItemStyles(initialOffset, currentOffset, mouseOffset) {
|
|
|
24
24
|
|
|
25
25
|
const DragLayer = () => {
|
|
26
26
|
const { itemType, isDragging, item, initialOffset, currentOffset, mouseOffset } = useDragLayer(
|
|
27
|
-
monitor => ({
|
|
27
|
+
(monitor) => ({
|
|
28
28
|
item: monitor.getItem(),
|
|
29
29
|
itemType: monitor.getItemType(),
|
|
30
30
|
initialOffset: monitor.getInitialSourceClientOffset(),
|
|
@@ -4,7 +4,7 @@ import PropTypes from 'prop-types';
|
|
|
4
4
|
import { themePropTypes } from 'strapi-helper-plugin';
|
|
5
5
|
import { Text } from '@buffetjs/core';
|
|
6
6
|
|
|
7
|
-
const DropdownButton = styled(props => (
|
|
7
|
+
const DropdownButton = styled((props) => (
|
|
8
8
|
<Text
|
|
9
9
|
as="button"
|
|
10
10
|
fontWeight="semiBold"
|
|
@@ -56,7 +56,7 @@ const FileDetailsBox = ({ file }) => {
|
|
|
56
56
|
|
|
57
57
|
return (
|
|
58
58
|
<Flex justifyContent="space-between" key={key}>
|
|
59
|
-
{rows.map(rowItem => {
|
|
59
|
+
{rows.map((rowItem) => {
|
|
60
60
|
return (
|
|
61
61
|
<div key={rowItem.label} style={{ width: '50%' }}>
|
|
62
62
|
<Text color="grey" fontWeight="bold" textTransform="capitalize" lineHeight="18px">
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
import { Text } from '@buffetjs/core';
|
|
4
4
|
|
|
5
|
-
const SizeBox = styled(props => <Text {...props} fontSize="md" color="white" as="div" />)`
|
|
5
|
+
const SizeBox = styled((props) => <Text {...props} fontSize="md" color="white" as="div" />)`
|
|
6
6
|
position: absolute;
|
|
7
7
|
bottom: 0;
|
|
8
8
|
right: 0;
|
|
@@ -125,7 +125,7 @@ const EditForm = forwardRef(
|
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
const handleToggleCropMode = () => {
|
|
128
|
-
setIsCropping(prev => {
|
|
128
|
+
setIsCropping((prev) => {
|
|
129
129
|
if (!prev && isEditingUploadedFile) {
|
|
130
130
|
toggleDisableForm(true);
|
|
131
131
|
}
|
|
@@ -154,7 +154,7 @@ const EditForm = forwardRef(
|
|
|
154
154
|
const canvas = cropper.current.getCroppedCanvas();
|
|
155
155
|
|
|
156
156
|
canvas.toBlob(
|
|
157
|
-
async blob => {
|
|
157
|
+
async (blob) => {
|
|
158
158
|
const {
|
|
159
159
|
file: { lastModifiedDate, lastModified, name },
|
|
160
160
|
} = fileToEdit;
|
|
@@ -212,12 +212,12 @@ const EditForm = forwardRef(
|
|
|
212
212
|
|
|
213
213
|
aRef.current.click();
|
|
214
214
|
})
|
|
215
|
-
.catch(err => {
|
|
215
|
+
.catch((err) => {
|
|
216
216
|
console.error(err);
|
|
217
217
|
});
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
const handleSubmit = e => {
|
|
220
|
+
const handleSubmit = (e) => {
|
|
221
221
|
e.preventDefault();
|
|
222
222
|
|
|
223
223
|
onSubmitEdit(e);
|
|
@@ -340,7 +340,7 @@ const EditForm = forwardRef(
|
|
|
340
340
|
{form.map(({ key, inputs }) => {
|
|
341
341
|
return (
|
|
342
342
|
<Row key={key}>
|
|
343
|
-
{inputs.map(input => {
|
|
343
|
+
{inputs.map((input) => {
|
|
344
344
|
return (
|
|
345
345
|
<div className="col-12" key={input.name}>
|
|
346
346
|
<Inputs
|
|
@@ -402,7 +402,7 @@ EditForm.defaultProps = {
|
|
|
402
402
|
onAbortUpload: () => {},
|
|
403
403
|
onChange: () => {},
|
|
404
404
|
onClickDeleteFileToUpload: () => {},
|
|
405
|
-
onSubmitEdit: e => e.preventDefault(),
|
|
405
|
+
onSubmitEdit: (e) => e.preventDefault(),
|
|
406
406
|
setCropResult: () => {},
|
|
407
407
|
toggleDisableForm: () => {},
|
|
408
408
|
};
|
|
@@ -13,7 +13,7 @@ import extensions from './utils/extensions.json';
|
|
|
13
13
|
import Wrapper from './Wrapper';
|
|
14
14
|
|
|
15
15
|
const FileIcon = ({ ext }) => {
|
|
16
|
-
const iconName = Object.keys(extensions).find(key => extensions[key].includes(ext)) || 'alt';
|
|
16
|
+
const iconName = Object.keys(extensions).find((key) => extensions[key].includes(ext)) || 'alt';
|
|
17
17
|
|
|
18
18
|
return (
|
|
19
19
|
<Wrapper type="file" colored={iconName === 'pdf'}>
|
|
@@ -2,7 +2,7 @@ import moment from 'moment';
|
|
|
2
2
|
import { dateFormats, dateToUtcTime } from 'strapi-helper-plugin';
|
|
3
3
|
import { formatBytes } from '../../../utils';
|
|
4
4
|
|
|
5
|
-
const formatFilter = filterToFormat => {
|
|
5
|
+
const formatFilter = (filterToFormat) => {
|
|
6
6
|
const { name, filter, value } = filterToFormat;
|
|
7
7
|
|
|
8
8
|
// Size filter - Convert bites to human-readable format
|
|
@@ -9,7 +9,7 @@ import { InputText, Select } from '@buffetjs/core';
|
|
|
9
9
|
import { DateTime } from '@buffetjs/custom';
|
|
10
10
|
import SizeInput from './SizeInput';
|
|
11
11
|
|
|
12
|
-
const getInputType = type => {
|
|
12
|
+
const getInputType = (type) => {
|
|
13
13
|
switch (type) {
|
|
14
14
|
case 'datetime':
|
|
15
15
|
return DateTime;
|
|
@@ -42,13 +42,13 @@ const FiltersCard = ({ onChange }) => {
|
|
|
42
42
|
const renderFiltersOptions = () => {
|
|
43
43
|
return filtersOptions.map(({ id, value }) => (
|
|
44
44
|
<FormattedMessage id={id} key={id}>
|
|
45
|
-
{msg => <option value={value}>{msg}</option>}
|
|
45
|
+
{(msg) => <option value={value}>{msg}</option>}
|
|
46
46
|
</FormattedMessage>
|
|
47
47
|
));
|
|
48
48
|
};
|
|
49
49
|
|
|
50
50
|
const renderNamesOptions = () => {
|
|
51
|
-
return Object.keys(filtersForm).map(key => {
|
|
51
|
+
return Object.keys(filtersForm).map((key) => {
|
|
52
52
|
return (
|
|
53
53
|
<option key={key} value={key}>
|
|
54
54
|
{key === 'mime' ? 'type' : key}
|
|
@@ -3,7 +3,7 @@ const init = (initialState, timestamps) => {
|
|
|
3
3
|
|
|
4
4
|
return initialState
|
|
5
5
|
.update('name', () => created_at)
|
|
6
|
-
.updateIn(['filtersForm'], object => {
|
|
6
|
+
.updateIn(['filtersForm'], (object) => {
|
|
7
7
|
return object.keySeq().reduce((acc, current) => {
|
|
8
8
|
if (current === 'created_at' && created_at !== 'created_at') {
|
|
9
9
|
return acc.set(created_at, object.get('created_at')).remove('created_at');
|
|
@@ -30,13 +30,7 @@ function reducer(state, action) {
|
|
|
30
30
|
}
|
|
31
31
|
case 'RESET_FORM':
|
|
32
32
|
return initialState
|
|
33
|
-
.set(
|
|
34
|
-
'name',
|
|
35
|
-
state
|
|
36
|
-
.get('filtersForm')
|
|
37
|
-
.keySeq()
|
|
38
|
-
.first()
|
|
39
|
-
)
|
|
33
|
+
.set('name', state.get('filtersForm').keySeq().first())
|
|
40
34
|
.update('filtersForm', () => state.get('filtersForm'));
|
|
41
35
|
default:
|
|
42
36
|
return state;
|
|
@@ -20,9 +20,9 @@ const FiltersPicker = ({ onChange }) => {
|
|
|
20
20
|
<FormattedMessage id="app.utils.filters" />
|
|
21
21
|
</>
|
|
22
22
|
)}
|
|
23
|
-
renderSectionContent={onToggle => (
|
|
23
|
+
renderSectionContent={(onToggle) => (
|
|
24
24
|
<FiltersCard
|
|
25
|
-
onChange={e => {
|
|
25
|
+
onChange={(e) => {
|
|
26
26
|
handleChange(e);
|
|
27
27
|
onToggle();
|
|
28
28
|
}}
|
|
@@ -13,7 +13,7 @@ const InputFileModal = ({ name, onChange }) => {
|
|
|
13
13
|
const { formatMessage } = useGlobalContext();
|
|
14
14
|
const ref = createRef();
|
|
15
15
|
|
|
16
|
-
const handleAllowDrop = e => e.preventDefault();
|
|
16
|
+
const handleAllowDrop = (e) => e.preventDefault();
|
|
17
17
|
|
|
18
18
|
const handleChange = ({ target: { files } }) => {
|
|
19
19
|
onChange({ target: { name, value: files } });
|
|
@@ -31,7 +31,7 @@ const InputFileModal = ({ name, onChange }) => {
|
|
|
31
31
|
setIsDragging(false);
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
-
const handleDrop = e => {
|
|
34
|
+
const handleDrop = (e) => {
|
|
35
35
|
e.preventDefault();
|
|
36
36
|
|
|
37
37
|
setIsDragging(false);
|
|
@@ -55,7 +55,7 @@ const InputMedia = ({
|
|
|
55
55
|
|
|
56
56
|
const handleClickToggleModal = () => {
|
|
57
57
|
if (!disabled) {
|
|
58
|
-
setModal(prev => ({
|
|
58
|
+
setModal((prev) => ({
|
|
59
59
|
isDisplayed: true,
|
|
60
60
|
step: 'list',
|
|
61
61
|
isOpen: !prev.isOpen,
|
|
@@ -64,13 +64,13 @@ const InputMedia = ({
|
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
|
|
67
|
-
const handleClosed = () => setModal(prev => ({ ...prev, isDisplayed: false }));
|
|
67
|
+
const handleClosed = () => setModal((prev) => ({ ...prev, isDisplayed: false }));
|
|
68
68
|
|
|
69
|
-
const handleChange = v => {
|
|
69
|
+
const handleChange = (v) => {
|
|
70
70
|
onChange({ target: { name, type, value: v } });
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const handleFilesNavigation = displayNext => {
|
|
73
|
+
const handleFilesNavigation = (displayNext) => {
|
|
74
74
|
if (attribute.multiple) {
|
|
75
75
|
if (displayNext && fileToDisplay === value.length - 1) {
|
|
76
76
|
setFileToDisplay(0);
|
|
@@ -81,7 +81,7 @@ const InputMedia = ({
|
|
|
81
81
|
if (!displayNext && fileToDisplay === 0) {
|
|
82
82
|
setFileToDisplay(value.length - 1);
|
|
83
83
|
} else {
|
|
84
|
-
setFileToDisplay(prev => (displayNext ? prev + 1 : prev - 1));
|
|
84
|
+
setFileToDisplay((prev) => (displayNext ? prev + 1 : prev - 1));
|
|
85
85
|
}
|
|
86
86
|
}
|
|
87
87
|
};
|
|
@@ -114,9 +114,9 @@ const InputMedia = ({
|
|
|
114
114
|
});
|
|
115
115
|
};
|
|
116
116
|
|
|
117
|
-
const handleAllowDrop = e => e.preventDefault();
|
|
117
|
+
const handleAllowDrop = (e) => e.preventDefault();
|
|
118
118
|
|
|
119
|
-
const handleDrop = e => {
|
|
119
|
+
const handleDrop = (e) => {
|
|
120
120
|
e.preventDefault();
|
|
121
121
|
e.persist();
|
|
122
122
|
|
|
@@ -6,7 +6,7 @@ import { Text } from '@buffetjs/core';
|
|
|
6
6
|
|
|
7
7
|
const IntlText = ({ id, defaultMessage, values, ...textProps }) => (
|
|
8
8
|
<FormattedMessage id={id} defaultMessage={defaultMessage} values={values}>
|
|
9
|
-
{msg => <Text {...textProps}>{msg}</Text>}
|
|
9
|
+
{(msg) => <Text {...textProps}>{msg}</Text>}
|
|
10
10
|
</FormattedMessage>
|
|
11
11
|
);
|
|
12
12
|
|
|
@@ -24,7 +24,7 @@ const List = ({
|
|
|
24
24
|
}) => {
|
|
25
25
|
const selectedAssets = selectedItems.length;
|
|
26
26
|
|
|
27
|
-
const handleCheckboxClick = e => {
|
|
27
|
+
const handleCheckboxClick = (e) => {
|
|
28
28
|
e.stopPropagation();
|
|
29
29
|
};
|
|
30
30
|
|
|
@@ -38,12 +38,12 @@ const List = ({
|
|
|
38
38
|
/>
|
|
39
39
|
)}
|
|
40
40
|
<ListRow>
|
|
41
|
-
{data.map(item => {
|
|
41
|
+
{data.map((item) => {
|
|
42
42
|
const { id } = item;
|
|
43
43
|
const thumbnail = get(item, ['formats', 'small'], item);
|
|
44
44
|
const isAllowed =
|
|
45
45
|
allowedTypes.length > 0 ? allowedTypes.includes(getType(item.mime)) : true;
|
|
46
|
-
const checked = selectedItems.findIndex(file => file.id === id) !== -1;
|
|
46
|
+
const checked = selectedItems.findIndex((file) => file.id === id) !== -1;
|
|
47
47
|
|
|
48
48
|
const fileUrl = prefixFileUrlWithBackendUrl(thumbnail.url);
|
|
49
49
|
|
|
@@ -21,10 +21,10 @@ const ListEmpty = ({ canCreate, hasSearchApplied, onClick, numberOfRows }) => {
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Wrapper className="container-fluid">
|
|
24
|
-
{rows.map(row => {
|
|
24
|
+
{rows.map((row) => {
|
|
25
25
|
return (
|
|
26
26
|
<div className="row" key={row.key}>
|
|
27
|
-
{row.rows.map(key => {
|
|
27
|
+
{row.rows.map((key) => {
|
|
28
28
|
return (
|
|
29
29
|
<div className="col-xs-12 col-md-6 col-xl-3" key={key}>
|
|
30
30
|
<CardEmpty />
|
|
@@ -14,7 +14,7 @@ import BaselineAlignmentWrapper from './BaselineAlignmentWrapper';
|
|
|
14
14
|
const ListModal = () => {
|
|
15
15
|
const { currentTab, goTo, handleModalTabChange, selectedFiles } = useModalContext();
|
|
16
16
|
|
|
17
|
-
const handleClick = to => {
|
|
17
|
+
const handleClick = (to) => {
|
|
18
18
|
handleModalTabChange(to);
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -53,7 +53,7 @@ const ListModal = () => {
|
|
|
53
53
|
links={links}
|
|
54
54
|
renderRightContent={renderUploadModalButton}
|
|
55
55
|
>
|
|
56
|
-
{to => (
|
|
56
|
+
{(to) => (
|
|
57
57
|
<ModalSection>
|
|
58
58
|
{to === 'browse' && <BrowseAssets />}
|
|
59
59
|
{to === 'selected' && <SelectedAssets />}
|
|
@@ -11,7 +11,7 @@ import Wrapper from './Wrapper';
|
|
|
11
11
|
const ModalNavWrapper = ({ children, links, renderRightContent, initialTab }) => {
|
|
12
12
|
const [to, setTo] = useState(initialTab || links[0].to);
|
|
13
13
|
|
|
14
|
-
const handleGoTo = link => {
|
|
14
|
+
const handleGoTo = (link) => {
|
|
15
15
|
setTo(link.to);
|
|
16
16
|
|
|
17
17
|
if (link.onClick) {
|
|
@@ -25,7 +25,7 @@ const ModalNavWrapper = ({ children, links, renderRightContent, initialTab }) =>
|
|
|
25
25
|
<BaselineAlignment />
|
|
26
26
|
<Flex justifyContent="space-between">
|
|
27
27
|
<Flex>
|
|
28
|
-
{links.map(link => {
|
|
28
|
+
{links.map((link) => {
|
|
29
29
|
const isActive = link.to === to;
|
|
30
30
|
|
|
31
31
|
return (
|
|
@@ -66,7 +66,7 @@ const DraggableCard = ({
|
|
|
66
66
|
const [{ isDragging }, drag, preview] = useDrag({
|
|
67
67
|
item: { type: ItemTypes.MEDIA_CARD, id, index, checked, url, fileType },
|
|
68
68
|
canDrag: () => isDraggable,
|
|
69
|
-
collect: monitor => ({
|
|
69
|
+
collect: (monitor) => ({
|
|
70
70
|
isDragging: monitor.isDragging(),
|
|
71
71
|
}),
|
|
72
72
|
});
|
|
@@ -18,7 +18,7 @@ const SortableList = ({
|
|
|
18
18
|
onClickEditFile,
|
|
19
19
|
selectedItems,
|
|
20
20
|
}) => {
|
|
21
|
-
const handleClick = e => {
|
|
21
|
+
const handleClick = (e) => {
|
|
22
22
|
e.stopPropagation();
|
|
23
23
|
};
|
|
24
24
|
|
|
@@ -28,9 +28,9 @@ const SortableList = ({
|
|
|
28
28
|
{data.map((item, index) => {
|
|
29
29
|
const { id } = item;
|
|
30
30
|
const url = get(item, ['formats', 'thumbnail', 'url'], item.url);
|
|
31
|
-
const checked = selectedItems.findIndex(file => file.id === id) !== -1;
|
|
31
|
+
const checked = selectedItems.findIndex((file) => file.id === id) !== -1;
|
|
32
32
|
const fileUrl = prefixFileUrlWithBackendUrl(url);
|
|
33
|
-
const handleEditClick = e => {
|
|
33
|
+
const handleEditClick = (e) => {
|
|
34
34
|
e.stopPropagation();
|
|
35
35
|
onClickEditFile(id);
|
|
36
36
|
};
|
|
@@ -62,7 +62,7 @@ const SortableList = ({
|
|
|
62
62
|
title="edit"
|
|
63
63
|
color="#9EA7B8"
|
|
64
64
|
type="pencil"
|
|
65
|
-
onClick={e => handleEditClick(e)}
|
|
65
|
+
onClick={(e) => handleEditClick(e)}
|
|
66
66
|
/>
|
|
67
67
|
</CardControlsWrapper>
|
|
68
68
|
)}
|
|
@@ -4,7 +4,7 @@ import { themePropTypes } from 'strapi-helper-plugin';
|
|
|
4
4
|
|
|
5
5
|
import { Text } from '@buffetjs/core';
|
|
6
6
|
|
|
7
|
-
const Wrapper = styled(props => <Text as="ul" fontSize="md" {...props} />)`
|
|
7
|
+
const Wrapper = styled((props) => <Text as="ul" fontSize="md" {...props} />)`
|
|
8
8
|
margin-bottom: 0;
|
|
9
9
|
padding: 0;
|
|
10
10
|
min-width: 230px;
|
|
@@ -21,17 +21,17 @@ const SortPicker = ({ onChange, value }) => {
|
|
|
21
21
|
|
|
22
22
|
return (
|
|
23
23
|
<Picker
|
|
24
|
-
renderButtonContent={isOpen => (
|
|
24
|
+
renderButtonContent={(isOpen) => (
|
|
25
25
|
<>
|
|
26
26
|
<FormattedMessage id={getTrad('sort.label')} />
|
|
27
27
|
<Carret isUp={isOpen} fill={isOpen ? '#007EFF' : '#292b2c'} />
|
|
28
28
|
</>
|
|
29
29
|
)}
|
|
30
|
-
renderSectionContent={onToggle => (
|
|
30
|
+
renderSectionContent={(onToggle) => (
|
|
31
31
|
<SortList
|
|
32
32
|
list={orders}
|
|
33
33
|
selectedItem={value}
|
|
34
|
-
onClick={e => {
|
|
34
|
+
onClick={(e) => {
|
|
35
35
|
onChange(e);
|
|
36
36
|
onToggle();
|
|
37
37
|
}}
|
|
@@ -19,7 +19,7 @@ const UploadForm = ({
|
|
|
19
19
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
20
20
|
}, []);
|
|
21
21
|
|
|
22
|
-
const handleClick = to => {
|
|
22
|
+
const handleClick = (to) => {
|
|
23
23
|
setShouldDisplayNextButton(to === 'url');
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -30,7 +30,7 @@ const UploadForm = ({
|
|
|
30
30
|
|
|
31
31
|
return (
|
|
32
32
|
<ModalNavWrapper links={links}>
|
|
33
|
-
{to => (
|
|
33
|
+
{(to) => (
|
|
34
34
|
<ModalSection>
|
|
35
35
|
{to === 'computer' && <InputFileModal onChange={addFilesToUpload} />}
|
|
36
36
|
{to === 'url' && (
|
|
@@ -3,7 +3,7 @@ import styled from 'styled-components';
|
|
|
3
3
|
|
|
4
4
|
import IntlText from '../IntlText';
|
|
5
5
|
|
|
6
|
-
const ListTitle = styled(props => <IntlText fontSize="md" fontWeight="bold" {...props} />)`
|
|
6
|
+
const ListTitle = styled((props) => <IntlText fontSize="md" fontWeight="bold" {...props} />)`
|
|
7
7
|
margin-bottom: 3px;
|
|
8
8
|
`;
|
|
9
9
|
|