Merge branch 'feature/viewer-attachment' of https://bitbucket.org/equilibriumito/gabinete-digital-fo into feature/viewer-attachment

This commit is contained in:
Eudes Inácio
2024-03-03 12:22:42 +01:00
4 changed files with 13 additions and 7 deletions
@@ -110,6 +110,8 @@ export class NewPublicationPage implements OnInit {
this.showLoader = true;
this.publications.GetPublicationWithArrayOfFilesById(this.documentId).subscribe(res => {
this.processData(res)
console.log("res get", res)
this.showLoader = false;
}, (error) => {
console.log(error)
@@ -120,6 +122,8 @@ export class NewPublicationPage implements OnInit {
}
processData(res) {
console.log("res process", res)
this.publicationFormMV.form.Files = []
this.publicationFormMV.form.setData({
DateIndex: res.DateIndex,
@@ -295,6 +299,8 @@ export class NewPublicationPage implements OnInit {
OriginalFileName: 'video',
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
})
fileObject.needUpload()
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -351,7 +357,7 @@ export class NewPublicationPage implements OnInit {
if(upload) {
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity)=> {
if(e.FileType == 'video') {
if(e.FileType == 'video' && e.toUpload) {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
e.FileExtension = "mp4"
}
@@ -427,8 +433,6 @@ export class NewPublicationPage implements OnInit {
try {
console.log({publication})
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
if (this.publicationTitle == '1') {
@@ -782,6 +786,7 @@ console.log(stringGerada);
}
)
fileObject.needUpload()
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((erro) => console.error('read converted video erro ', erro));
@@ -811,6 +816,7 @@ console.log(stringGerada);
}
)
fileObject.needUpload()
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -246,7 +246,7 @@ export class PublicationFormMV {
if(!PublicationAttachmentEntity.hasChunkManger) {
const fileBlob = PublicationAttachmentEntity.blobFile;
const fileChunks = new Chunks({chunkSize: 40 })
const fileChunks = new Chunks({chunkSize: 400 })
fileChunks.setFile(fileBlob)
PublicationAttachmentEntity.setChunkManger(fileChunks)
@@ -303,7 +303,7 @@ export class PublicationFormMV {
// this.ObjectMergeNotification.socket.registerWhenConnected(() => {
const videosFiles = this.getVideoFiles()
const videosFilesToUploads = videosFiles.filter( e => e.FileType == "video")
const videosFilesToUploads = videosFiles.filter( e => e.FileType == "video" && e.toUpload)
const Promises: Promise<any>[] = []