generated from openMF/payment-hub-ee
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63ca078
commit d8525ab
Showing
194 changed files
with
16,590 additions
and
2,555 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
88 changes: 5 additions & 83 deletions
88
src/app/account-mapper/account-mapper/account-mapper.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,6 @@ | ||
<div class="container" fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column"> | ||
|
||
<mat-accordion class="filter-options"> | ||
<mat-expansion-panel> | ||
<mat-expansion-panel-header> | ||
<mat-panel-title> | ||
<h3 class="m-r-10">{{"labels.inputs.Filters" | translate}}</h3> | ||
<fa-icon icon="filter" size="xl"></fa-icon> | ||
</mat-panel-title> | ||
|
||
</mat-expansion-panel-header> | ||
<div class="container" fxLayout="row wrap" fxLayoutGap="2%" fxLayout.lt-md="column"> | ||
|
||
<mat-form-field fxFlex="20%"> | ||
<mat-label>{{"labels.inputs.Financial Institution" | translate}}</mat-label> | ||
<input matInput [formControl]="financialInstitution"> | ||
</mat-form-field> | ||
|
||
<mat-form-field fxFlex="20%"> | ||
<mat-label>{{"labels.inputs.Functional ID" | translate}}</mat-label> | ||
<input matInput [formControl]="functionalId"> | ||
</mat-form-field> | ||
|
||
<mat-form-field fxFlex="20%"> | ||
<mat-label>{{"labels.inputs.Financial Address" | translate}}</mat-label> | ||
<input matInput [formControl]="financialAddress"> | ||
</mat-form-field> | ||
|
||
<div fxFlex="20%" class="push-end m-t-15"> | ||
<button mat-raised-button color="primary" (click)="searchAccounts()"> | ||
<fa-icon icon="search" class="m-r-10"></fa-icon> {{"labels.buttons.Search" | translate}} | ||
</button> | ||
</div> | ||
|
||
</div> | ||
|
||
</mat-expansion-panel> | ||
</mat-accordion> | ||
|
||
<mat-card class="container"> | ||
<mat-progress-bar mode="indeterminate" *ngIf="isLoading"></mat-progress-bar> | ||
|
||
<table mat-table [dataSource]="dataSource" matSort *ngIf="!isLoading"> | ||
|
||
<ng-container matColumnDef="governmentEntity"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Government Entity" | translate}} </th> | ||
<td mat-cell *matCellDef="let item"> {{item.registeringInstitutionId }} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="financialInstitution"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Financial Institution" | translate}} </th> | ||
<td mat-cell *matCellDef="let item" >{{ item.bankingInstitutionCode }} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="functionalId"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Functional ID" | translate}} </th> | ||
<td mat-cell *matCellDef="let item"> {{ item.payeeIdentity }} </td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="financialAddress"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Financial Address" | translate}} </th> | ||
<td mat-cell *matCellDef="let item"> | ||
<mifosx-identifier identifier="{{item.financialAddress}}"></mifosx-identifier> | ||
</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="paymentModality"> | ||
<th mat-header-cell *matHeaderCellDef mat-sort-header> {{"labels.inputs.Payment Modality" | translate}} </th> | ||
<td mat-cell *matCellDef="let item"> {{paymentModalityDescription(item.paymentModality)}} </td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns;" | ||
class="select-row"></tr> | ||
|
||
</table> | ||
|
||
<mat-paginator #paginator [pageSize]="pageSize" [pageIndex]="currentPage" (page)="pageChanged($event)" | ||
[pageSizeOptions]="[50, 100, 200]" [length]="totalRows" showFirstLastButtons> | ||
</mat-paginator> | ||
|
||
</mat-card> | ||
|
||
<div class="container"> | ||
<div fxLayout="row" fxLayout.lt-md="column" class="account-wrap"> | ||
<mifosx-filter-selector></mifosx-filter-selector> | ||
</div> | ||
<router-outlet></router-outlet> | ||
</div> |
28 changes: 9 additions & 19 deletions
28
src/app/account-mapper/account-mapper/account-mapper.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,14 @@ | ||
.container { | ||
width: 80%; | ||
} | ||
|
||
.account-mapper-wrap { | ||
flex-wrap: wrap; | ||
width: 100%; | ||
|
||
mifosx-batches, | ||
mifosx-sub-batches, | ||
mifosx-filter-selector { | ||
width: 100%; | ||
} | ||
|
||
width: 90%; | ||
} | ||
|
||
.filter-options { | ||
width: 100%; | ||
margin-bottom: 20px; | ||
} | ||
.account-wrap { | ||
flex-wrap: wrap; | ||
width: 100%; | ||
|
||
.push-end { | ||
text-align: end; | ||
mifosx-voucher-management, | ||
mifosx-vouchers-bulk-import, | ||
mifosx-filter-selector { | ||
width: 100%; | ||
} | ||
} |
89 changes: 2 additions & 87 deletions
89
src/app/account-mapper/account-mapper/account-mapper.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,8 @@ | ||
import { Component, OnInit, ViewChild } from '@angular/core'; | ||
import { AccountMapperService } from '../services/account-mapper.service'; | ||
import { UntypedFormControl } from '@angular/forms'; | ||
import { MatPaginator, PageEvent } from '@angular/material/paginator'; | ||
import { MatSort } from '@angular/material/sort'; | ||
import { MatTableDataSource } from '@angular/material/table'; | ||
import { AccountData } from '../models/account-mapper.model'; | ||
import { Dates } from 'app/core/utils/dates'; | ||
import { Component } from '@angular/core'; | ||
|
||
@Component({ | ||
selector: 'mifosx-account-mapper', | ||
templateUrl: './account-mapper.component.html', | ||
styleUrls: ['./account-mapper.component.scss'] | ||
}) | ||
export class AccountMapperComponent implements OnInit { | ||
|
||
@ViewChild(MatPaginator) paginator: MatPaginator; | ||
@ViewChild(MatSort) sort: MatSort; | ||
|
||
/** government Entity form control. */ | ||
governmentEntity = new UntypedFormControl(); | ||
/** financial Institution form control. */ | ||
financialInstitution = new UntypedFormControl(); | ||
/** functional Id form control. */ | ||
functionalId = new UntypedFormControl(); | ||
/** financial Address form control. */ | ||
financialAddress = new UntypedFormControl(); | ||
|
||
/** Columns to be displayed in transactions table. */ | ||
displayedColumns: string[] = ['governmentEntity', 'financialInstitution', 'functionalId', 'financialAddress', 'paymentModality']; | ||
/** Data source for transactions table. */ | ||
dataSource = new MatTableDataSource(); | ||
|
||
totalRows = 0; | ||
currentPage = 0; | ||
pageSize = 10; | ||
isLoading = false; | ||
|
||
accountsData: AccountData; | ||
|
||
constructor(private dates: Dates, | ||
private accountMapperService: AccountMapperService) { } | ||
|
||
ngOnInit(): void { | ||
this.getAccounts(); | ||
} | ||
|
||
getAccounts(): void { | ||
this.isLoading = true; | ||
this.accountMapperService.getAccounts(this.currentPage, this.pageSize, 'requestFile', 'asc') | ||
.subscribe((accounts: AccountData) => { | ||
this.dataSource = new MatTableDataSource(accounts.content); | ||
this.dataSource.paginator = this.paginator; | ||
this.dataSource.sort = this.sort; | ||
this.totalRows = accounts.totalElements; | ||
this.isLoading = false; | ||
}, (error: any) => { | ||
this.isLoading = false; | ||
}); | ||
} | ||
|
||
convertTimestampToUTCDate(timestamp: any) { | ||
if (!timestamp) { | ||
return undefined; | ||
} | ||
return this.dates.formatUTCDate(new Date(timestamp)); | ||
} | ||
|
||
pageChanged(event: PageEvent) { | ||
this.currentPage = event.pageIndex; | ||
this.pageSize = event.pageSize; | ||
this.getAccounts(); | ||
} | ||
|
||
paymentModalityDescription(value: string): string { | ||
if (value === '0' || value === '00') { | ||
return '(00) Bank Account'; | ||
} else if (value === '1' || value === '01') { | ||
return '(01) Mobile Money'; | ||
} else if (value === '2' || value === '02') { | ||
return '(02) Voucher'; | ||
} else if (value === '3' || value === '03') { | ||
return '(03) Digital Wallet'; | ||
} else if (value === '4' || value === '04') { | ||
return '(04) Proxy'; | ||
} | ||
return value; | ||
} | ||
|
||
searchAccounts(): void { | ||
|
||
} | ||
} | ||
export class AccountMapperComponent {} |
Oops, something went wrong.