|
|
|
@@ -11,7 +11,7 @@ import { |
|
|
|
getFilesReq, |
|
|
|
setContent, |
|
|
|
updateFileReq, |
|
|
|
resetFilters |
|
|
|
resetFilters, |
|
|
|
} from "../../store/actions/files/fileActions"; |
|
|
|
import { Fade, Pagination } from "@mui/material"; |
|
|
|
import FilterButton from "../../components/Button/FilterButton"; |
|
|
|
@@ -191,6 +191,7 @@ const FileTable = ({ trigger }) => { |
|
|
|
|
|
|
|
const displayFile = (fileStream, streamId, fileType) => { |
|
|
|
setFile({ fileStream, streamId, fileType }); |
|
|
|
console.log("Matches je", matches); |
|
|
|
}; |
|
|
|
|
|
|
|
const getPathForFile = (fileType, fileStream) => { |
|
|
|
@@ -222,7 +223,7 @@ const FileTable = ({ trigger }) => { |
|
|
|
}; |
|
|
|
|
|
|
|
const resFilters = () => { |
|
|
|
dispatch(resetFilters()) |
|
|
|
dispatch(resetFilters()); |
|
|
|
dispatch( |
|
|
|
getFilesReq({ |
|
|
|
payload: { |
|
|
|
@@ -261,7 +262,7 @@ const FileTable = ({ trigger }) => { |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
<div> |
|
|
|
<div style={{ display: "flex", flexDirection: "column" }}> |
|
|
|
<ConfirmDialog |
|
|
|
open={fileForDelete.open} |
|
|
|
title={t("files.confirmDialogTitle")} |
|
|
|
@@ -276,6 +277,38 @@ const FileTable = ({ trigger }) => { |
|
|
|
setFileForDelete({ open: false, title: "", streamId: null }); |
|
|
|
}} |
|
|
|
/> |
|
|
|
<CustomModal |
|
|
|
classes="files-viewer-custom-modal" |
|
|
|
open={file && matches} |
|
|
|
onCloseModal={() => setFile(null)} |
|
|
|
> |
|
|
|
{file !== null ? ( |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
width: "100%", |
|
|
|
overflowY: "auto", |
|
|
|
overflowX: "auto", |
|
|
|
height: "95%", |
|
|
|
}} |
|
|
|
> |
|
|
|
<FileViewer |
|
|
|
fileType={file.fileType} |
|
|
|
filePath={getPathForFile(file.fileType, file.fileStream)} |
|
|
|
onError={onError} |
|
|
|
/> |
|
|
|
</div> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
<Button |
|
|
|
type="button" |
|
|
|
variant="contained" |
|
|
|
className="c-btn c-btn--primary-outlined file-viewer-close-btn" |
|
|
|
onClick={() => setFile(null)} |
|
|
|
> |
|
|
|
{t("files.close")} |
|
|
|
</Button> |
|
|
|
</CustomModal> |
|
|
|
<CustomModal |
|
|
|
classes="files-custom-modal" |
|
|
|
open={openNoteModal.open} |
|
|
|
@@ -387,18 +420,33 @@ const FileTable = ({ trigger }) => { |
|
|
|
</IconButton> |
|
|
|
)} |
|
|
|
<FilterButton onShowFilters={handleToggleFiltersDrawer} /> |
|
|
|
<IconButton |
|
|
|
className="c-btn c-btn--primary-outlined candidate-btn reset-filters userPageBtn ml-20px no-padding custom-filter-button" |
|
|
|
onClick={resFilters} |
|
|
|
> |
|
|
|
{!matches ? t("filters.resetFilters") : null} |
|
|
|
</IconButton> |
|
|
|
{!matches ? ( |
|
|
|
<IconButton |
|
|
|
className="c-btn c-btn--primary-outlined candidate-btn reset-filters userPageBtn ml-20px no-padding custom-filter-button" |
|
|
|
onClick={resFilters} |
|
|
|
> |
|
|
|
{t("filters.resetFilters")} |
|
|
|
</IconButton> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
{matches ? ( |
|
|
|
<p |
|
|
|
className="reset-filter-responsive" |
|
|
|
onClick={resFilters} |
|
|
|
style={{ alignSelf: "flex-end" }} |
|
|
|
> |
|
|
|
{t("filters.resetFilters")} |
|
|
|
</p> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
display: "flex", |
|
|
|
marginTop: "39px", |
|
|
|
marginTop: "30px", |
|
|
|
justifyContent: "space-between", |
|
|
|
}} |
|
|
|
> |
|
|
|
@@ -409,6 +457,7 @@ const FileTable = ({ trigger }) => { |
|
|
|
display: "flex", |
|
|
|
width: matches ? "75vw" : "85vw", |
|
|
|
flexDirection: "row", |
|
|
|
justifyContent: "space-between", |
|
|
|
}} |
|
|
|
> |
|
|
|
<table |
|
|
|
@@ -424,12 +473,24 @@ const FileTable = ({ trigger }) => { |
|
|
|
className="headingRow headingRowFiles" |
|
|
|
style={{ cursor: "pointer" }} |
|
|
|
> |
|
|
|
{file === null ? <th>{t("files.doucmentPath")}</th> : ""} |
|
|
|
{file === null || matches ? ( |
|
|
|
<th>{t("files.doucmentPath")}</th> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
<th>{t("files.doucmentName")}</th> |
|
|
|
{file === null ? <th>{t("files.doucmentType")}</th> : ""} |
|
|
|
{file === null ? <th>{t("files.doucmentSize")} (kB)</th> : ""} |
|
|
|
{file === null ? <th>{t("files.deleteDocument")}</th> : ""} |
|
|
|
{file === null ? <th>{t("files.note")}</th> : ""} |
|
|
|
{file === null || matches ? ( |
|
|
|
<th>{t("files.doucmentType")}</th> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
{file === null || matches ? ( |
|
|
|
<th>{t("files.doucmentSize")} (kB)</th> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
<th>{t("files.deleteDocument")}</th> |
|
|
|
{file === null || matches ? <th>{t("files.note")}</th> : ""} |
|
|
|
<th>{t("files.downloadDocument")}</th> |
|
|
|
</tr> |
|
|
|
</thead> |
|
|
|
@@ -442,43 +503,44 @@ const FileTable = ({ trigger }) => { |
|
|
|
displayFile(n.file_stream, n.stream_id, n.file_type) |
|
|
|
} |
|
|
|
> |
|
|
|
{file === null ? ( |
|
|
|
{file === null || matches ? ( |
|
|
|
<td className="docs-name">{n.fileName}</td> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
<td className="docs-name">{n.title}</td> |
|
|
|
{file === null ? <td>{n.file_type && n.file_type}</td> : ""} |
|
|
|
|
|
|
|
{file === null ? ( |
|
|
|
<td className="profession"> |
|
|
|
{<NumericLabel>{n.cached_file_size}</NumericLabel>} |
|
|
|
</td> |
|
|
|
{file === null || matches ? ( |
|
|
|
<td>{n.file_type && n.file_type}</td> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
{file === null ? ( |
|
|
|
|
|
|
|
{file === null || matches ? ( |
|
|
|
<td className="profession"> |
|
|
|
<IconButton |
|
|
|
className="c-btn c-btn--primary-outlined" |
|
|
|
onClick={() => |
|
|
|
setFileForDelete({ |
|
|
|
open: true, |
|
|
|
title: n.title, |
|
|
|
streamId: n.stream_id, |
|
|
|
}) |
|
|
|
} |
|
|
|
> |
|
|
|
<img |
|
|
|
style={{ width: "12px", height: "12px" }} |
|
|
|
src={deleteIcon} |
|
|
|
/> |
|
|
|
</IconButton> |
|
|
|
{<NumericLabel>{n.cached_file_size}</NumericLabel>} |
|
|
|
</td> |
|
|
|
) : ( |
|
|
|
"" |
|
|
|
)} |
|
|
|
{file === null ? ( |
|
|
|
<td className="profession"> |
|
|
|
<IconButton |
|
|
|
className="c-btn c-btn--primary-outlined" |
|
|
|
onClick={() => |
|
|
|
setFileForDelete({ |
|
|
|
open: true, |
|
|
|
title: n.title, |
|
|
|
streamId: n.stream_id, |
|
|
|
}) |
|
|
|
} |
|
|
|
> |
|
|
|
<img |
|
|
|
style={{ width: "12px", height: "12px" }} |
|
|
|
src={deleteIcon} |
|
|
|
/> |
|
|
|
</IconButton> |
|
|
|
</td> |
|
|
|
|
|
|
|
{file === null || matches ? ( |
|
|
|
<td className="profession"> |
|
|
|
<IconButton |
|
|
|
className="c-btn c-btn--primary-outlined" |
|
|
|
@@ -519,13 +581,15 @@ const FileTable = ({ trigger }) => { |
|
|
|
))} |
|
|
|
</tbody> |
|
|
|
</table> |
|
|
|
{file !== null ? ( |
|
|
|
{file !== null && !matches ? ( |
|
|
|
<div |
|
|
|
style={{ |
|
|
|
width: "100%", |
|
|
|
width: "750px", |
|
|
|
marginLeft: "30px", |
|
|
|
overflowY: "auto", |
|
|
|
height: "350px", |
|
|
|
zIndex: 1000000, |
|
|
|
backgroundColor: "#F0F0F0", |
|
|
|
}} |
|
|
|
> |
|
|
|
<FileViewer |