From d5a54c00ab547db1bd73818745730fd9cd64cd8d Mon Sep 17 00:00:00 2001
From: 5Amogh <amoghavarsh@navadhiti.com>
Date: Tue, 15 Nov 2022 16:27:39 +0530
Subject: [PATCH] Issue #RRHE-52 feat:status filter in program dashboard

---
 .../program-datasets/program-datasets.component.ts       | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts b/src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
index b16c1f4594..a4c94b2137 100644
--- a/src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
+++ b/src/app/client/src/app/modules/program-dashboard/components/program-datasets/program-datasets.component.ts
@@ -546,6 +546,8 @@ export class DatasetsComponent implements OnInit, OnDestroy {
     this.reportForm.controls.districtName.setValue($event.value);
     this.displayFilters['District'] = [$event?.source?.triggerValue]
     this.tag =  _.get(this.reportForm, 'controls.solution.value')+ '_' + this.userId+'_'+ _.toLower(_.trim([$event?.source?.triggerValue]," "));
+    this.reportForm.controls.reportType.setValue('');
+    this.resetConfigFilters();
     this.loadReports();
   }
 
@@ -621,6 +623,8 @@ export class DatasetsComponent implements OnInit, OnDestroy {
       this.pdFilters.map(filter => {
         if(filter['controlType'] === 'number'){
           this.configuredFilters[filter['reference']] = filter['defaultValue'] as number -1
+        }else if(filter['controlType'] === 'multi-select'){
+          this.configuredFilters[filter['reference']] = undefined
         }
       })
     }
@@ -646,6 +650,11 @@ export class DatasetsComponent implements OnInit, OnDestroy {
   }
 
   addFilters() {
+    this.pdFilters.map(filter => {
+     if(filter['controlType'] === 'multi-select' && this.configuredFilters[filter['reference']] === undefined){
+      this.configuredFilters[filter['reference']] = filter['options']
+      }
+    })
     let filterKeysObj = {
       program_id: _.get(this.reportForm, 'controls.programName.value'),
       solution_id: _.get(this.reportForm, 'controls.solution.value'),
-- 
GitLab