ITOTEAM-525 data validation

This commit is contained in:
Peter Maquiran
2024-06-23 21:47:34 +01:00
parent e1914505f2
commit ca50ae9dae
11 changed files with 67 additions and 40 deletions
+1 -1
View File
@@ -212,7 +212,7 @@ export class ProfilePage implements OnInit {
return time;
}
@XTracer({name:'profile/notificatinsRoutes', bugPrint: true, module:'notification'})
@XTracer({name:'profile/notificationClick', bugPrint: true, module:'notification'})
notificatinsRoutes (index, Service, Object, IdObject, FolderId, i, tracing?: TracingType) {
console.log(index, i)
+1 -1
View File
@@ -123,7 +123,7 @@ export class ViewEventPage implements OnInit {
ev.target.complete();
}
@XTracerAsync({name:'mobile/loadEvent', bugPrint: true})
@XTracerAsync({name:'mobile/loadEventDetails', bugPrint: true})
async loadEvent(tracing?: TracingType) {
const loader = this.toastService.loading();
@@ -425,7 +425,7 @@ export class EditEventPage implements OnInit {
}
}
@XTracerAsync({name:'desktop/create-event', bugPrint: true, daley: 4000})
@XTracerAsync({name:'mobile/create-event', bugPrint: true, daley: 4000})
async save_v2(editAllEvent, tracing?: TracingType) {
this.injectValidation()
this.runValidation()
@@ -604,7 +604,7 @@ export class EditEventPage implements OnInit {
if (this.postEvent.HasAttachments) {
this.attachmentsService.getAttachmentsById(eventId).subscribe(res => {
this.loadedEventAttachments = res;
// this.loadedEventAttachments = res;
}, ((erro) => {
console.error('editgetAttchament', erro)
@@ -193,7 +193,7 @@ export class ViewEventPage implements OnInit {
this.TimeZoneString = this.loadedEvent.TimeZone
}
@XTracerAsync({name:'ViewEventPage/loadEvent', bugPrint: true})
@XTracerAsync({name:'mobile/loadEventDetails', bugPrint: true})
async loadEvent(tracing?: TracingType) {
const loader = this.toastService.loading();
@@ -4,7 +4,7 @@ export const AttachInputDTOSchema = z.object({
attachments: z.array(z.object({
docId: z.any(),
sourceName: z.any(),
description: z.any(),
description: z.any().nullable(),
applicationId: z.any(),
}))
+5 -3
View File
@@ -83,15 +83,17 @@ export class Utils {
let listupdate = []
documents.forEach(element => {
let object = {
docId: element.docId || element.DocId,
sourceName: element.subject || element.sourceNames || element.Description || element.SourceNames,
docId: element.docId || element.DocId || element.Id,
sourceName: element.subject || element.sourceNames || element.Description || element.SourceName,
description: "",
applicationId: element.applicationId || element.ApplicationId
}
listupdate.push(object)
});
return listupdate
return listupdate.filter( e=> typeof e.docId == 'number')
/* return documents.map((e) => {
return {
docId: e.docId,
+1 -1
View File
@@ -313,7 +313,7 @@ export class TaskService {
}
@XTracerAsync({name:'taskService/loadEventParaAprovacao', bugPrint: true})
@XTracerAsync({name:'taskService/loadEventToAprove', bugPrint: true})
async loadEventosParaAprovacao(tracing?: TracingType) {
this.showLoaderNum++
console.log('PR')
@@ -136,7 +136,8 @@ export class EditEventToApprovePage implements OnInit {
private toastService: ToastService,
public ThemeService: ThemeService,
public httpErrorHandler: HttpErrorHandle,
private agendaDataRepository: AgendaDataRepositoryService
private agendaDataRepository: AgendaDataRepositoryService,
private httpErroHalde: HttpErrorHandle,
) {
this.isEventEdited = false;
}
@@ -153,28 +154,42 @@ export class EditEventToApprovePage implements OnInit {
}
async getTask() {
async getTask(tracing?: TracingType) {
const res: any = await this.agendaDataRepository.getEventToApproveById(this.serialNumber)
console.log('evento to apro to edit', res.value)
this.eventProcess = res.value;
const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber)
if(res.isOk()) {
console.log('evento to apro to edit', res.value)
this.eventProcess = res.value as any;
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
this.restoreDatepickerData()
// description
try {
let body: any = this.eventProcess.workflowInstanceDataFields?.Body?.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
} catch (error) {}
this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType)
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.loadedAttachments = res.value.Attachments;
console.log(this.loadedAttachments)
this.setOtherData()
this.saveTemporaryData()
tracing.setAttribute('outcome', 'success')
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
this.restoreDatepickerData()
// description
let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
this.eventProcess.workflowInstanceDataFields.Category = this.setEventType(this.eventProcess.workflowInstanceDataFields.EventType)
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.loadedAttachments = res.value.Attachments;
console.log(this.loadedAttachments)
this.setOtherData()
this.saveTemporaryData()
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
this.httpErroHalde.httpStatusHandle(res.error)
}
}
getRecurrenceTypes() {
@@ -285,6 +285,7 @@
</ion-label>
</div>
<div class="d-flex container-div width-100" >
<ion-list class="width-100 ">
<ion-item class="width-100" *ngFor="let document of loadedAttachments; let i = index">
@@ -149,7 +149,8 @@ export class EditEventToApproveComponent implements OnInit {
})
}, 1000);
async getTask() {
@XTracerAsync({name:'mobile/loadEventToApproveDetails', bugPrint: true})
async getTask(tracing?: TracingType) {
/* const result = await this.processes.GetTask(this.serialNumber).toPromise(); */
const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber)
@@ -164,8 +165,13 @@ export class EditEventToApproveComponent implements OnInit {
this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);
// description
let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
try {
let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body
} catch (error) {}
this.Location = this.eventProcess.workflowInstanceDataFields.Location
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
@@ -189,7 +195,10 @@ export class EditEventToApproveComponent implements OnInit {
}
})
tracing.setAttribute('outcome', 'success')
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
this.httpErroHalde.httpStatusHandle(res.error)
}