code7-leia 0.2.5 → 0.2.7
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/dist/code7-leia.cjs.development.js +10 -9
- package/dist/code7-leia.cjs.development.js.map +1 -1
- package/dist/code7-leia.cjs.production.min.js +1 -1
- package/dist/code7-leia.cjs.production.min.js.map +1 -1
- package/dist/code7-leia.esm.js +10 -9
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/components/CustomToast/index.d.ts +4 -4
- package/dist/components/CustomToast/styles.d.ts +2 -2
- package/dist/store/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/FileArea/index.tsx +1 -1
- package/src/store/modules/sagas.ts +15 -7
|
@@ -4,10 +4,10 @@ interface CustomToastContentProps {
|
|
|
4
4
|
description?: String;
|
|
5
5
|
}
|
|
6
6
|
declare const toast: {
|
|
7
|
-
default: ({ title, description }: CustomToastContentProps) =>
|
|
8
|
-
success: ({ title, description }: CustomToastContentProps) =>
|
|
9
|
-
error: ({ title, description }: CustomToastContentProps) =>
|
|
10
|
-
warn: ({ title, description }: CustomToastContentProps) =>
|
|
7
|
+
default: ({ title, description }: CustomToastContentProps) => React.ReactText;
|
|
8
|
+
success: ({ title, description }: CustomToastContentProps) => React.ReactText;
|
|
9
|
+
error: ({ title, description }: CustomToastContentProps) => React.ReactText;
|
|
10
|
+
warn: ({ title, description }: CustomToastContentProps) => React.ReactText;
|
|
11
11
|
};
|
|
12
12
|
declare const ContainerToast: React.FC;
|
|
13
13
|
export { ContainerToast, toast };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import 'react-toastify/dist/ReactToastify.css';
|
|
3
3
|
interface CustomContainerToastProps {
|
|
4
4
|
}
|
|
5
|
-
export declare const CustomContainerToast: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react-toastify").ToastContainerProps, CustomContainerToastProps>> & Pick<
|
|
5
|
+
export declare const CustomContainerToast: import("styled-components").IStyledComponent<"web", import("styled-components/dist/types").Substitute<import("react-toastify").ToastContainerProps, CustomContainerToastProps>> & Pick<import("react").FC<import("react-toastify").ToastContainerProps>, "propTypes" | "contextTypes" | "defaultProps" | "displayName">;
|
|
6
6
|
export {};
|
package/dist/store/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
declare const store: import("redux").Store<{
|
|
2
2
|
files: never[];
|
|
3
3
|
message: string;
|
|
4
|
-
|
|
4
|
+
isloading: boolean;
|
|
5
5
|
isChanging: boolean;
|
|
6
6
|
isOffline: boolean;
|
|
7
|
-
}, any
|
|
7
|
+
}, any> & {
|
|
8
8
|
dispatch: unknown;
|
|
9
9
|
};
|
|
10
10
|
export default store;
|
package/package.json
CHANGED
|
@@ -54,20 +54,24 @@ export function* testSaga(action: any) {
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export function* uploadFilesSaga(action: any) {
|
|
57
|
-
const t = getLanguage(action.payload.language)
|
|
57
|
+
const t = getLanguage(action.payload.language);
|
|
58
58
|
try {
|
|
59
59
|
yield put(commonLoadingStart());
|
|
60
60
|
const { id, file, pressets, token } = action.payload;
|
|
61
|
-
const tags = pressets.join(',');
|
|
62
61
|
|
|
63
62
|
const blob = new Blob([file.content]);
|
|
64
|
-
|
|
65
63
|
const formData = new FormData();
|
|
66
64
|
formData.append('file', blob, file.properties.path);
|
|
67
65
|
|
|
68
|
-
const queryParams =
|
|
66
|
+
const queryParams = pressets.length
|
|
67
|
+
? new URLSearchParams({ tags: pressets.join(',') }).toString()
|
|
68
|
+
: '';
|
|
69
|
+
|
|
70
|
+
const url = queryParams
|
|
71
|
+
? `/upload/${id}?token=${token}&${queryParams}`
|
|
72
|
+
: `/upload/${id}?token=${token}`;
|
|
69
73
|
|
|
70
|
-
yield call(api.post,
|
|
74
|
+
yield call(api.post, url, formData, {
|
|
71
75
|
headers: {
|
|
72
76
|
'Content-Type': 'multipart/form-data',
|
|
73
77
|
},
|
|
@@ -76,13 +80,17 @@ export function* uploadFilesSaga(action: any) {
|
|
|
76
80
|
const { data } = yield call(api.get, `/training/${id}?token=${token}`);
|
|
77
81
|
yield put(uploadFilesActionSuccess({ files: data.files }));
|
|
78
82
|
} catch (error) {
|
|
79
|
-
toast.error({
|
|
83
|
+
toast.error({
|
|
84
|
+
title: t.toast.uploadFile.fail.title,
|
|
85
|
+
description: t.toast.uploadFile.fail.description,
|
|
86
|
+
});
|
|
80
87
|
console.log('-----------uploadFilesSaga.error------------------->', error);
|
|
81
88
|
} finally {
|
|
82
89
|
yield put(commonLoadingFinish());
|
|
83
90
|
}
|
|
84
91
|
}
|
|
85
92
|
|
|
93
|
+
|
|
86
94
|
export function* TrainingSaga(action: any) {
|
|
87
95
|
const t = getLanguage(action.payload.language)
|
|
88
96
|
try {
|
|
@@ -92,7 +100,7 @@ export function* TrainingSaga(action: any) {
|
|
|
92
100
|
|
|
93
101
|
const queryParams = new URLSearchParams({ tag }).toString();
|
|
94
102
|
|
|
95
|
-
yield call(api.post, pressets.length > 0 ? `/training
|
|
103
|
+
yield call(api.post, pressets.length > 0 ? `/training?${queryParams}` : `/training`,{ files_directory: id, token });
|
|
96
104
|
|
|
97
105
|
const { data } = yield call(api.get, `/training/${id}?token=${token}`);
|
|
98
106
|
yield put(uploadFilesActionSuccess({ files: data.files }));
|