Skip to content

Commit

Permalink
Merge pull request #8333 from 5Amogh/hotfix_vam
Browse files Browse the repository at this point in the history
Hotfix: Loading and requesting the reports based on district filters
  • Loading branch information
Rajesh Kumaravel authored Oct 25, 2022
2 parents 975117f + 42e64ed commit 8f899c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ <h4 class="textbook__title sb-color-primary font-weight-bold mt-8 ml-24" >{{reso
<mat-datepicker #picker></mat-datepicker>
</mat-form-field>
</div>
<ng-container *ngIf="pdFilters.length">
<ng-container *ngIf="pdFilters.length && tabIndex !== 1 && tabIndex !== 2">
<ng-container *ngFor="let filter of pdFilters">
<app-pd-filters [pdFilter]="filter" (filterChanged)="pdFilterChanged($event)"></app-pd-filters>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -542,9 +542,11 @@ export class DatasetsComponent implements OnInit, OnDestroy {
}

districtSelection($event) {
this.globalDistrict = $event.value
this.globalDistrict = $event.value;
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.loadReports();
}

organisationSelection($event) {
Expand Down Expand Up @@ -645,7 +647,6 @@ export class DatasetsComponent implements OnInit, OnDestroy {
}

});

if (dataFound && dataFound.length > 0) {
this.popup = false;
this.isProcessed = true;
Expand Down Expand Up @@ -707,8 +708,12 @@ export class DatasetsComponent implements OnInit, OnDestroy {
let requestStatus = true;
const selectedReportList = [];
_.forEach(this.onDemandReportData, (value) => {
if (value.datasetConfig.type == this.selectedReport.datasetId && value.datasetConfig.params.solutionId == this.selectedSolution) {
selectedReportList.push(value);
if (value.datasetConfig.type == this.selectedReport.datasetId){
_.forEach(value.datasetConfig.params.filters, (filter) => {
if(['solutionId','solution_id'].includes(filter['dimension']) && filter.value === this.selectedSolution){
selectedReportList.push(value);
}
});
}
});
const sortedReportList = _.sortBy(selectedReportList, [(data) => {
Expand Down

0 comments on commit 8f899c3

Please sign in to comment.