feat: add loan button (undo-approval) (#860)

Fixes: #858
This commit is contained in:
Benura Abeywardena
2020-06-11 01:18:12 +05:30
committed by GitHub
parent 8503dc6d97
commit fb52d3cf21
8 changed files with 113 additions and 2 deletions
@@ -1,6 +1,10 @@
import { Component, OnInit } from '@angular/core';
/** Angular Imports. */
import { Component } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
/**
* Loan Account Actions component.
*/
@Component({
selector: 'mifosx-loan-account-actions',
templateUrl: './loan-account-actions.component.html',
@@ -9,11 +13,18 @@ import { ActivatedRoute, Router } from '@angular/router';
export class LoanAccountActionsComponent {
/** flag object to store possible actions and render appropriate UI to the user */
actions: { close: boolean } = { close: false };
actions: { close: boolean, undo_approval: boolean } = { close: false, undo_approval: false };
/**
* @param router Router.
* @param route Activated Route.
*/
constructor(private router: Router,
private route: ActivatedRoute) {
this.route.params.subscribe(params => {
if (params['action'].indexOf('-') > 0) {
this.actions[params['action'].replace('-', '_')] = true;
}
this.actions[params['action']] = true;
});
}