mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Event to approval bug solved
This commit is contained in:
@@ -177,7 +177,11 @@ const EventToApproveDetails = z.object({
|
||||
totalDocuments: z.number().nullable(),
|
||||
Documents: z.array(z.unknown()).nullable(),
|
||||
PrivateMessage: z.string().nullable(),
|
||||
Attachments: z.array(Attachments)
|
||||
Attachments: z.array(Attachments),
|
||||
eventRecurrence: z.object({
|
||||
frequency: z.number(),
|
||||
until: z.string()
|
||||
})
|
||||
});
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
<div class="buttons">
|
||||
<button *ngIf="activityInstanceName == 'Aprovar evento'" class="btn-cancel" shape="round" (click)="emendarTask()">Enviar para Revisão</button>
|
||||
<button *ngIf="activityInstanceName == 'Aprovar evento'" class="btn-cancel" shape="round" (click)="editTask()">Editar2</button>
|
||||
<button *ngIf="activityInstanceName == 'Aprovar evento'" class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
|
||||
<button *ngIf="activityInstanceName == 'Aprovar evento'" class="btn-cancel" shape="round" (click)="approveTask()">Aprovar</button>
|
||||
<div class="solid"></div>
|
||||
<button *ngIf="activityInstanceName != 'Aprovar evento'" class="btn-cancel" shape="round" (click)="editTask()">Editar</button>
|
||||
|
||||
@@ -60,6 +60,8 @@ export class AgendaDataRepositoryService {
|
||||
try {
|
||||
const result = await this.agendaDataService.getEvent(id).pipe(
|
||||
map((response) => {
|
||||
console.log('response',response)
|
||||
console.log('ToDomain',EventToApproveDetailsMapper.toDomain(response.data))
|
||||
return EventToApproveDetailsMapper.toDomain(response.data)
|
||||
})
|
||||
).toPromise()
|
||||
@@ -140,6 +142,7 @@ export class AgendaDataRepositoryService {
|
||||
}
|
||||
|
||||
updateEvent(eventId, eventData, editAllEvent) {
|
||||
console.log('Update event', eventData)
|
||||
let eventInput = {
|
||||
subject: eventData.Subject,
|
||||
body: eventData.Body.Text || eventData.Body,
|
||||
@@ -149,12 +152,13 @@ export class AgendaDataRepositoryService {
|
||||
isAllDayEvent: eventData.IsAllDayEvent,
|
||||
updateAllEvents: editAllEvent,
|
||||
type: this.utils.calendarTypeSeleted(eventData.Category),
|
||||
category: this.utils.calendarCategorySeleted(eventData.CalendarName),
|
||||
category: this.utils.calendarCategorySeleted(eventData.CalendarName || eventData.Agenda),
|
||||
recurrence: {
|
||||
frequency: this.utils.eventRecurence(eventData.EventRecurrence.frequency),
|
||||
until: ((eventData.EventRecurrence.until === "") ? this.utils.addOneHourToIsoString(eventData.EndDate.toISOString()) : eventData.EventRecurrence.until),
|
||||
}
|
||||
}
|
||||
console.log('Update event post', eventInput)
|
||||
return this.agendaDataService.updateEvent(eventId, eventInput)
|
||||
}
|
||||
|
||||
|
||||
@@ -113,7 +113,7 @@ export class EventToApproveDetailsMapper {
|
||||
"Status": "Active",
|
||||
"TimeZone": getTextInsideParentheses(new Date(dto.startDate)+ ''),
|
||||
"Agenda": category ,
|
||||
"EventType": "Reunião",
|
||||
"EventType": dto.type,
|
||||
//"EventID": "",
|
||||
//"HasAttachments": true,
|
||||
"ParticipantsList": [
|
||||
@@ -159,7 +159,11 @@ export class EventToApproveDetailsMapper {
|
||||
Stakeholders: '',
|
||||
CreateDate: '',
|
||||
ApplicationId: e.applicationId,
|
||||
}))
|
||||
})),
|
||||
eventRecurrence: {
|
||||
frequency: dto.eventRecurrence.frequency,
|
||||
until: dto.eventRecurrence.until
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ export enum EEventType
|
||||
|
||||
|
||||
export enum EAttendeeType {
|
||||
Required,
|
||||
Required = 1,
|
||||
Acknowledgment,
|
||||
Optional
|
||||
}
|
||||
|
||||
@@ -78,10 +78,10 @@ export class Utils {
|
||||
let listupdate = []
|
||||
documents.forEach(element => {
|
||||
let object = {
|
||||
docId: element.docId,
|
||||
sourceName: element.subject || element.sourceNames,
|
||||
docId: element.docId || element.DocId,
|
||||
sourceName: element.subject || element.sourceNames || element.Description,
|
||||
description: "",
|
||||
applicationId: element.applicationId
|
||||
applicationId: element.applicationId || element.ApplicationId
|
||||
}
|
||||
|
||||
listupdate.push(object)
|
||||
|
||||
@@ -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];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user