code7-leia 0.1.175 → 0.1.177
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 +12 -3
- 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 +13 -4
- package/dist/code7-leia.esm.js.map +1 -1
- package/dist/interface/FileData.d.ts +1 -0
- package/package.json +1 -1
- package/src/components/FileArea/index.tsx +10 -2
- package/src/components/MultiSelect/styles.tsx +1 -1
- package/src/interface/FileData.ts +1 -0
- package/src/store/modules/sagas.ts +1 -1
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import React, { useEffect, useState} from 'react';
|
|
|
2
2
|
import { useDispatch, useSelector } from 'react-redux';
|
|
3
3
|
import { renderToString } from 'react-dom/server';
|
|
4
4
|
|
|
5
|
-
import { FaUpload, FaList, FaPlus, FaCheck } from 'react-icons/fa';
|
|
5
|
+
import { FaUpload, FaList, FaPlus, FaCheck, FaFile } from 'react-icons/fa';
|
|
6
6
|
import { GiWeightLiftingUp } from "react-icons/gi";
|
|
7
7
|
import { TiDelete } from "react-icons/ti";
|
|
8
8
|
|
|
@@ -125,6 +125,14 @@ export const FileArea = () => {
|
|
|
125
125
|
setPresset([])
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
const viewFile = (link: string) => {
|
|
129
|
+
if(link){
|
|
130
|
+
const checkIcon = renderToString(<FaFile size={14} />);
|
|
131
|
+
return `<a href='${link}' target='_blank'>${checkIcon}</a>`;
|
|
132
|
+
}
|
|
133
|
+
return null
|
|
134
|
+
};
|
|
135
|
+
|
|
128
136
|
const renderFiles = () => {
|
|
129
137
|
return (
|
|
130
138
|
<S.Container isloading={isloading}>
|
|
@@ -174,7 +182,7 @@ export const FileArea = () => {
|
|
|
174
182
|
<tbody>
|
|
175
183
|
{files.map((object) => (
|
|
176
184
|
<tr>
|
|
177
|
-
<td>{object.name}</td>
|
|
185
|
+
<td> {viewFile(object.link)} {object.name}</td>
|
|
178
186
|
<td>{object.trained ? <FaCheck size={14} style={{ color: 'green' }} /> : <TiDelete size={14} style={{ color: 'red' }} />}</td>
|
|
179
187
|
<td className='tags' dangerouslySetInnerHTML={{ __html: pressetTag(object.tags) }} />
|
|
180
188
|
<td>
|
|
@@ -92,7 +92,7 @@ export function* TrainingSaga(action: any) {
|
|
|
92
92
|
|
|
93
93
|
const queryParams = new URLSearchParams({ tag }).toString();
|
|
94
94
|
|
|
95
|
-
yield call(api.post, `/training?${queryParams}`,{ files_directory: id });
|
|
95
|
+
yield call(api.post, pressets.length > 0 ? `/training?${queryParams}` : `/training`,{ files_directory: id });
|
|
96
96
|
|
|
97
97
|
const { data } = yield call(api.get, `/training/${id}`);
|
|
98
98
|
yield put(uploadFilesActionSuccess({ files: data.files }));
|