diff --git a/src/app/products/products-routing.module.ts b/src/app/products/products-routing.module.ts
index f8deb0c99..a7f121c39 100644
--- a/src/app/products/products-routing.module.ts
+++ b/src/app/products/products-routing.module.ts
@@ -18,6 +18,7 @@ import { SavingProductsComponent } from './saving-products/saving-products.compo
import { CreateSavingProductComponent } from './saving-products/create-saving-product/create-saving-product.component';
import { ViewSavingProductComponent } from './saving-products/view-saving-product/view-saving-product.component';
import { EditSavingProductComponent } from './saving-products/edit-saving-product/edit-saving-product.component';
+import { ShareProductsComponent } from './share-products/share-products.component';
import { ManageTaxConfigurationsComponent } from './manage-tax-configurations/manage-tax-configurations.component';
import { RecurringDepositProductsComponent } from './recurring-deposit-products/recurring-deposit-products.component';
import { ChargesComponent } from './charges/charges.component';
@@ -34,6 +35,7 @@ import { SavingProductsResolver } from './saving-products/saving-products.resolv
import { SavingProductsTemplateResolver } from './saving-products/saving-products-template.resolver';
import { SavingProductResolver } from './saving-products/saving-product.resolver';
import { SavingProductAndTemplateResolver } from './saving-products/edit-saving-product/saving-product-and-template.resolver';
+import { ShareProductsResolver } from './share-products/share-products.resolver';
import { RecurringDepositProductsResolver } from './recurring-deposit-products/recurring-deposit-products.resolver';
import { ChargesResolver } from './charges/charges.resolver';
import { FixedDepositProductsResolver } from './fixed-deposit-products/fixed-deposit-products.resolver';
@@ -135,6 +137,19 @@ const routes: Routes = [
}
]
},
+ {
+ path: 'share-products',
+ data: { title: extract('Share Products'), breadcrumb: 'Share Products' },
+ children: [
+ {
+ path: '',
+ component: ShareProductsComponent,
+ resolve: {
+ shareProducts: ShareProductsResolver
+ }
+ }
+ ]
+ },
{
path: 'tax-configurations',
data: { title: extract('Manage Tax Configurations'), breadcrumb: 'Manage Tax Configurations' },
@@ -207,6 +222,7 @@ const routes: Routes = [
SavingProductsTemplateResolver,
SavingProductResolver,
SavingProductAndTemplateResolver,
+ ShareProductsResolver,
RecurringDepositProductsResolver,
ChargesResolver,
FixedDepositProductsResolver,
diff --git a/src/app/products/products.component.html b/src/app/products/products.component.html
index 7cdcda652..30a4637c7 100644
--- a/src/app/products/products.component.html
+++ b/src/app/products/products.component.html
@@ -24,7 +24,7 @@
Add new savings product or modify or inactivate savings product
-
+
diff --git a/src/app/products/products.module.ts b/src/app/products/products.module.ts
index 6425707d8..4e3aa54a2 100644
--- a/src/app/products/products.module.ts
+++ b/src/app/products/products.module.ts
@@ -37,6 +37,7 @@ import { SavingProductPreviewStepComponent } from './saving-products/saving-prod
import { CreateSavingProductComponent } from './saving-products/create-saving-product/create-saving-product.component';
import { ViewSavingProductComponent } from './saving-products/view-saving-product/view-saving-product.component';
import { EditSavingProductComponent } from './saving-products/edit-saving-product/edit-saving-product.component';
+import { ShareProductsComponent } from './share-products/share-products.component';
/**
* Products Module
@@ -78,7 +79,8 @@ import { EditSavingProductComponent } from './saving-products/edit-saving-produc
SavingProductPreviewStepComponent,
CreateSavingProductComponent,
ViewSavingProductComponent,
- EditSavingProductComponent
+ EditSavingProductComponent,
+ ShareProductsComponent
],
entryComponents: [
],
diff --git a/src/app/products/products.service.ts b/src/app/products/products.service.ts
index 478783c08..226ad60e1 100644
--- a/src/app/products/products.service.ts
+++ b/src/app/products/products.service.ts
@@ -66,6 +66,13 @@ export class ProductsService {
return this.http.put(`/savingsproducts/${savingProductId}`, savingProduct);
}
+ /**
+ * @returns {Observable} Share products data
+ */
+ getShareProducts(): Observable {
+ return this.http.get('/products/share');
+ }
+
/**
* @returns {Observable} Recurring deposit products data
*/
diff --git a/src/app/products/share-products/share-products.component.html b/src/app/products/share-products/share-products.component.html
new file mode 100644
index 000000000..2bd1af9cf
--- /dev/null
+++ b/src/app/products/share-products/share-products.component.html
@@ -0,0 +1,45 @@
+
+
+
+
+
+
+
+
+ Filter
+
+
+
+
+
+
+
+
+
+ | Name |
+ {{ shareProduct.name }} |
+
+
+
+ Short Name |
+ {{ shareProduct.shortName }} |
+
+
+
+ Total Shares |
+ {{ shareProduct.totalShares }} |
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/app/products/share-products/share-products.component.scss b/src/app/products/share-products/share-products.component.scss
new file mode 100644
index 000000000..1922e7ffa
--- /dev/null
+++ b/src/app/products/share-products/share-products.component.scss
@@ -0,0 +1,3 @@
+table {
+ width: 100%;
+}
diff --git a/src/app/products/share-products/share-products.component.spec.ts b/src/app/products/share-products/share-products.component.spec.ts
new file mode 100644
index 000000000..ec64f768c
--- /dev/null
+++ b/src/app/products/share-products/share-products.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { ShareProductsComponent } from './share-products.component';
+
+describe('ShareProductsComponent', () => {
+ let component: ShareProductsComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ ShareProductsComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(ShareProductsComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/src/app/products/share-products/share-products.component.ts b/src/app/products/share-products/share-products.component.ts
new file mode 100644
index 000000000..c3988d856
--- /dev/null
+++ b/src/app/products/share-products/share-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-share-products',
+ templateUrl: './share-products.component.html',
+ styleUrls: ['./share-products.component.scss']
+})
+export class ShareProductsComponent implements OnInit {
+
+ shareProductsData: any;
+ displayedColumns: string[] = ['name', 'shortName', 'totalShares'];
+ dataSource: MatTableDataSource;
+
+ @ViewChild(MatPaginator) paginator: MatPaginator;
+ @ViewChild(MatSort) sort: MatSort;
+
+ constructor(private route: ActivatedRoute) {
+ this.route.data.subscribe((data: { shareProducts: any }) => {
+ this.shareProductsData = data.shareProducts.pageItems;
+ });
+ }
+
+ ngOnInit() {
+ this.dataSource = new MatTableDataSource(this.shareProductsData);
+ 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/share-products/share-products.resolver.ts b/src/app/products/share-products/share-products.resolver.ts
new file mode 100644
index 000000000..bf44229f8
--- /dev/null
+++ b/src/app/products/share-products/share-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';
+
+/**
+ * Share products data resolver.
+ */
+@Injectable()
+export class ShareProductsResolver implements Resolve