This commit is contained in:
tiago.kayaya
2021-07-14 15:23:45 +01:00
parent 732fff2025
commit 9a39b767dd
18 changed files with 196 additions and 146 deletions
@@ -68,6 +68,8 @@ export class EditEventToApprovePage implements OnInit {
taskStartDate: "",
workflowInstanceDataFields:{
Body: "",
OccurrenceType: '',
LastOccurrence: '',
IsRecurring: false,
ParticipantsList: [],
Agenda: '',
@@ -125,7 +127,7 @@ export class EditEventToApprovePage implements OnInit {
ngOnInit() {
if(this.restoreTemporaryData()){
if(this.restoreTemporaryData()){
this.setOtherData()
} else {
this.getTask();
@@ -138,22 +140,22 @@ export class EditEventToApprovePage implements OnInit {
this.processes.GetTask(this.serialNumber).subscribe( result =>{
this.eventProcess = result
this.restoreDatepickerData()
// description
let body : any =this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.getAttachments()
this.setOtherData()
this.saveTemporaryData()
})
}
setOtherData() {
if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
@@ -167,7 +169,7 @@ export class EditEventToApprovePage implements OnInit {
this.taskParticipants = removeDuplicate(this.taskParticipants)
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc)
if(this.eventProcess.workflowInstanceDataFields.IsRecurring == false) {
this.isRecurring = "Não se repete";
}
@@ -183,7 +185,7 @@ export class EditEventToApprovePage implements OnInit {
close() {
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
this.closeComponent.emit();
/* this.setIntervenient.emit([]);
this.setIntervenientCC.emit([]);
@@ -233,18 +235,18 @@ export class EditEventToApprovePage implements OnInit {
this.runValidation()
if(this.Form.invalid) return false
// set dates to eventProcess object
this.getDatepickerData()
this.taskParticipantsCc.forEach( e => {
e.IsRequired = false
})
this.eventProcess.workflowInstanceDataFields.ParticipantsList = this.taskParticipants.concat(this.taskParticipantsCc)
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e=>{
if(e.hasOwnProperty('$type')) {
delete e.$type
}
@@ -264,12 +266,16 @@ export class EditEventToApprovePage implements OnInit {
MDEmail: this.eventProcess.workflowInstanceDataFields.MDEmail,
MDName: this.eventProcess.workflowInstanceDataFields.MDName,
Message: this.eventProcess.workflowInstanceDataFields.Message,
EventRecurrence: {
Type: this.eventProcess.workflowInstanceDataFields.OccurrenceType,
LastOccurrence: this.eventProcess.workflowInstanceDataFields.LastOccurrence,
},
ParticipantsList: this.eventProcess.workflowInstanceDataFields.ParticipantsList,
Private: false,
ReviewUserComment: ''
}
this.eventsService.postEventToApproveEdit(event).subscribe(()=>{
this.toastService.successMessage('Evento editado');
}, error =>{
@@ -303,7 +309,7 @@ export class EditEventToApprovePage implements OnInit {
// this.taskParticipants = data;
// this.postEvent.Attendees = data;
// }
// setIntervenientCC(data) {
// this.taskParticipantsCc = data;
// }
@@ -315,7 +321,7 @@ export class EditEventToApprovePage implements OnInit {
// }
// addParticipantsCC(){
// this.adding = 'CC'
// this.openAttendees();
// }
@@ -348,7 +354,7 @@ export class EditEventToApprovePage implements OnInit {
}
saveTemporaryData() {
this.getDatepickerData()
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {
@@ -372,7 +378,7 @@ export class EditEventToApprovePage implements OnInit {
return false;
}
}
async getAttachments() {
@@ -405,7 +411,7 @@ export class EditEventToApprovePage implements OnInit {
await modal.present();
modal.onDidDismiss().then( async (res)=>{
if(res){
const data: SearchDocument = res.data.selected;
const DocumentToSave: any = {
@@ -440,14 +446,14 @@ export class EditEventToApprovePage implements OnInit {
this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)));
this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)));
}
getDatepickerData() {
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd
}
}
}