From e2d261521049082b02d5639830d262f78073c04c Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Sat, 11 Dec 2021 17:10:25 +0100 Subject: [PATCH] Fix Anexar Documentos button --- .../expediente-detail/expediente-detail.page.ts | 3 ++- src/app/pages/search/search.page.ts | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts index 8c3da2e24..c98925dfc 100644 --- a/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts +++ b/src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts @@ -434,7 +434,8 @@ export class ExpedienteDetailPage implements OnInit { componentProps: { type: 'AccoesPresidenciais & ArquivoDespachoElect', showSearchInput: true, - select: true + select: true, + findOnly: [8] } }); await modal.present(); diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index 3963f7fad..73c6df583 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -53,6 +53,7 @@ export class SearchPage implements OnInit { type : "Agenda" | "Correspondencia" | "AccoesPresidenciais" | "ArquivoDespachoElect" | "AccoesPresidenciais & ArquivoDespachoElect" = "Agenda"; select: boolean = false; + findOnly = [] showSearchInput = false @@ -69,6 +70,7 @@ export class SearchPage implements OnInit { this.type = this.navParams.get('type'); this.select = this.navParams.get('select'); + this.findOnly = this.navParams.get('findOnly') this.showSearchInput = this.navParams.get('showSearchInput'); @@ -199,6 +201,12 @@ export class SearchPage implements OnInit { } else { this.showSearchDocuments = this.sortArrayISODate(this.searchDocuments) } + + + if(this.findOnly.length >= 1) { + this.showSearchDocuments = this.showSearchDocuments.filter((e)=> this.findOnly.includes(e.ApplicationType)) + } + } sortArrayISODate(myArray: any) { @@ -528,10 +536,10 @@ export class SearchPage implements OnInit { } - async filterDocList(categoryName:string){ + async filterDocList(categoryName:string) { // show all category - if(this. showCategory == categoryName ){ + if(this. showCategory == categoryName ) { this.showSearchDocuments = this.searchDocuments;