generated from openMF/ph-ee-start-here
-
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.
* Updated payment hub filters * implemented end date * Updated Pending and incomplete state * bulk batch export test * Batch summary api fix * Batch summary api fix * Resolved review fixes
- Loading branch information
1 parent
def43cd
commit 4cb9673
Showing
7 changed files
with
277 additions
and
35 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,14 @@ | ||
.green { | ||
color: green; | ||
} | ||
|
||
.red { color:red;} | ||
|
||
.orange { color:orange;} | ||
color: green; | ||
} | ||
|
||
.red { | ||
color: red; | ||
} | ||
|
||
.orange { | ||
color: orange; | ||
} | ||
.payment-hub-ee-wrap { | ||
flex-wrap: wrap; | ||
} |
104 changes: 104 additions & 0 deletions
104
src/app/payment-hub/request-to-pay/bulk-batch-export/bulk-batch-export.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 |
---|---|---|
@@ -0,0 +1,104 @@ | ||
<div class="container bulk-btn"> | ||
<div> | ||
<mat-form-field appearance="fill"> | ||
<mat-label>Choose an Option</mat-label> | ||
<mat-select [formControl]="template" multiple> | ||
<mat-option | ||
*ngFor="let templateItem of templates" | ||
[value]="templateItem" | ||
>{{ templateItem }}</mat-option | ||
> | ||
</mat-select> | ||
</mat-form-field> | ||
<button mat-raised-button color="primary">Download CSV Template</button> | ||
</div> | ||
<div class="form-group"> | ||
<input | ||
type="file" | ||
class="file-input" | ||
(change)="onFileSelected($event)" | ||
#fileUpload | ||
/> | ||
|
||
<div class="file-upload"> | ||
{{ fileName || "No file uploaded yet." }} | ||
|
||
<button | ||
mat-mini-fab | ||
color="primary" | ||
class="upload-btn" | ||
(click)="fileUpload.click()" | ||
> | ||
<mat-icon>attach_file</mat-icon> | ||
</button> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="container"> | ||
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8"> | ||
<ng-container matColumnDef="position"> | ||
<th mat-header-cell *matHeaderCellDef>No.</th> | ||
<td mat-cell *matCellDef="let element">{{ element.position }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="transactionId"> | ||
<th mat-header-cell *matHeaderCellDef>Transaction Id</th> | ||
<td mat-cell *matCellDef="let element">{{ element.transactionId }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="startedAt"> | ||
<th mat-header-cell *matHeaderCellDef>Started At</th> | ||
<td mat-cell *matCellDef="let element">{{ element.startedAt }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="completedAt"> | ||
<th mat-header-cell *matHeaderCellDef>Completed At</th> | ||
<td mat-cell *matCellDef="let element">{{ element.completedAt }}</td> | ||
</ng-container> | ||
<ng-container matColumnDef="status"> | ||
<th mat-header-cell *matHeaderCellDef>Status</th> | ||
<td mat-cell *matCellDef="let element">{{ element.status }}</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns"></tr> | ||
</table> | ||
|
||
<form | ||
class="batch-summary-wrap" | ||
#batchSummaryForm="ngForm" | ||
(ngSubmit)="getBatchSummary(batchSummaryForm.value)" | ||
> | ||
<mat-form-field class="example-full-width" appearance="fill"> | ||
<mat-label>Enter Batch ID</mat-label> | ||
<input | ||
matInput | ||
class="form-control col-sm-4 batch-summary-id" | ||
ngModel | ||
name="batchid" | ||
id="batch-id" | ||
/> | ||
</mat-form-field> | ||
|
||
<button | ||
mat-raised-button | ||
color="primary" | ||
type="submit" | ||
[disabled]="!batchSummaryForm.valid" | ||
> | ||
View Batch Details | ||
</button> | ||
</form> | ||
<p>Batch summary</p> | ||
|
||
<div *ngFor="let batches of BatchSummaryData"> | ||
<li>Batch Id : {{ batches.batch_id }}</li> | ||
<li>Request Id : {{ batches.request_id }}</li> | ||
<li>Total : {{ batches.total }}</li> | ||
<li>Amount Total : {{ batches.totalAmount }}</li> | ||
<li>Status : {{ batches.status }}</li> | ||
<li>Successful : {{ batches.successful }}</li> | ||
<li>Failed : {{ batches.failed }}</li> | ||
<li>Ongoing : {{ batches.ongoing }}</li> | ||
</div> | ||
</div> |
6 changes: 6 additions & 0 deletions
6
src/app/payment-hub/request-to-pay/bulk-batch-export/bulk-batch-export.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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
.bulk-btn { | ||
margin-bottom: 20px; | ||
} | ||
.file-input { | ||
display: none; | ||
} |
82 changes: 82 additions & 0 deletions
82
src/app/payment-hub/request-to-pay/bulk-batch-export/bulk-batch-export.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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
import { Component } from "@angular/core"; | ||
import { | ||
HttpClient, | ||
HttpParams, | ||
HttpHeaders, | ||
JsonpClientBackend, | ||
} from "@angular/common/http"; | ||
import { FormControl } from "@angular/forms"; | ||
export interface PeriodicElement { | ||
position: number; | ||
transactionId: string; | ||
status: string; | ||
completedAt: number; | ||
startedAt: number; | ||
} | ||
const ELEMENT_DATA: PeriodicElement[] = [ | ||
{ | ||
position: 1, | ||
transactionId: "e5eea064-1445-4d32-bc55-bd9826c779a0", | ||
startedAt: 1629130966000, | ||
completedAt: 1629130967000, | ||
status: "IN_PROGRESS", | ||
}, | ||
{ | ||
position: 2, | ||
transactionId: "3cc88b24-1df6-48e2-8b1f-5dbd02ba96b7", | ||
startedAt: 1629130966000, | ||
completedAt: 1629150766000, | ||
status: "IN_PROGRESS", | ||
}, | ||
]; | ||
|
||
@Component({ | ||
selector: "mifosx-bulk-batch-export", | ||
templateUrl: "./bulk-batch-export.component.html", | ||
styleUrls: ["./bulk-batch-export.component.scss"], | ||
}) | ||
export class BulkBatchExportComponent { | ||
template = new FormControl(""); | ||
templates: string[] = ["Mojaloo", "Program"]; | ||
fileToUpload: File | null = null; | ||
displayedColumns: string[] = [ | ||
"position", | ||
"transactionId", | ||
"completedAt", | ||
"startedAt", | ||
"status", | ||
]; | ||
BatchSummaryData: any[] = []; | ||
batchId: string; | ||
dataSource = ELEMENT_DATA; | ||
handleFileInput(files: FileList) { | ||
this.fileToUpload = files.item(0); | ||
} | ||
fileName = ""; | ||
|
||
constructor(private http: HttpClient) {} | ||
|
||
onFileSelected(event: any) { | ||
const file: File = event.target.files[0]; | ||
|
||
if (file) { | ||
this.fileName = file.name; | ||
|
||
const formData = new FormData(); | ||
|
||
formData.append("thumbnail", file); | ||
|
||
const upload$ = this.http.post("/api/thumbnail-upload", formData); | ||
|
||
upload$.subscribe(); | ||
} | ||
} | ||
|
||
getBatchSummary(batchIdName: any) { | ||
const url = `/api/v1/batch?batchId=${batchIdName.batchid}`; | ||
console.log(url); | ||
this.http.get(url).subscribe((data) => { | ||
this.BatchSummaryData.push(data); | ||
}); | ||
} | ||
} |
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
Oops, something went wrong.