This commit is contained in:
tiago.kayaya
2021-07-15 17:57:01 +01:00
parent cab594ff47
commit 9d7f7f3116
5 changed files with 116 additions and 69 deletions
@@ -45,6 +45,8 @@ export class EditEventToApprovePage implements OnInit {
public stepSecond = 5;
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
recurringTypes: any;
selectedRecurringType: any;
showLoader = false
@@ -127,12 +129,16 @@ export class EditEventToApprovePage implements OnInit {
ngOnInit() {
console.log('EDITAR');
if(this.restoreTemporaryData()){
this.setOtherData()
} else {
this.getTask();
}
this.getRecurrenceTypes();
}
@@ -156,6 +162,24 @@ export class EditEventToApprovePage implements OnInit {
})
}
getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{
console.log(res);
this.recurringTypes = res;
});
}
onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){
console.log(ev.filter(data => data != '-1'));
this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1');
}
if(ev.length == 0){
this.eventProcess.workflowInstanceDataFields.OccurrenceType = "-1";
}
}
setOtherData() {
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
@@ -274,6 +298,7 @@ export class EditEventToApprovePage implements OnInit {
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
}
console.log(event);
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService.successMessage('Evento editado');