refactor: savings module (#1226)

See: #1196
This commit is contained in:
Karan Takalkar
2020-08-25 17:46:54 +05:30
committed by GitHub
parent f215e1aa96
commit efdd779aa9
30 changed files with 129 additions and 103 deletions
@@ -19,6 +19,7 @@
<!-- Groups -->
<ng-container *ngIf="groupResourceData.length > 0">
<h3>Groups</h3>
<table mat-table [dataSource]="groupResourceData" matSort>
@@ -49,6 +50,7 @@
<tr mat-row *matRowDef="let row; columns: groupsColumns;" [routerLink]="['/groups', row.id, 'general']"></tr>
</table>
</ng-container>
<!-- savings overview table -->
@@ -78,63 +80,51 @@
</ng-container>
<ng-container matColumnDef="Actions">
<th mat-header-cell *matHeaderCellDef> Actions </th>
<td mat-cell *matCellDef="let element">
<ng-container *ngIf="element.status.active">
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '100'">
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '100'"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Deposit']">
<i class="fa fa-arrow-right" matTooltip="Deposit"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '300'">
<i class="fa fa-arrow-right" matTooltip[="Deposit"]></i>
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '300'"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Deposit']">
<i class="fa fa-arrow-right" matTooltip="Deposit"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '100'">
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '100'"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Withdrawal']">
<i class="fa fa-arrow-left" matTooltip="Withdraw"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '300'">
<button class="account-action-button" mat-raised-button color="primary" *ngIf="element.depositType.id == '300'"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Withdrawal']">
<i class="fa fa-arrow-left" matTooltip="Withdraw"></i>
</button>
</ng-container>
<ng-container *ngIf="element.status.submittedAndPendingApproval">
<button class="account-action-button" mat-raised-button color="primary">
<button class="account-action-button" mat-raised-button color="primary"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Approve']">
<i class="fa fa-check" matTooltip="Approve"></i>
</button>
</ng-container>
<ng-container *ngIf="!element.status.submittedAndPendingApproval && !element.status.active">
<button class="account-action-button" mat-raised-button color="primary">
<button class="account-action-button" mat-raised-button color="primary"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Undo Approval']">
<i class="fa fa-undo" matTooltip="Undo Approve"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary">
<button class="account-action-button" mat-raised-button color="primary"
(click)="routeEdit($event)" [routerLink]="['../','savings-accounts', element.id, 'actions', 'Activate']">
<i class="fa fa-power-off" matTooltip="Activate"></i>
</button>
</ng-container>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="savingsAccountColumns"></tr>
<tr mat-row *matRowDef="let row; columns: savingsAccountColumns;" [routerLink]="['../', 'savingsaccounts', row.id, 'transactions']"></tr>
<tr mat-row *matRowDef="let row; columns: savingsAccountColumns;" [routerLink]="['../', 'savings-accounts', row.id, 'transactions']"></tr>
</table>
</ng-container>
</ng-container>
</ng-container>
</div>