/** Angular Imports */ import { Component , OnInit , ViewChild } from '@angular/core' ; import { ActivatedRoute } from '@angular/router' ; import { MatPaginator } from '@angular/material/paginator' ; import { MatSort } from '@angular/material/sort' ; import { MatTableDataSource } from '@angular/material/table' ; /**
 * Manage Reports Component.
 */ @ Component ( { selector : 'mifosx-manage-reports' , templateUrl : './manage-reports.component.html' , styleUrls : [ './manage-reports.component.scss' ] } ) export class ManageReportsComponent implements OnInit { /** Reports Data. */ reportsData : any ; /** Columns to be displayed in reports table. */ displayedColumns : string [ ] = [ 'reportName' , 'reportType' , 'reportSubType' , 'reportCategory' , 'coreReport' , 'userReport' ] ; /** Data source for reports table. */ dataSource : MatTableDataSource < any > ; /** Paginator for reports table. */ @ ViewChild ( MatPaginator , { static : true } ) paginator : MatPaginator ; /** Sorter for reports table. */ @ ViewChild ( MatSort , { static : true } ) sort : MatSort ; param { ActivatedRoute } route constructor ( private route ) { this . route . data . subscribe ( ( data ) => { this . reportsData = data . reports ; } ) ; } /**
     * Sets the reports table.
     */ ngOnInit ( ) { this . setReports ( ) ; } /**
     * Initializes the data source, paginator and sorter for reports table.
     */ setReports ( ) { this . dataSource = new MatTableDataSource ( this . reportsData ) ; this . dataSource . paginator = this . paginator ; this . dataSource . sort = this . sort ; } param { string } filterValue applyFilter ( filterValue ) { this . dataSource . filter = filterValue . trim ( ) . toLowerCase ( ) ; } }