Edit process to approve

This commit is contained in:
Peter Maquiran
2021-05-04 15:44:48 +01:00
parent ab1954255e
commit 6a3fda279e
16 changed files with 203 additions and 102 deletions
@@ -29,7 +29,8 @@ export class EditEventToApproveComponent implements OnInit {
Agenda: '',
EndDate: '',
Location: '',
Subject: ''
Subject: '',
InstanceId: ''
}
}
@@ -63,17 +64,12 @@ export class EditEventToApproveComponent implements OnInit {
) {
this.serialNumber = this.navParams.get('serialNumber');
this.postEvent = this.navParams.get('event');
this.profile = this.navParams.get('profile');
this.InstanceId = this.navParams.get('InstanceId')
// this.profile = this.navParams.get('profile');
this.isEventEdited = false;
console.log(this.eventProcess.workflowInstanceDataFields.Subject)
this.getTask()
this.getAttachments()
}
@@ -90,7 +86,11 @@ export class EditEventToApproveComponent implements OnInit {
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.Location = this.eventProcess.workflowInstanceDataFields.Location
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments()
// attendees
//this.eventProcess.workflowInstanceDataFields.ParticipantsList
// subject
@@ -121,10 +121,6 @@ export class EditEventToApproveComponent implements OnInit {
}
})
})
}
ngOnInit() {
@@ -147,7 +143,6 @@ export class EditEventToApproveComponent implements OnInit {
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
}
async openAttendees() {
@@ -178,6 +173,8 @@ export class EditEventToApproveComponent implements OnInit {
this.setIntervenientCC(newAttendeesCC);
}
});
} else {
this.showAttendees = true
}
}
@@ -197,6 +194,7 @@ export class EditEventToApproveComponent implements OnInit {
}
addParticipantsCC(){
this.adding = 'CC'
this.openAttendees();
}
@@ -206,12 +204,11 @@ export class EditEventToApproveComponent implements OnInit {
this.taskParticipantsCc = taskParticipantsCc;
}
async getAttachments(){
async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
console.log(this.loadedAttachments)
}
deleteAttachment(attachmentID: string) {
@@ -235,18 +232,19 @@ export class EditEventToApproveComponent implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res)=>{
if(res){
const data = res.data;
//data.selected
const DocumentToSave = {
SourceTitle: data.selected.Assunto,
ParentId: this.postEvent.EventId,
ParentId: this.InstanceId,
Source: '1',
SourceId: data.selected.Id,
ApplicationId: data.selected.ApplicationType.toString(),
Id: '0',
Id: '',
Link: '',
SerialNumber: '',
SerialNumber: ''
};
await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{