Event to approval bug solved

This commit is contained in:
Eudes Inácio
2024-06-18 11:39:17 +01:00
parent f827e8b0c2
commit 4cf2b5254d
10 changed files with 57 additions and 27 deletions
@@ -111,13 +111,13 @@
<mat-form-field class="d-none d-md-block" appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="eventProcess.workflowInstanceDataFields.Category" >
<mat-option value="Reunião">
<mat-option value="Meeting">
Reunião
</mat-option>
<mat-option value="Viagem">
<mat-option value="Travel">
Viagem
</mat-option>
<mat-option value="Conferência">
<mat-option value="Conference">
Conferência
</mat-option>
<mat-option value="Encontro">
@@ -168,7 +168,7 @@ export class EditEventToApprovePage implements OnInit {
// description
let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.eventProcess.workflowInstanceDataFields.Category = this.eventProcess.workflowInstanceDataFields.EventType
this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType)
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.loadedAttachments = res.value.Attachments;
@@ -240,6 +240,7 @@ export class EditEventToApprovePage implements OnInit {
setOtherData() {
if (this.eventProcess.workflowInstanceDataFields.ParticipantsList) {
this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => {
console.log('intervenientes ', e)
if (e.IsRequired) {
this.taskParticipants.push(e);
} else {
@@ -260,7 +261,7 @@ export class EditEventToApprovePage implements OnInit {
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
/* this.getAttachments() */
/* this.getAttachments() */
}
close() {
@@ -371,7 +372,7 @@ export class EditEventToApprovePage implements OnInit {
try {
/* await this.eventsService.postEventToApproveEdit(event).toPromise() */
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event,false).subscribe((value) => {
this.agendaDataRepository.updateEvent(this.eventProcess.serialNumber, event, false).subscribe((value) => {
console.log(value)
}, ((error) => {
console.log('edit event error: ', error)
@@ -550,7 +551,7 @@ export class EditEventToApprovePage implements OnInit {
if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
this.eventProcess = restoredData.eventProcess,
this.loadedAttachments = restoredData.attachment
this.loadedAttachments = restoredData.attachment
// restore dater for date and hours picker
this.restoreDatepickerData()
@@ -580,11 +581,11 @@ export class EditEventToApprovePage implements OnInit {
}
deleteAttachment(attachment: Attachment, index) {
const id: any = this.loadedAttachments[index].id
console.log(this.loadedAttachments)
let update = this.removeItemById(this.loadedAttachments,id)
this.loadedAttachments = update;
this.deletedAttachmentsList.push(id)
const id: any = this.loadedAttachments[index].id
console.log(this.loadedAttachments)
let update = this.removeItemById(this.loadedAttachments, id)
this.loadedAttachments = update;
this.deletedAttachmentsList.push(id)
}
removeItemById(array, id) {
@@ -650,4 +651,14 @@ export class EditEventToApprovePage implements OnInit {
}
setEventType(eventType) {
var selectedEventType = {
1: 'Meeting',
2: 'Travel',
3: 'Conference',
4: 'Encontro'
}
return selectedEventType[eventType];
}
}
@@ -80,13 +80,13 @@
<mat-form-field appearance="none" class="width-100" placeholder="Sample Type" required>
<!-- <input matInput type="text" > -->
<mat-select [(ngModel)]="eventProcess.workflowInstanceDataFields.Category" >
<mat-option value="Reunião">
<mat-option value="Meeting">
Reunião
</mat-option>
<mat-option value="Viagem">
<mat-option value="Travel">
Viagem
</mat-option>
<mat-option value="Conferência">
<mat-option value="Conference">
Conferência
</mat-option>
<mat-option value="Encontro">
@@ -159,7 +159,6 @@ export class EditEventToApproveComponent implements OnInit {
console.log('Loaded Event', res.value)
this.eventProcess = res.value as any
this.eventProcess.workflowInstanceDataFields.Category = res.value.workflowInstanceDataFields.EventType
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
this.startDate = new Date(this.eventProcess.workflowInstanceDataFields.StartDate);
@@ -171,6 +170,7 @@ export class EditEventToApproveComponent implements OnInit {
this.Location = this.eventProcess.workflowInstanceDataFields.Location
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType)
this.loadedAttachments = res.value.Attachments
/* this.getAttachments()
@@ -529,7 +529,14 @@ export class EditEventToApproveComponent implements OnInit {
await modal.present();
}
setEventType(eventType) {
var selectedEventType = {
1: 'Meeting',
2: 'Travel',
3: 'Conference',
4: 'Encontro'
}
return selectedEventType[eventType];
}
}