Commit c7c7f420 authored by 5Amogh's avatar 5Amogh
Browse files

flushing the configurable filters related data on change of report type,...

flushing the configurable filters related data on change of report type, resource, program or on resetting of all filters
Showing with 9 additions and 0 deletions
+9 -0
......@@ -252,6 +252,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
this.solutions = [];
this.reportTypes = [];
this.onDemandReportData = [];
this.resetConfigFilters();
this.getSolutionList(program[0]);
this.displayFilters['Program'] = [program[0].name]
this.reportForm.controls.programName.setValue($event.value);
......@@ -264,6 +265,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
this.noResult = false;
this.districts = []
this.organisations = [];
this.resetConfigFilters();
this.globalDistrict = this.globalOrg = undefined;
if (this.programSelected && this.reportForm.value && this.reportForm.value['solution']) {
const solution = this.solutions.filter(data => {
......@@ -520,6 +522,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
this.showPopUpModal = true;
this.globalDistrict = this.globalOrg = undefined;
this.timeRangeInit();
this.resetConfigFilters();
}
loadReports() {
......@@ -546,6 +549,7 @@ export class DatasetsComponent implements OnInit, OnDestroy {
}
reportChanged(selectedReportData) {
this.resetConfigFilters();
this.selectedReport = selectedReportData;
if(this.selectedReport.configurableFilters){
this.pdFilters = this.selectedReport.uiFilters;
......@@ -554,6 +558,11 @@ export class DatasetsComponent implements OnInit, OnDestroy {
})
}
}
resetConfigFilters(){
this.pdFilters = [];
this.configuredFilters = {};
}
pdFilterChanged($event){
const [reference, value]= [Object.keys($event),Object.values($event)] ;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment