feat: add view loan (loan collateral tab) (#937)

Fixes: #936
This commit is contained in:
Muskan Khedia
2020-06-28 09:14:58 +05:30
committed by GitHub
parent 222681b916
commit af5f9995f0
7 changed files with 103 additions and 0 deletions
@@ -0,0 +1,24 @@
<div class="container">
<table mat-table [dataSource]="loanDetails.collateral">
<ng-container matColumnDef="type">
<th mat-header-cell *matHeaderCellDef> Type </th>
<td mat-cell *matCellDef="let ele"> {{ ele.type.name }} </td>
</ng-container>
<ng-container matColumnDef="value">
<th mat-header-cell *matHeaderCellDef> Value </th>
<td mat-cell *matCellDef="let ele"> {{ ele.value }} </td>
</ng-container>
<ng-container matColumnDef="description">
<th mat-header-cell *matHeaderCellDef> Description </th>
<td mat-cell *matCellDef="let ele"> {{ ele.description }} </td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
</div>
@@ -0,0 +1,8 @@
table {
width: 100%;
margin: 3% 0%;
}
.container {
padding-bottom: 2%;
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { LoanCollateralTabComponent } from './loan-collateral-tab.component';
describe('LoanCollateralTabComponent', () => {
let component: LoanCollateralTabComponent;
let fixture: ComponentFixture<LoanCollateralTabComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanCollateralTabComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(LoanCollateralTabComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,29 @@
import { Component, OnInit } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'mifosx-loan-collateral-tab',
templateUrl: './loan-collateral-tab.component.html',
styleUrls: ['./loan-collateral-tab.component.scss']
})
export class LoanCollateralTabComponent implements OnInit {
/** Loan Details */
loanDetails: any;
/** Columns to be displayed in collateral table. */
displayedColumns: string[] = ['type', 'value', 'description'];
/**
* Retrieves the loans data from `resolve`.
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute) {
this.route.data.subscribe((data: { loanDetailsAssociationData: any }) => {
this.loanDetails = data.loanDetailsAssociationData;
});
}
ngOnInit() {
}
}
@@ -71,6 +71,12 @@
Transactions
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.collateral">
<a mat-tab-link [routerLink]="['./loan-collateral']" routerLinkActive #loanCollateralDetails="routerLinkActive"
[active]="loanCollateralDetails.isActive">
Loan Collateral Details
</a>
</ng-container>
<ng-container *ngIf="loanDetailsData.multiDisburseLoan">
<a mat-tab-link [routerLink]="['./loan-tranche-details']" routerLinkActive #loanTrancheDetails="routerLinkActive" [active]="loanTrancheDetails.isActive">
Loan Tranche Details