feat: add loan button (assign/change loan officer) (#867)

Fixes: #248
This commit is contained in:
Muskan Khedia
2020-06-13 00:23:40 +05:30
committed by GitHub
parent 5729887a62
commit de701543e1
13 changed files with 218 additions and 11 deletions
@@ -13,7 +13,14 @@ 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, undo_approval: boolean } = { close: false, undo_approval: false };
actions: { close: boolean,
undo_approval: boolean,
assign_loan_officer: boolean } = {
close: false,
undo_approval: false,
assign_loan_officer: false };
actionButtonData: any;
actionName: any;
/**
* @param router Router.
@@ -21,11 +28,16 @@ export class LoanAccountActionsComponent {
*/
constructor(private router: Router,
private route: ActivatedRoute) {
this.route.data.subscribe(( data: { actionButtonData: any }) => {
this.actionButtonData = data.actionButtonData;
});
this.route.params.subscribe(params => {
if (params['action'].indexOf('-') > 0) {
this.actions[params['action'].replace('-', '_')] = true;
this.actionName = params['action'];
if (this.actionName === 'change-loan-officer') {
this.actionName = 'assign-loan-officer';
}
this.actions[params['action']] = true;
this.actions[this.actionName.replace(/-/g, '_')] = true;
});
}