diff --git a/src/app/modals/create-process/create-process.page.ts b/src/app/modals/create-process/create-process.page.ts index 4a6c637b3..167438fc8 100644 --- a/src/app/modals/create-process/create-process.page.ts +++ b/src/app/modals/create-process/create-process.page.ts @@ -318,7 +318,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDespatcho(this.postData).toPromise(); - this.executado(loader, 'Despacho criado'); + await this.executado(loader, 'Despacho criado'); } catch (error) { this.toastService.badRequest('Processo não efectuado'); } @@ -337,7 +337,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postParecer(this.postData).toPromise(); - this.executado(loader); + await this.executado(loader); this.toastService.successMessage('Pedido de Parecer criado'); } catch (error) { @@ -358,7 +358,7 @@ export class CreateProcessPage implements OnInit { try { await this.processes.postDeferimento(this.postData).toPromise(); - this.executado(loader); + await this.executado(loader); this.toastService.successMessage('Pedido de Deferimento criado'); } catch (error) { diff --git a/src/app/modals/dar-parecer/dar-parecer.page.ts b/src/app/modals/dar-parecer/dar-parecer.page.ts index f30737ada..40c21b007 100644 --- a/src/app/modals/dar-parecer/dar-parecer.page.ts +++ b/src/app/modals/dar-parecer/dar-parecer.page.ts @@ -31,7 +31,7 @@ export class DarParecerPage implements OnInit { ngOnInit() { console.log(this.serialNumber - ); + ); } @@ -79,7 +79,7 @@ export class DarParecerPage implements OnInit { this.documents = this.documents.filter( (e, i) => index != i); } - async getDoc(){ + async getDoc() { const modal = await this.modalController.create({ component: SearchPage, cssClass: 'modal-width-100-width-background modal', diff --git a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts index 2493ce2ff..9ec489bbb 100644 --- a/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts +++ b/src/app/pages/agenda/event-actions-popover/event-actions-popover.page.ts @@ -56,13 +56,13 @@ export class EventActionsPopoverPage implements OnInit { this.popoverController.dismiss(); } - approveTask() { + async approveTask() { let body = { "serialNumber": this.serialNumber, "action": "Aprovar" } console.log(body); const loader = this.toastService.loading() try { - this.processes.PostTaskAction(body).toPromise() + await this.processes.PostTaskAction(body).toPromise() this.toastService.successMessage(); this.goBack(); @@ -127,7 +127,7 @@ export class EventActionsPopoverPage implements OnInit { const loader = this.toastService.loading() try { - this.processes.PostTaskAction(body).toPromise(); + await this.processes.PostTaskAction(body).toPromise(); await this.toastService.successMessage('Processo rejeitado'); this.goBack(); } catch (error) { diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 65c1d9c4f..18000b959 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -335,7 +335,7 @@ export class DespachoPrPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then( async (res) => { console.log(res); if(res.data){ @@ -354,19 +354,19 @@ export class DespachoPrPage implements OnInit { } if(actionName == 'Executado'){ - this.executado(res.data.note, docs); + await this.executado(res.data.note, docs); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); } else if(actionName == 'Gerar Diploma'){ - this.generateDiploma(res.data.note, docs); + await this.generateDiploma(res.data.note, docs); } else if(actionName == 'Concluido'){ - this.concluir(res.data.note, docs); + await this.concluir(res.data.note, docs); } else if(actionName == 'Reexecução'){ - this.reexecutar(res.data.note, docs); + await this.reexecutar(res.data.note, docs); } this.goBack(); } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 21033918d..9f0a81cf1 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -306,7 +306,7 @@ export class DespachoPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then( async (res) => { if(res.data){ const DocumentToSave = res.data.documents.map((e) => { @@ -323,14 +323,14 @@ export class DespachoPage implements OnInit { if(actionName == 'Executado'){ - this.executado(res.data.note, docs); + await this.executado(res.data.note, docs); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); this.goBack(); } else if(actionName == 'Reexecução'){ - this.reexecute(res.data.note, docs); + await this.reexecute(res.data.note, docs); this.goBack(); } } diff --git a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts index fe4e13cbb..ee8a5cf89 100644 --- a/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts +++ b/src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts @@ -253,7 +253,7 @@ export class DiplomaPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { if(res.data){ @@ -271,15 +271,15 @@ export class DiplomaPage implements OnInit { if(actionName == 'Solicitar assinatura'){ - this.askSignature(res.data.note, docs); + await this.askSignature(res.data.note, docs); this.goBack(); } else if(actionName == 'Solicitar alteração'){ - this.askToChange(res.data.note, docs); + await this.askToChange(res.data.note, docs); this.goBack(); } else if(actionName == 'Concluir diploma'){ - this.finish(res.data.note, docs); + await this.finish(res.data.note, docs); this.goBack(); } } 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 3420657e9..510fda3a4 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 @@ -177,7 +177,7 @@ export class ApproveEventPage implements OnInit { console.log(body); const loader = this.toastService.loading() try { - this.processes.PostTaskAction(body).toPromise(); + await this.processes.PostTaskAction(body).toPromise(); await this.toastService.successMessage('Processo rejeitado'); this.goBack(); } catch (error) { diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index 4d3c157e5..a9984270c 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -22,6 +22,7 @@ import { User } from 'src/app/models/user.model'; import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.page'; import { ToastService } from 'src/app/services/toast.service'; import { ForwardPage } from 'src/app/modals/forward/forward.page'; +import { async } from '@angular/core/testing'; @Component({ selector: 'app-pedido', @@ -76,7 +77,7 @@ export class PedidoPage implements OnInit { this.LoadTaskDetail(this.serialnumber); } - close(){ + close() { this.modalController.dismiss(); } notImplemented(){ @@ -437,8 +438,8 @@ export class PedidoPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { - const DocumentToSave = res.data.documents.map((e) => { + modal.onDidDismiss().then( async (res) => { + const DocumentToSave = await res.data.documents.map( async (e) => { return { ApplicationId: e.ApplicationType, SourceId: e.Id, @@ -451,15 +452,15 @@ export class PedidoPage implements OnInit { if(res.data){ if(actionName == 'Solicitar Reapreciação') { - this.repreciar(res.data.note, docs); + await this.repreciar(res.data.note, docs); this.goBack(); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); this.goBack(); } else if(actionName == 'Assignar'){ - this.assignar(res.data.note, docs); + await this.assignar(res.data.note, docs); } } }); diff --git a/src/app/shared/popover/deploma-options/deploma-options.page.ts b/src/app/shared/popover/deploma-options/deploma-options.page.ts index 61048f164..e2d36dfd9 100644 --- a/src/app/shared/popover/deploma-options/deploma-options.page.ts +++ b/src/app/shared/popover/deploma-options/deploma-options.page.ts @@ -55,7 +55,7 @@ export class DeplomaOptionsPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { if(res.data){ @@ -73,11 +73,11 @@ export class DeplomaOptionsPage implements OnInit { if(actionName == 'Solicitar assinatura'){ - this.askSignature(res.data.note, docs); + await this.askSignature(res.data.note, docs); this.goBack(); } else if(actionName == 'Solicitar alteração'){ - this.askToChange(res.data.note, docs); + await this.askToChange(res.data.note, docs); this.goBack(); } } diff --git a/src/app/shared/popover/despachos-options/despachos-options.page.ts b/src/app/shared/popover/despachos-options/despachos-options.page.ts index db3a9c652..52753528f 100644 --- a/src/app/shared/popover/despachos-options/despachos-options.page.ts +++ b/src/app/shared/popover/despachos-options/despachos-options.page.ts @@ -178,7 +178,7 @@ export class DespachosOptionsPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { console.log(res); if(res.data) { @@ -195,19 +195,19 @@ export class DespachosOptionsPage implements OnInit { } if(actionName == 'Executado'){ - this.executado(res.data.note, docs); + await this.executado(res.data.note, docs); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); } else if(actionName == 'Gerar Diploma'){ - this.generateDiploma(res.data.note, docs); + await this.generateDiploma(res.data.note, docs); } else if(actionName == 'Concluido'){ //this.concluir(res.data.note, docs); } else if(actionName == 'Reexecução'){ - this.reexecutar(res.data.note, docs); + await this.reexecutar(res.data.note, docs); } this.goBack(); } diff --git a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts index c57149f41..5747797be 100644 --- a/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts +++ b/src/app/shared/popover/despachos-pr-options/despachos-pr-options.page.ts @@ -211,7 +211,7 @@ export class DespachosPrOptionsPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { console.log(res); if(res.data){ @@ -230,19 +230,19 @@ export class DespachosPrOptionsPage implements OnInit { } if(actionName == 'Executado'){ - this.executado(res.data.note, docs); + await this.executado(res.data.note, docs); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); } else if(actionName == 'Gerar Diploma'){ - this.generateDiploma(res.data.note, docs); + await this.generateDiploma(res.data.note, docs); } else if(actionName == 'Concluido'){ //this.concluir(res.data.note, docs); } else if(actionName == 'Reexecução'){ - this.reexecutar(res.data.note, docs); + await this.reexecutar(res.data.note, docs); } this.goBack(); } diff --git a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts index e9edd30f1..cc1a79208 100644 --- a/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts +++ b/src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page.ts @@ -90,7 +90,7 @@ export class OptsExpedientePrPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { console.log(res); if(res.data){ const DocumentToSave = res.data.documents.map((e) => { @@ -106,10 +106,10 @@ export class OptsExpedientePrPage implements OnInit { } if(actionName == 'Aprovar'){ - this.approve(res.data.note, docs); + await this.approve(res.data.note, docs); } else if(actionName == 'Revisão'){ - this.sendToReview(res.data.note, docs); + await this.sendToReview(res.data.note, docs); } this.goBack(); } diff --git a/src/app/shared/popover/request-options/request-options.page.ts b/src/app/shared/popover/request-options/request-options.page.ts index b063e55d6..aff65ac08 100644 --- a/src/app/shared/popover/request-options/request-options.page.ts +++ b/src/app/shared/popover/request-options/request-options.page.ts @@ -199,7 +199,7 @@ export class RequestOptionsPage implements OnInit { await modal.present(); - modal.onDidDismiss().then(res => { + modal.onDidDismiss().then(async (res) => { const DocumentToSave = res.data.documents.map((e) => { @@ -218,10 +218,10 @@ export class RequestOptionsPage implements OnInit { if(res.data){ if(actionName == 'Solicitar Reapreciação') { - this.repreciar(res.data.note, docs); + await this.repreciar(res.data.note, docs); } else if(actionName == 'Arquivar'){ - this.arquivar(res.data.note, docs); + await this.arquivar(res.data.note, docs); } } });