/** Angular Imports */ import { Component , OnInit } from '@angular/core' ; import { ActivatedRoute , Router } from '@angular/router' ; import { MatDialog } from '@angular/material/dialog' ; /** Custom Services */ import { SystemService } from 'app/system/system.service' ; /** Custom Components */ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component' ; /**
 * View Report Component.
 */ @ Component ( { selector : 'mifosx-view-report' , templateUrl : './view-report.component.html' , styleUrls : [ './view-report.component.scss' ] } ) export class ViewReportComponent implements OnInit { /** Report Data. */ reportData : any ; param { ActivatedRoute } route param { SystemService } systemService param { MatDialog } dialog param { Router } router constructor ( private route , private systemService , private dialog , private router ) { this . route . data . subscribe ( ( data ) => { this . reportData = data . report ; } ) ; } ngOnInit ( ) { } /**
     * Deletes the current report.
     */ delete ( ) { const deleteReportDialogRef = this . dialog . open ( DeleteDialogComponent , { data : { deleteContext : `report ${ this . reportData . id }` } } ) ; deleteReportDialogRef . afterClosed ( ) . subscribe ( ( response ) => { if ( response . delete ) { this . systemService . deleteReport ( this . reportData . id ) . subscribe ( ( ) => { this . router . navigate ( [ '/system/reports' ] ) ; } ) ; } } ) ; } }