{fileDownloadModal}
Files
Files from Workflows are a way to store as well as edit files.{" "}
Learn more
{/*
*/}
(upload = ref)}
onChange={(event) => {
//const file = event.target.value
//const fileObject = URL.createObjectURL(actualFile)
//setFile(fileObject)
//const files = event.target.files[0]
uploadFiles(event.target.files);
}}
/>
{/*
*/}
{fileCategories !== undefined &&
fileCategories !== null &&
fileCategories.length > 1 ? (
) : null}
{renderTextBox ?
:
}
{renderTextBox &&
{
handleKeyDown(event);
}}
InputProps={{
style: {
color: "white",
},
}}
color="primary"
placeholder="File category name"
required
margin="dense"
defaultValue={""}
autoFocus
/>}
{isSelectedFiles?null:
}
{["Name", "Workflow", "Md5", "Status", "Filesize", "Actions"].map((header, index) => (
))}
{showLoader ?
[...Array(6)].map((_, rowIndex) => (
{Array(6)
.fill()
.map((_, colIndex) => (
))}
)):
files.length === 0 ? (
No files found
):(
files?.map((file, index) => {
if (file.namespace === "") {
file.namespace = "default";
}
if (file.namespace !== selectedCategory) {
return null;
}
var bgColor = isSelectedFiles ? "#212121":"#27292d";
if (index % 2 === 0) {
bgColor = isSelectedFiles ? "#1A1A1A":"#1f2023";
}
const filenamesplit = file.filename.split(".")
const iseditable = file.filesize < 2000000 && file.status === "active" && allowedFileTypes.includes(filenamesplit[filenamesplit.length-1])
return (
{/*
*/}
: (
)
}
style={{
display: 'table-cell',
overflow: "hidden",
}}
/>
{file.md5_sum}
)}
primaryTypographyProps={{
style:{
display: 'table-cell',
marginLeft:isSelectedFiles? 15:null,
overflow: "hidden",
whiteSpace: 'nowrap',
textOverflow: 'ellipsis',
maxWidth: 200,
}
}}
/>
{
setOpenEditor(true)
setOpenFileId(file.id)
readFileData(file)
}}
>
{/*
{
// Open the file, without downloading it
window.open(`${globalUrl}/api/v1/files/${file.id}/content?type=text&authorization=${file.public_authorization}`, "_blank noreferrer noopener")
}}
>
*/}
{
downloadFile(file);
}}
>
{
console.log("file is : ", file)
navigator.clipboard.writeText(file.id);
document.execCommand("copy");
toast(file.id + " copied to clipboard");
}}
>
{
deleteFile(file)
}}
>
style={{
display: 'table-cell',
textAlign:'center'
// overflow: "hidden",
}}
/>
);
})
)
}