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; 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) { notificatinsRoutes (index, Service, Object, IdObject, FolderId, i, tracing?: TracingType) {
console.log(index, i) console.log(index, i)
+1 -1
View File
@@ -123,7 +123,7 @@ export class ViewEventPage implements OnInit {
ev.target.complete(); ev.target.complete();
} }
@XTracerAsync({name:'mobile/loadEvent', bugPrint: true}) @XTracerAsync({name:'mobile/loadEventDetails', bugPrint: true})
async loadEvent(tracing?: TracingType) { async loadEvent(tracing?: TracingType) {
const loader = this.toastService.loading(); 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) { async save_v2(editAllEvent, tracing?: TracingType) {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
@@ -604,7 +604,7 @@ export class EditEventPage implements OnInit {
if (this.postEvent.HasAttachments) { if (this.postEvent.HasAttachments) {
this.attachmentsService.getAttachmentsById(eventId).subscribe(res => { this.attachmentsService.getAttachmentsById(eventId).subscribe(res => {
this.loadedEventAttachments = res; // this.loadedEventAttachments = res;
}, ((erro) => { }, ((erro) => {
console.error('editgetAttchament', erro) console.error('editgetAttchament', erro)
@@ -193,7 +193,7 @@ export class ViewEventPage implements OnInit {
this.TimeZoneString = this.loadedEvent.TimeZone this.TimeZoneString = this.loadedEvent.TimeZone
} }
@XTracerAsync({name:'ViewEventPage/loadEvent', bugPrint: true}) @XTracerAsync({name:'mobile/loadEventDetails', bugPrint: true})
async loadEvent(tracing?: TracingType) { async loadEvent(tracing?: TracingType) {
const loader = this.toastService.loading(); const loader = this.toastService.loading();
@@ -4,7 +4,7 @@ export const AttachInputDTOSchema = z.object({
attachments: z.array(z.object({ attachments: z.array(z.object({
docId: z.any(), docId: z.any(),
sourceName: z.any(), sourceName: z.any(),
description: z.any(), description: z.any().nullable(),
applicationId: z.any(), applicationId: z.any(),
})) }))
+5 -3
View File
@@ -83,15 +83,17 @@ export class Utils {
let listupdate = [] let listupdate = []
documents.forEach(element => { documents.forEach(element => {
let object = { let object = {
docId: element.docId || element.DocId, docId: element.docId || element.DocId || element.Id,
sourceName: element.subject || element.sourceNames || element.Description || element.SourceNames, sourceName: element.subject || element.sourceNames || element.Description || element.SourceName,
description: "", description: "",
applicationId: element.applicationId || element.ApplicationId applicationId: element.applicationId || element.ApplicationId
} }
listupdate.push(object) listupdate.push(object)
}); });
return listupdate
return listupdate.filter( e=> typeof e.docId == 'number')
/* return documents.map((e) => { /* return documents.map((e) => {
return { return {
docId: e.docId, 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) { async loadEventosParaAprovacao(tracing?: TracingType) {
this.showLoaderNum++ this.showLoaderNum++
console.log('PR') console.log('PR')
@@ -136,7 +136,8 @@ export class EditEventToApprovePage implements OnInit {
private toastService: ToastService, private toastService: ToastService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
public httpErrorHandler: HttpErrorHandle, public httpErrorHandler: HttpErrorHandle,
private agendaDataRepository: AgendaDataRepositoryService private agendaDataRepository: AgendaDataRepositoryService,
private httpErroHalde: HttpErrorHandle,
) { ) {
this.isEventEdited = false; this.isEventEdited = false;
} }
@@ -153,21 +154,27 @@ export class EditEventToApprovePage implements OnInit {
} }
async getTask() {
const res: any = await this.agendaDataRepository.getEventToApproveById(this.serialNumber) async getTask(tracing?: TracingType) {
const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber)
if(res.isOk()) {
console.log('evento to apro to edit', res.value) console.log('evento to apro to edit', res.value)
this.eventProcess = res.value; this.eventProcess = res.value as any;
this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence) this.eventProcess.workflowInstanceDataFields.LastOccurrence = new Date(this.eventProcess.workflowInstanceDataFields.LastOccurrence)
this.restoreDatepickerData() this.restoreDatepickerData()
// description // 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)
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.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
this.loadedAttachments = res.value.Attachments; this.loadedAttachments = res.value.Attachments;
console.log(this.loadedAttachments) console.log(this.loadedAttachments)
@@ -175,6 +182,14 @@ export class EditEventToApprovePage implements OnInit {
this.setOtherData() this.setOtherData()
this.saveTemporaryData() this.saveTemporaryData()
tracing.setAttribute('outcome', 'success')
} else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
this.httpErroHalde.httpStatusHandle(res.error)
}
} }
getRecurrenceTypes() { getRecurrenceTypes() {
@@ -285,6 +285,7 @@
</ion-label> </ion-label>
</div> </div>
<div class="d-flex container-div width-100" > <div class="d-flex container-div width-100" >
<ion-list class="width-100 "> <ion-list class="width-100 ">
<ion-item class="width-100" *ngFor="let document of loadedAttachments; let i = index"> <ion-item class="width-100" *ngFor="let document of loadedAttachments; let i = index">
@@ -149,7 +149,8 @@ export class EditEventToApproveComponent implements OnInit {
}) })
}, 1000); }, 1000);
async getTask() { @XTracerAsync({name:'mobile/loadEventToApproveDetails', bugPrint: true})
async getTask(tracing?: TracingType) {
/* const result = await this.processes.GetTask(this.serialNumber).toPromise(); */ /* const result = await this.processes.GetTask(this.serialNumber).toPromise(); */
const res = await this.agendaDataRepository.getEventToApproveById(this.serialNumber) 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); this.endDate = new Date(this.eventProcess.workflowInstanceDataFields.EndDate);
// description // description
try {
let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '') let body: any = this.eventProcess.workflowInstanceDataFields.Body.replace(/<[^>]+>/g, '')
this.eventProcess.workflowInstanceDataFields.Body = body this.eventProcess.workflowInstanceDataFields.Body = body
} catch (error) {}
this.Location = this.eventProcess.workflowInstanceDataFields.Location this.Location = this.eventProcess.workflowInstanceDataFields.Location
this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId this.InstanceId = this.eventProcess.workflowInstanceDataFields.InstanceId
@@ -189,7 +195,10 @@ export class EditEventToApproveComponent implements OnInit {
} }
}) })
tracing.setAttribute('outcome', 'success')
} else { } else {
tracing.setAttribute('outcome', 'failed')
tracing.bugFlag()
this.httpErroHalde.httpStatusHandle(res.error) this.httpErroHalde.httpStatusHandle(res.error)
} }
+6 -6
View File
@@ -1,11 +1,11 @@
export let versionData = { export let versionData = {
"shortSHA": "536548af0", "shortSHA": "e1914505f",
"SHA": "536548af0c7696fdc7384057cf856163459fe374", "SHA": "e1914505f2e3ab233df288f980a028ecbcf1e2ed",
"branch": "feature/agenda-api-peter", "branch": "feature/agenda-api-peter",
"lastCommitAuthor": "'Peter Maquiran'", "lastCommitAuthor": "'Peter Maquiran'",
"lastCommitTime": "'Sat Jun 22 13:28:14 2024 +0100'", "lastCommitTime": "'Sat Jun 22 21:51:40 2024 +0100'",
"lastCommitMessage": "ITOTEAM-525 send the rigth category and ownertype", "lastCommitMessage": "ITOTEAM-525 no mobile ao adicionar attachments aparece um sem título",
"lastCommitNumber": "5837", "lastCommitNumber": "5838",
"changeStatus": "On branch feature/agenda-api-peter\nYour branch is up to date with 'origin/feature/agenda-api-peter'.\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/interceptors/metter.interceptor.ts\n\tmodified: src/app/modals/view-event/view-event.page.ts\n\tmodified: src/app/pages/agenda/agenda.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/services/Repositorys/Agenda/agenda-data-repository.service.ts\n\tnew file: src/app/services/Repositorys/Agenda/model/addAttachmentDTOInput.ts\n\tmodified: src/app/services/Repositorys/Agenda/utils.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts", "changeStatus": "On branch feature/agenda-api-peter\nYour branch is ahead of 'origin/feature/agenda-api-peter' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/modals/profile/profile.page.ts\n\tmodified: src/app/modals/view-event/view-event.page.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/agenda/view-event/view-event.page.ts\n\tmodified: src/app/services/Repositorys/Agenda/model/addAttachmentDTOInput.ts\n\tmodified: src/app/services/Repositorys/Agenda/utils.ts\n\tmodified: src/app/services/task.service.ts\n\tmodified: src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.html\n\tmodified: src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page.ts\n\tmodified: version/git-version.ts",
"changeAuthor": "peter.maquiran" "changeAuthor": "peter.maquiran"
} }