feat(accounting): provisioning entries component

Add provisioning entries component.
This commit is contained in:
Abhay Chawla
2018-08-08 13:44:50 +05:30
parent 6cbc13abb1
commit 3f32d06466
8 changed files with 140 additions and 5 deletions
@@ -0,0 +1,64 @@
<div class="container m-b-20" fxLayout="row" fxLayoutAlign="end" fxLayoutGap="20px">
<button mat-raised-button color="primary" [routerLink]="['/accounting/provisioning-entries/create']">
<mat-icon>add</mat-icon>&nbsp;&nbsp;Create Provisioning Entry
</button>
</div>
<div class="container">
<div fxLayout="row" fxLayoutGap="20px">
<mat-form-field fxFlex>
<input matInput (keyup)="applyFilter($event.target.value)" placeholder="Filter">
</mat-form-field>
</div>
<div class="mat-elevation-z8">
<table mat-table [dataSource]="dataSource" matSort>
<ng-container matColumnDef="createdUser">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Created By </th>
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.createdUser }} </td>
</ng-container>
<ng-container matColumnDef="createdDate">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Created On </th>
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.createdDate }} </td>
</ng-container>
<ng-container matColumnDef="journalEntry">
<th mat-header-cell *matHeaderCellDef mat-sort-header> Journal Entry Created </th>
<td mat-cell *matCellDef="let provisioningEntry"> {{ provisioningEntry.journalEntry }} </td>
</ng-container>
<ng-container matColumnDef="viewReport">
<th mat-header-cell *matHeaderCellDef> View Report </th>
<td mat-cell *matCellDef="let provisioningEntry">
<button mat-button>View</button>
</td>
</ng-container>
<ng-container matColumnDef="recreateProvisioning">
<th mat-header-cell *matHeaderCellDef> Recreate Provisioning </th>
<td mat-cell *matCellDef="let provisioningEntry">
<button mat-button>Recreate</button>
</td>
</ng-container>
<ng-container matColumnDef="viewJournalEntry">
<th mat-header-cell *matHeaderCellDef> View Journal Entry </th>
<td mat-cell *matCellDef="let provisioningEntry">
<button mat-button>View</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<mat-paginator [pageSizeOptions]="[10, 25, 50, 100]" showFirstLastButtons></mat-paginator>
</div>
</div>
@@ -0,0 +1,3 @@
table {
width: 100%;
}
@@ -0,0 +1,25 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ProvisioningEntriesComponent } from './provisioning-entries.component';
describe('ProvisioningEntriesComponent', () => {
let component: ProvisioningEntriesComponent;
let fixture: ComponentFixture<ProvisioningEntriesComponent>;
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ProvisioningEntriesComponent ]
})
.compileComponents();
}));
beforeEach(() => {
fixture = TestBed.createComponent(ProvisioningEntriesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});
it('should create', () => {
expect(component).toBeTruthy();
});
});
@@ -0,0 +1,33 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { MatSort, MatPaginator, MatTableDataSource } from '@angular/material';
import { AccountingService } from '../accounting.service';
@Component({
selector: 'mifosx-provisioning-entries',
templateUrl: './provisioning-entries.component.html',
styleUrls: ['./provisioning-entries.component.scss']
})
export class ProvisioningEntriesComponent implements OnInit {
displayedColumns: string[] = ['createdUser', 'createdDate', 'journalEntry', 'viewReport', 'recreateProvisioning', 'viewJournalEntry'];
dataSource: any;
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
constructor(private accountingService: AccountingService) { }
ngOnInit() {
this.getProvisioningEntries();
}
getProvisioningEntries() {
this.accountingService.getProvisioningEntries().subscribe((provisioningEntryData: any) => {
this.dataSource = new MatTableDataSource(provisioningEntryData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
});
}
}