This commit is contained in:
Peter Maquiran
2024-04-09 09:20:49 +01:00
parent 470d79c7ed
commit 453e51487d
5 changed files with 26 additions and 113 deletions
@@ -321,7 +321,7 @@ export class NewPublicationPage implements OnInit {
FileType: this.checkFileType.checkFileType( this.removeTextBeforeSlash(element.mimeType, '/')) as any
})
/* fileObject.needUpload() */
fileObject.needUpload()
this.PublicationFromMvService.form.Files.push(fileObject)
})
.catch((err) => console.error(err));
@@ -380,6 +380,7 @@ export class NewPublicationPage implements OnInit {
close() {
this.PublicationFromMvService.form.cancel = true
if(this.PublicationFromMvService.form.send == false) {
this.PublicationFromMvService.cancel()
this.PublicationFromMvService.ObjectMergeNotification.close()
@@ -765,38 +766,18 @@ console.log(stringGerada);
return stringAleatoria;
}
async showCroppModal() {
const modal = await this.modalController.create({
component: CropImagePage,
componentProps: {
base64ToCroppe: this.capturedImage
},
cssClass: 'modal modal-desktop'
});
async showCroppModal() {
modal.onDidDismiss().then((res) => {
if (res) {
this.capturedImage = res.data
this.filecontent = true;
this.photoOrVideo = false;
const newAttachment = new PublicationAttachmentEntity(
{
base64: res.data.base64ToCroppe,
extension: 'jpeg',
OriginalFileName: "image",
FileType: 'image'
}
)
let fileObject = new PublicationAttachmentEntity({
base64: this.removeTextBeforeSlash(this.capturedImage, ',') ,
extension: 'jpeg',
OriginalFileName: 'video',
FileType: 'image'
})
this.PublicationFromMvService.form.Files.push(fileObject)
this.PublicationFromMvService.form.Files.push(newAttachment)
}
}, (error) => {
console.log(error)
});
await modal.present();
}
}
}
@@ -203,7 +203,7 @@ export class PublicationFromMvService {
publication.DocumentId = null;
publication.ProcessId = this.folderId
if(this.form.cancel == false) {
if(this.form.cancel == true) {
window['upload-header-set-remove'](this.id);
return false
}
@@ -211,7 +211,6 @@ export class PublicationFromMvService {
try {
await this.publications.CreatePublication(publication.ProcessId, publication).toPromise()
if (this.publicationType == '1') {
this.httpErroHandle.httpsSucessMessagge('Criar publicação')
} else if (this.publicationType == '2') {