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

This commit is contained in:
Equilibrium ITO
2024-03-03 18:19:23 +01:00
6 changed files with 74 additions and 42 deletions
@@ -27,7 +27,7 @@
<div class="buttons width-100">
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
</div>
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma'">
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma' && task.activityInstanceName != 'Revisar Diploma'">
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
</div>
</div>
@@ -143,6 +143,7 @@ export class OptsExpedientePage implements OnInit {
this.attachmentsService.AddAttachment(body).subscribe((res)=> {
this.toastService._successMessage()
this.popoverController.dismiss()
}, (error) => {
this.httpErrorHanlde.httpStatusHandle(error)
},()=> {
@@ -151,7 +152,7 @@ export class OptsExpedientePage implements OnInit {
});
this.popoverController.dismiss()
}
}, (error) => {
@@ -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,
@@ -177,7 +181,6 @@ export class NewPublicationPage implements OnInit {
FileType: 'image'
}
)
newAttachment.needUpload()
this.publicationFormMV.form.Files.push(newAttachment)
});
}
@@ -295,6 +298,7 @@ export class NewPublicationPage implements OnInit {
OriginalFileName: 'video',
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
})
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -351,8 +355,8 @@ export class NewPublicationPage implements OnInit {
if(upload) {
this.publicationFormMV.form.Files = this.publicationFormMV.form.Files.map((e:PublicationAttachmentEntity)=> {
if(e.FileType == 'video') {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
if(e.FileType == 'video' && e.blobFile && e.toUpload) {
e.OriginalFileName = e?.chucksManager?.path?.replace(".mp4", "") || e.OriginalFileName
e.FileExtension = "mp4"
}
return e
@@ -402,7 +406,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.blobFile && e.toUpload) {
e.OriginalFileName = e.chucksManager.path.replace(".mp4", "")
e.FileExtension = "mp4"
e.Base64 = ""
@@ -427,8 +431,6 @@ export class NewPublicationPage implements OnInit {
try {
console.log({publication})
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
if (this.publicationTitle == '1') {
@@ -781,6 +783,7 @@ console.log(stringGerada);
}
)
// fileObject.needUpload()
this.publicationFormMV.form.Files.push(fileObject)
})
.catch((erro) => console.error('read converted video erro ', erro));
@@ -810,6 +813,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 && e.blobFile)
const Promises: Promise<any>[] = []