Index: components/Import/Import.component.tsx =================================================================== diff -u -r83efc071bbdb1d3b2460439744d4809e13efd0b5 -r70954fa7860d1729953feb6655ac7de909c188f7 --- components/Import/Import.component.tsx (.../Import.component.tsx) (revision 83efc071bbdb1d3b2460439744d4809e13efd0b5) +++ components/Import/Import.component.tsx (.../Import.component.tsx) (revision 70954fa7860d1729953feb6655ac7de909c188f7) @@ -1,4 +1,4 @@ -import { DeleteOutlined, DownloadOutlined, ImportOutlined } from '@ant-design/icons'; +import { DeleteOutlined, DownloadOutlined, ImportOutlined, PaperClipOutlined } from '@ant-design/icons'; import { Button, Col, Popconfirm, Row, Select, Space, Spin, Table, Typography } from 'antd'; import { IImportJob } from 'lemans-api/services/Import/import.types'; import { ITempFile } from 'lemans-api/services/Media/media.types'; @@ -16,12 +16,21 @@ const loader = useLoader(); const [importType, setImportType] = React.useState(""); - const [tempFile, setTempFile] = React.useState(null); + const [hasTempFile, setHasTempFile] = React.useState(false); + // const [tempFile, setTempFile] = React.useState(null); + const [tempFile, setTempFile] = React.useState([] as ITempFile[]); + const updateTempFile = (file:ITempFile) => { - setTempFile(file); + tempFile.push(file); + setTempFile(tempFile); + setHasTempFile(true); + // setTempFile(file); } const refresh = () => { + setTempFile([]); + setHasTempFile(false); + loader.start(); service.import.search({sorting: 'localeImportProcessId+DESC'}) .then(setJobs) @@ -39,7 +48,7 @@ const startJob = () => { if(!!tempFile) { - service.import.start(tempFile, importType) + service.import.start(tempFile[0], importType) .then(refresh); } } @@ -80,7 +89,13 @@ - + {/* */} + {/* */} + + {/* setting showUploadList as true is showing older files also, so going the route of manually displaying the filename*/} + {hasTempFile && + <> {tempFile[0].originalFileName}.{tempFile[0].extension} + } @@ -95,7 +110,7 @@ - + ;