From ed9fa5829f39facb2d821941ce2f70d3facc914c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eudes=20In=C3=A1cio?= Date: Wed, 8 Dec 2021 19:39:30 +0100 Subject: [PATCH] inprove image quality on publications and envent to aprove offline --- .../approve-event/approve-event.page.ts | 6 ++- .../event-list/event-list.page.html | 12 +++--- .../event-list/event-list.page.ts | 40 +++++++++++++++++-- .../new-publication/new-publication.page.ts | 8 ++-- .../view-publications.page.ts | 1 + 5 files changed, 51 insertions(+), 16 deletions(-) diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index 6ed90e273..c1d208921 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -109,9 +109,10 @@ export class ApproveEventPage implements OnInit { } addProcessToDB(data) { - this.platform.ready().then(() => { + if (this.platform.is('desktop') || this.platform.is('mobileweb')) { + } else { this.sqliteservice.updateProcess(data); - }); + } } getProcessFromDB() { @@ -186,6 +187,7 @@ export class ApproveEventPage implements OnInit { this.processes.GetTask(this.serialNumber).subscribe(async res => { this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise(); + this.addProcessToDB(this.loadedEvent) console.log(this.loadedEvent); this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.html b/src/app/pages/gabinete-digital/event-list/event-list.page.html index cb2a24d8f..5d2d63013 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.html +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.html @@ -38,10 +38,10 @@
-
+
+ *ngFor="let event of eventsMDGPRList" (click)="goToEventToApproveDetail(event.serialNumber)">
@@ -61,10 +61,10 @@ -
+
+ *ngFor="let event of eventsPRList" (click)="goToEventToApproveDetail(event.serialNumber)">

{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}

@@ -85,7 +85,7 @@
Lista vazia @@ -94,7 +94,7 @@
Lista vazia diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts index aa7a02372..9344d7087 100644 --- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts +++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts @@ -84,18 +84,48 @@ export class EventListPage implements OnInit { this.platform.ready().then(() => { this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[]) => { - this.eventsMDGPRList = this.sortService.sortDate(event, 'taskStartDate') - + + this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') + //this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null) + console.log('MD event to aprove', this.eventsMDGPRList) + }) this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => { - this.eventsPRList = this.sortService.sortDate(event, 'taskStartDate') + this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') + console.log('PR event to aprove', this.eventsPRList) }) }) console.log('Offlineee') } + transformaDataDB(events) { + let MdEventsArray = []; + for (let i of events) { + let eventMD = { + Documents: i.Documents, + actions: i.actions, + activityInstanceName: i.activityInstanceName, + formURL: i.formURL, + interveners: i.interveners, + originator: i.originator, + serialNumber: i.serialNumber, + taskStartDate: i.taskStartDate, + totalDocuments: i.totalDocuments, + workflowDisplayName: i.workflowDisplayName, + workflowID: i.workflowID, + workflowInstanceDataFields: JSON.parse(i.workflowInstanceDataFields), + workflowInstanceFolio: i.workflowInstanceFolio, + workflowInstanceID: i.workflowInstanceID, + workflowName: i.workflowName, + } + + MdEventsArray.push(eventMD); + } + return MdEventsArray; + } + segmentChanged(ev: any) { this.LoadToApproveEvents(); } @@ -111,13 +141,15 @@ export class EventListPage implements OnInit { let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise(); this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal); this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate') + console.log('MD EVENT TO APROVE ONLINE',this.eventsMDGPRList) this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse()); } else if (this.segment == 'PR') { let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise(); let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise(); this.eventsPRList = prEventsOficial.concat(prEventsPessoal); - this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate') + this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate') + console.log('PR EVENT TO APROVE ONLINE',this.eventsPRList) this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse()); } this.showLoader = false; diff --git a/src/app/pages/publications/new-publication/new-publication.page.ts b/src/app/pages/publications/new-publication/new-publication.page.ts index cf37bd3e8..60a6eaa06 100644 --- a/src/app/pages/publications/new-publication/new-publication.page.ts +++ b/src/app/pages/publications/new-publication/new-publication.page.ts @@ -108,7 +108,7 @@ export class NewPublicationPage implements OnInit { async takePicture() { const image = await Camera.getPhoto({ - quality: 20, + quality: 90, allowEditing: false, width:50, height: 50, @@ -398,7 +398,7 @@ export class NewPublicationPage implements OnInit { async selectImage() { const image = await Camera.getPhoto({ - quality: 20, + quality: 90, allowEditing: false, resultType: CameraResultType.Uri, source: CameraSource.Camera // Camera, Photos or Prompt! @@ -521,10 +521,10 @@ export class NewPublicationPage implements OnInit { compressFile() { - //this.imgResultBeforeCompress = image; + //this.imgResultBeforeCompress = image;s this.imageCompress.getOrientation(this.capturedImage).then((orientation) => { console.log('Size in bytes was:', this.imageCompress.byteCount(this.capturedImage)); - this.imageCompress.compressFile(this.capturedImage, orientation, 20, 20).then( + this.imageCompress.compressFile(this.capturedImage, orientation, 90, 90).then( result => { this.capturedImage = result; console.log('Size in bytes is now:', this.imageCompress.byteCount(result)); diff --git a/src/app/pages/publications/view-publications/view-publications.page.ts b/src/app/pages/publications/view-publications/view-publications.page.ts index 8d8839623..3f25ff651 100644 --- a/src/app/pages/publications/view-publications/view-publications.page.ts +++ b/src/app/pages/publications/view-publications/view-publications.page.ts @@ -120,6 +120,7 @@ export class ViewPublicationsPage implements OnInit { setTimeout(() => { let allActions = this.publicationEventFolderStorage.list.concat(this.publicationTravelFolderService.list) + console.log('ACTION ACTION', this.publicationList) this.item = allActions.find((e) => e.ProcessId == this.folderId); this.publicationDitails = this.item console.log('item', this.item)