diff --git a/src/app/pipes/status-lookup.pipe.ts b/src/app/pipes/status-lookup.pipe.ts
index d53215c2b..f58871b43 100644
--- a/src/app/pipes/status-lookup.pipe.ts
+++ b/src/app/pipes/status-lookup.pipe.ts
@@ -25,6 +25,8 @@ export class StatusLookupPipe implements PipeTransform {
'shareAccountStatusType.approved': 'status-approved',
'shareAccountStatusType.active': 'status-active',
'shareAccountStatusType.rejected': 'status-rejected',
+ 'loanProduct.active': 'status-active',
+ 'loanProduct.inActive': 'status-inactive'
};
return cssClassNameLookup[status];
}
diff --git a/src/app/products/loan-products/loan-products.component.html b/src/app/products/loan-products/loan-products.component.html
new file mode 100644
index 000000000..f247c36c7
--- /dev/null
+++ b/src/app/products/loan-products/loan-products.component.html
@@ -0,0 +1,54 @@
+
+
+
+
+
+
+
+
+ Filter
+
+
+
+
+
+
+
+
+
+ | Name |
+ {{ loanProduct.name }} |
+
+
+
+ Short Name |
+ {{ loanProduct.shortName }} |
+
+
+
+ Expiry Date |
+ {{ loanProduct.closeDate | date }} |
+
+
+
+ Status |
+
+
+
+
+ |
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/products/loan-products/loan-products.component.scss b/src/app/products/loan-products/loan-products.component.scss
new file mode 100644
index 000000000..1922e7ffa
--- /dev/null
+++ b/src/app/products/loan-products/loan-products.component.scss
@@ -0,0 +1,3 @@
+table {
+ width: 100%;
+}
diff --git a/src/app/products/loan-products/loan-products.component.spec.ts b/src/app/products/loan-products/loan-products.component.spec.ts
new file mode 100644
index 000000000..ba07bf46d
--- /dev/null
+++ b/src/app/products/loan-products/loan-products.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { LoanProductsComponent } from './loan-products.component';
+
+describe('LoanProductsComponent', () => {
+ let component: LoanProductsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ LoanProductsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(LoanProductsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/products/loan-products/loan-products.component.ts b/src/app/products/loan-products/loan-products.component.ts
new file mode 100644
index 000000000..347716caf
--- /dev/null
+++ b/src/app/products/loan-products/loan-products.component.ts
@@ -0,0 +1,36 @@
+/** Angular Imports */
+import { Component, OnInit, ViewChild } from '@angular/core';
+import { MatPaginator, MatSort, MatTableDataSource } from '@angular/material';
+import { ActivatedRoute } from '@angular/router';
+
+@Component({
+ selector: 'mifosx-loan-products',
+ templateUrl: './loan-products.component.html',
+ styleUrls: ['./loan-products.component.scss']
+})
+export class LoanProductsComponent implements OnInit {
+
+ loanProductsData: any;
+ displayedColumns: string[] = ['name', 'shortName', 'closeDate', 'status'];
+ dataSource: MatTableDataSource;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+ @ViewChild(MatSort) sort: MatSort;
+
+ constructor(private route: ActivatedRoute) {
+ this.route.data.subscribe((data: { loanProducts: any }) => {
+ this.loanProductsData = data.loanProducts;
+ });
+ }
+
+ ngOnInit() {
+ this.dataSource = new MatTableDataSource(this.loanProductsData);
+ this.dataSource.paginator = this.paginator;
+ this.dataSource.sort = this.sort;
+ }
+
+ applyFilter(filterValue: string) {
+ this.dataSource.filter = filterValue.trim().toLowerCase();
+ }
+
+}
diff --git a/src/app/products/loan-products/loan-products.resolver.ts b/src/app/products/loan-products/loan-products.resolver.ts
new file mode 100644
index 000000000..9ba2cd1ba
--- /dev/null
+++ b/src/app/products/loan-products/loan-products.resolver.ts
@@ -0,0 +1,31 @@
+/** Angular Imports */
+import { Injectable } from '@angular/core';
+import { Resolve } from '@angular/router';
+
+/** rxjs Imports */
+import { Observable } from 'rxjs';
+
+/** Custom Services */
+import { ProductsService } from '../products.service';
+
+/**
+ * Loan products data resolver.
+ */
+@Injectable()
+export class LoanProductsResolver implements Resolve