@griddo/ax 1.57.9 → 1.57.13
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/package.json +7 -3
- package/src/components/Fields/FileField/FileDragAndDrop/style.tsx +5 -5
- package/src/components/Fields/FileField/style.tsx +2 -2
- package/src/components/Fields/index.tsx +8 -0
- package/src/components/Gallery/GalleryPanel/GalleryDragAndDrop/index.tsx +11 -20
- package/src/components/Gallery/index.tsx +4 -1
- package/src/components/Modal/style.tsx +1 -0
- package/src/containers/Gallery/actions.tsx +5 -5
- package/src/modules/Sites/SitesList/SiteModal/style.tsx +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@griddo/ax",
|
|
3
3
|
"description": "Griddo Author Experience",
|
|
4
|
-
"version": "1.57.
|
|
4
|
+
"version": "1.57.13",
|
|
5
5
|
"authors": [
|
|
6
6
|
"Álvaro Sánchez' <alvaro.sanches@secuoyas.com>",
|
|
7
7
|
"Carlos Torres <carlos.torres@secuoyas.com>",
|
|
@@ -99,11 +99,12 @@
|
|
|
99
99
|
"optimize-css-assets-webpack-plugin": "^6.0.1",
|
|
100
100
|
"pkg-dir": "^5.0.0",
|
|
101
101
|
"polished": "3.4.1",
|
|
102
|
+
"postcss": "^8.4.5",
|
|
102
103
|
"postcss-flexbugs-fixes": "4.1.0",
|
|
103
104
|
"postcss-loader": "3.0.0",
|
|
104
105
|
"postcss-normalize": "7.0.1",
|
|
105
106
|
"postcss-preset-env": "6.7.0",
|
|
106
|
-
"postcss-safe-parser": "
|
|
107
|
+
"postcss-safe-parser": "^6.0.0",
|
|
107
108
|
"react": "^18.0.0-rc.0-next-3b3daf557-20211210",
|
|
108
109
|
"react-app-polyfill": "^1.0.4",
|
|
109
110
|
"react-datepicker": "^3.2.2",
|
|
@@ -156,6 +157,9 @@
|
|
|
156
157
|
"prettier": "^2.3.0",
|
|
157
158
|
"react-test-render": "1.1.2"
|
|
158
159
|
},
|
|
160
|
+
"resolutions": {
|
|
161
|
+
"react-error-overlay": "6.0.9"
|
|
162
|
+
},
|
|
159
163
|
"babel": {
|
|
160
164
|
"presets": [
|
|
161
165
|
"react-app",
|
|
@@ -237,5 +241,5 @@
|
|
|
237
241
|
"publishConfig": {
|
|
238
242
|
"access": "public"
|
|
239
243
|
},
|
|
240
|
-
"gitHead": "
|
|
244
|
+
"gitHead": "6e011bce3d0578bfa5be5639fecf513689b3e22a"
|
|
241
245
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import Button from "@ax/components/Button";
|
|
3
3
|
|
|
4
4
|
export const Wrapper = styled.div`
|
|
5
5
|
background-color: ${(p) => p.theme.color.uiBarBackground};
|
|
@@ -56,28 +56,28 @@ export const UploadingStatus = styled.div`
|
|
|
56
56
|
|
|
57
57
|
export const SuccessStatus = styled.div`
|
|
58
58
|
transition: opacity 0.1s;
|
|
59
|
-
${DragIcon} {
|
|
59
|
+
${DragIcon as any} {
|
|
60
60
|
svg {
|
|
61
61
|
path {
|
|
62
62
|
fill: ${(p) => p.theme.color.online};
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
${DragTitle} {
|
|
66
|
+
${DragTitle as any} {
|
|
67
67
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
68
68
|
}
|
|
69
69
|
`;
|
|
70
70
|
|
|
71
71
|
export const ErrorStatus = styled.div`
|
|
72
72
|
transition: opacity 0.1s;
|
|
73
|
-
${DragIcon} {
|
|
73
|
+
${DragIcon as any} {
|
|
74
74
|
svg {
|
|
75
75
|
path {
|
|
76
76
|
fill: ${(p) => p.theme.color.error};
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
${DragTitle} {
|
|
80
|
+
${DragTitle as any} {
|
|
81
81
|
color: ${(p) => p.theme.color.textHighEmphasis};
|
|
82
82
|
}
|
|
83
83
|
`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import styled from "styled-components";
|
|
2
|
-
import
|
|
2
|
+
import ActionMenu from "@ax/components/ActionMenu";
|
|
3
3
|
|
|
4
4
|
const Field = styled.div`
|
|
5
5
|
display: flex;
|
|
@@ -79,7 +79,7 @@ const Component = styled.span`
|
|
|
79
79
|
cursor: pointer;
|
|
80
80
|
:hover {
|
|
81
81
|
background-color: ${(p) => p.theme.colors.overlayHoverPrimary};
|
|
82
|
-
${StyledActionMenu} {
|
|
82
|
+
${StyledActionMenu as any} {
|
|
83
83
|
opacity: 1;
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -3,15 +3,19 @@ import AsyncCheckGroup from "./AsyncCheckGroup";
|
|
|
3
3
|
import AsyncSelect from "./AsyncSelect";
|
|
4
4
|
import CheckField from "./CheckField";
|
|
5
5
|
import CheckGroup from "./CheckGroup";
|
|
6
|
+
import ColorPicker from "./ColorPicker";
|
|
6
7
|
import ComponentArray from "./ComponentArray";
|
|
7
8
|
import ComponentContainer from "./ComponentContainer";
|
|
8
9
|
import ConditionalField from "./ConditionalField";
|
|
9
10
|
import DateField from "./DateField";
|
|
10
11
|
import FieldGroup from "./FieldGroup";
|
|
11
12
|
import FieldsDivider from "./FieldsDivider";
|
|
13
|
+
import FileField from "./FileField";
|
|
12
14
|
import HeadingField from "./HeadingField";
|
|
13
15
|
import HiddenField from "./HiddenField";
|
|
14
16
|
import ImageField from "./ImageField";
|
|
17
|
+
import MultiCheckSelect from "./MultiCheckSelect";
|
|
18
|
+
import MultiCheckSelectGroup from "./MultiCheckSelectGroup";
|
|
15
19
|
import NoteField from "./NoteField";
|
|
16
20
|
import NumberField from "./NumberField";
|
|
17
21
|
import RadioField from "./RadioField";
|
|
@@ -36,15 +40,19 @@ export {
|
|
|
36
40
|
AsyncSelect,
|
|
37
41
|
CheckField,
|
|
38
42
|
CheckGroup,
|
|
43
|
+
ColorPicker,
|
|
39
44
|
ComponentArray,
|
|
40
45
|
ComponentContainer,
|
|
41
46
|
ConditionalField,
|
|
42
47
|
DateField,
|
|
43
48
|
FieldGroup,
|
|
44
49
|
FieldsDivider,
|
|
50
|
+
FileField,
|
|
45
51
|
HeadingField,
|
|
46
52
|
HiddenField,
|
|
47
53
|
ImageField,
|
|
54
|
+
MultiCheckSelect,
|
|
55
|
+
MultiCheckSelectGroup,
|
|
48
56
|
NoteField,
|
|
49
57
|
NumberField,
|
|
50
58
|
RadioField,
|
|
@@ -8,7 +8,8 @@ import { Icon, DragAndDrop } from "@ax/components";
|
|
|
8
8
|
import * as S from "./style";
|
|
9
9
|
|
|
10
10
|
const GalleryDragAndDrop = (props: IProps) => {
|
|
11
|
-
const {
|
|
11
|
+
const {
|
|
12
|
+
isImageSelected,
|
|
12
13
|
validFormats,
|
|
13
14
|
site,
|
|
14
15
|
allowUpload,
|
|
@@ -65,7 +66,7 @@ const GalleryDragAndDrop = (props: IProps) => {
|
|
|
65
66
|
const handleUploadFile = async (files: Array<any>) => {
|
|
66
67
|
if (files[0]) {
|
|
67
68
|
if (!checkType(files[0].type)) {
|
|
68
|
-
uploadError("Invalid format");
|
|
69
|
+
uploadError(true, "Invalid format");
|
|
69
70
|
} else {
|
|
70
71
|
try {
|
|
71
72
|
const newImage = await uploadImage(files[0], site);
|
|
@@ -81,6 +82,7 @@ const GalleryDragAndDrop = (props: IProps) => {
|
|
|
81
82
|
|
|
82
83
|
const handleTryAgain = () => {
|
|
83
84
|
setInDropZone(false);
|
|
85
|
+
uploadError(false);
|
|
84
86
|
};
|
|
85
87
|
|
|
86
88
|
const handleFileClick = () => {
|
|
@@ -130,25 +132,14 @@ const GalleryDragAndDrop = (props: IProps) => {
|
|
|
130
132
|
</S.DragIcon>
|
|
131
133
|
<S.DragTitle>Select an image to see details</S.DragTitle>
|
|
132
134
|
</S.StatusWrapper>
|
|
133
|
-
|
|
134
135
|
);
|
|
135
136
|
|
|
136
137
|
return (
|
|
137
138
|
<S.Wrapper hidden={isImageSelected}>
|
|
138
|
-
<S.DragAndDropWrapper
|
|
139
|
-
inDropZone={inDropZone}
|
|
140
|
-
uploading={isUploading}
|
|
141
|
-
success={isSuccess}
|
|
142
|
-
error={isError}
|
|
143
|
-
>
|
|
139
|
+
<S.DragAndDropWrapper inDropZone={inDropZone} uploading={isUploading} success={isSuccess} error={isError}>
|
|
144
140
|
{allowUpload ? renderDragAndDrop() : renderPlaceholder()}
|
|
145
141
|
</S.DragAndDropWrapper>
|
|
146
|
-
<S.UploadingWrapper
|
|
147
|
-
inDropZone={inDropZone}
|
|
148
|
-
uploading={isUploading}
|
|
149
|
-
success={isSuccess}
|
|
150
|
-
error={isError}
|
|
151
|
-
>
|
|
142
|
+
<S.UploadingWrapper inDropZone={inDropZone} uploading={isUploading} success={isSuccess} error={isError}>
|
|
152
143
|
<S.StatusWrapper>
|
|
153
144
|
<S.UploadingStatus>
|
|
154
145
|
<S.DragIcon>
|
|
@@ -184,9 +175,9 @@ interface IGalleryDragAndDropProps {
|
|
|
184
175
|
site: number | string;
|
|
185
176
|
allowUpload: boolean;
|
|
186
177
|
refreshImages: () => Promise<void>;
|
|
187
|
-
isUploading: boolean
|
|
188
|
-
isSuccess: boolean
|
|
189
|
-
isError: boolean
|
|
178
|
+
isUploading: boolean;
|
|
179
|
+
isSuccess: boolean;
|
|
180
|
+
isError: boolean;
|
|
190
181
|
errorMsg: string;
|
|
191
182
|
}
|
|
192
183
|
|
|
@@ -200,7 +191,7 @@ const mapStateToProps = (state: IRootState) => ({
|
|
|
200
191
|
interface IDispatchProps {
|
|
201
192
|
getSiteImages(params: IGetSiteImages): Promise<void>;
|
|
202
193
|
selectImage(item: IImage): void;
|
|
203
|
-
uploadError: (error: string) => Promise<void>;
|
|
194
|
+
uploadError: (error: boolean, msg?: string) => Promise<void>;
|
|
204
195
|
uploadImage: (imageFile: File, site: number | string) => Promise<IImage>;
|
|
205
196
|
}
|
|
206
197
|
|
|
@@ -213,4 +204,4 @@ const mapDispatchToProps = {
|
|
|
213
204
|
|
|
214
205
|
type IProps = IGalleryDragAndDropProps & IDispatchProps;
|
|
215
206
|
|
|
216
|
-
export default connect(mapStateToProps, mapDispatchToProps)(memo(GalleryDragAndDrop));
|
|
207
|
+
export default connect(mapStateToProps, mapDispatchToProps)(memo(GalleryDragAndDrop));
|
|
@@ -17,7 +17,7 @@ const itemsPerPage = 50;
|
|
|
17
17
|
const firstPage = 1;
|
|
18
18
|
|
|
19
19
|
const Gallery = (props: IProps): JSX.Element => {
|
|
20
|
-
const { data, isLoading, getSiteImages, selectImage, getImageSelected, toggleModal, site } = props;
|
|
20
|
+
const { data, isLoading, getSiteImages, selectImage, getImageSelected, toggleModal, site, uploadError } = props;
|
|
21
21
|
|
|
22
22
|
const tabs = [];
|
|
23
23
|
if (site) tabs.unshift(...["Local", "Global"]);
|
|
@@ -48,6 +48,7 @@ const Gallery = (props: IProps): JSX.Element => {
|
|
|
48
48
|
pageRef.current = getParams().page;
|
|
49
49
|
|
|
50
50
|
useEffect(() => {
|
|
51
|
+
uploadError(false);
|
|
51
52
|
const params = getParams();
|
|
52
53
|
getSiteImages({ ...params, page: firstPage });
|
|
53
54
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -220,11 +221,13 @@ const mapStateToProps = (state: IRootState) => ({
|
|
|
220
221
|
interface IDispatchProps {
|
|
221
222
|
getSiteImages(params: IGetSiteImages): Promise<void>;
|
|
222
223
|
selectImage(item: IImage): void;
|
|
224
|
+
uploadError: (error: boolean, msg?: string) => Promise<void>;
|
|
223
225
|
}
|
|
224
226
|
|
|
225
227
|
const mapDispatchToProps = {
|
|
226
228
|
getSiteImages: galleryActions.getSiteImages,
|
|
227
229
|
selectImage: galleryActions.selectImage,
|
|
230
|
+
uploadError: galleryActions.uploadError,
|
|
228
231
|
};
|
|
229
232
|
|
|
230
233
|
type IProps = IGalleryProps & IDispatchProps;
|
|
@@ -47,8 +47,8 @@ function setUploadSuccess(isSuccess: boolean): ISetUploadSuccess {
|
|
|
47
47
|
return { type: SET_UPLOAD_SUCCESS, payload: { isUploading: false, isSuccess } };
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
function setUploadError(errorMsg = ""): ISetUploadError {
|
|
51
|
-
return { type: SET_UPLOAD_ERROR, payload: { inDropZone: false, isUploading: false, isError
|
|
50
|
+
function setUploadError(isError: boolean, errorMsg = ""): ISetUploadError {
|
|
51
|
+
return { type: SET_UPLOAD_ERROR, payload: { inDropZone: false, isUploading: false, isError, errorMsg } };
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
function getSiteImages(props: IGetSiteImages): (dispatch: Dispatch, getState: () => IRootState) => Promise<void> {
|
|
@@ -110,7 +110,7 @@ function uploadImage(imageFile: File, site: number | string): (dispatch: Dispatc
|
|
|
110
110
|
// dispatch(setInDropZone(false));
|
|
111
111
|
return { ...result.data, file: image };
|
|
112
112
|
} else {
|
|
113
|
-
dispatch(setUploadError("Error uploading image"));
|
|
113
|
+
dispatch(setUploadError(true, "Error uploading image"));
|
|
114
114
|
}
|
|
115
115
|
} catch (e) {
|
|
116
116
|
console.log(e);
|
|
@@ -118,9 +118,9 @@ function uploadImage(imageFile: File, site: number | string): (dispatch: Dispatc
|
|
|
118
118
|
};
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
function uploadError(error: string): (dispatch: Dispatch) => Promise<void> {
|
|
121
|
+
function uploadError(error: boolean, msg?: string): (dispatch: Dispatch) => Promise<void> {
|
|
122
122
|
return async (dispatch) => {
|
|
123
|
-
dispatch(setUploadError(error));
|
|
123
|
+
dispatch(setUploadError(error, msg));
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
|
|
@@ -4,8 +4,9 @@ export const Form = styled.div`
|
|
|
4
4
|
display: flex;
|
|
5
5
|
height: 100%;
|
|
6
6
|
width: 100%;
|
|
7
|
-
padding: ${(p) => p.theme.spacing.m};
|
|
7
|
+
padding: ${(p) => `${p.theme.spacing.m} ${p.theme.spacing.m} 0 ${p.theme.spacing.m}`};
|
|
8
8
|
flex-direction: column;
|
|
9
|
+
overflow: auto;
|
|
9
10
|
`;
|
|
10
11
|
|
|
11
12
|
export const FieldsWrapper = styled.div`
|