Fix search entities view for savings and deposits accounts

This commit is contained in:
Jose Alberto Hernandez
2024-02-07 14:10:07 +01:00
committed by Adam Saghy
parent 5d0e063be6
commit f643b15949
11 changed files with 45 additions and 14 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ const routes: Routes = [
loadChildren: () => import('../savings/savings.module').then(m => m.SavingsModule)
},
{
path: 'recurringdeposits',
path: 'recurring-deposits-accounts',
loadChildren: () => import('../deposits/recurring-deposits/recurring-deposits.module').then(m => m.RecurringDepositsModule)
},
{
@@ -115,7 +115,7 @@
<button mat-menu-item *mifosxHasPermission="'CREATE_SHAREACCOUNT'"
[routerLink]="['shares-accounts', 'create']">{{"labels.buttons.New Share Account" | translate}}</button>
<button mat-menu-item *mifosxHasPermission="'CREATE_RECURRINGDEPOSITACCOUNT'"
[routerLink]="['recurringdeposits', 'create-recurring-deposits-account']">{{"labels.buttons.New Recurring Deposit Account" | translate}}</button>
[routerLink]="['recurring-deposits-accounts', 'create-recurring-deposits-account']">{{"labels.buttons.New Recurring Deposit Account" | translate}}</button>
<button mat-menu-item *mifosxHasPermission="'CREATE_FIXEDDEPOSITACCOUNT'"
[routerLink]="['fixed-deposits-accounts', 'create']">{{"labels.buttons.New Fixed Deposits Account" | translate}}</button>
</mat-menu>
@@ -476,7 +476,7 @@
<td mat-cell class="center" *matCellDef="let element">
<ng-container *ngIf="element.status.submittedAndPendingApproval">
<button class="account-action-button" mat-raised-button *mifosxHasPermission="'APPROVE_SAVINGSACCOUNT'"
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Approve']" color="primary">
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Approve']" color="primary">
<i class="fa fa-check"></i>
</button>
</ng-container>
@@ -484,12 +484,12 @@
<button
class="account-action-button" mat-raised-button color="primary" (click)="routeEdit($event)"
*mifosxHasPermission="'APPROVALUNDO_SAVINGSACCOUNT'"
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Undo Approval']">
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Undo Approval']">
<i class="fa fa-undo"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" (click)="routeEdit($event)"
*mifosxHasPermission="'ACTIVATE_SAVINGSACCOUNT'"
[routerLink]="['../','recurringdeposits', element.id, 'actions', 'Activate']">
[routerLink]="['../','recurring-deposits-accounts', element.id, 'actions', 'Activate']">
<i class="fa fa-check-circle"></i>
</button>
</ng-container>
@@ -498,7 +498,7 @@
<tr mat-header-row *matHeaderRowDef="openSavingsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: openSavingsColumns;"
[routerLink]="['../', 'recurringdeposits', row.id, 'general']" class="select-row"></tr>
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"></tr>
</table>
@@ -525,7 +525,7 @@
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr mat-row *matRowDef="let row; columns: closedSavingsColumns;"
[routerLink]="['../', 'recurringdeposits', row.id, 'general']" class="select-row"></tr>
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']" class="select-row"></tr>
</table>
<!-- Shares overview Table -->
@@ -211,7 +211,7 @@ export class ChargesTabComponent implements OnInit {
private reload() {
const clientId = this.recurringDepositsAccountData.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true })
this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
@@ -37,6 +37,7 @@
<tr>
</tr>
<tr>
<td>{{"labels.inputs.Deposit Frequency" | translate }}</td>
<td><span>{{recurringDepositsAccountData.recurringFrequency}}
&nbsp;{{recurringDepositsAccountData.recurringFrequencyType.value}}
</span></td>
@@ -148,7 +148,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
reload() {
const clientId = this.recurringDepositsAccountData.clientId;
const url: string = this.router.url;
this.router.navigateByUrl(`/clients/${clientId}/recurringdeposits`, { skipLocationChange: true })
this.router.navigateByUrl(`/clients/${clientId}/recurring-deposits-accounts`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
@@ -33,7 +33,7 @@ export class NotificationsPageComponent implements OnInit {
'center' : '/centers/',
'shareAccount' : '/shares-accounts/',
'fixedDeposit' : '/fixed-deposits-accounts/',
'recurringDepositAccount': '/recurringdeposits/',
'recurringDepositAccount': '/recurring-deposits-accounts/',
'savingsAccount' : '/savings-accounts/',
'shareProduct': '/products/share-products/',
'loanProduct' : '/products/loan-products/'
@@ -112,6 +112,8 @@ export class LoanProductSettingsStepComponent implements OnInit {
'enableDownPayment': this.loanProductsTemplate.enableDownPayment,
'enableInstallmentLevelDelinquency': this.loanProductsTemplate.enableInstallmentLevelDelinquency,
'loanScheduleType': this.loanProductsTemplate.loanScheduleType.code,
'useDueForRepaymentsConfigurations': this.loanProductsTemplate.useDueForRepaymentsConfigurations,
'allowAccrualPostingInArrears': this.loanProductsTemplate.allowAccrualPostingInArrears
});
this.isAdvancedTransactionProcessingStrategy = LoanProducts.isAdvancedPaymentAllocationStrategy(transactionProcessingStrategyCode);
@@ -243,6 +245,7 @@ export class LoanProductSettingsStepComponent implements OnInit {
'dueDaysForRepaymentEvent': [''],
'overDueDaysForRepaymentEvent': [''],
'loanScheduleType': [LoanProducts.LOAN_SCHEDULE_TYPE_CUMULATIVE, Validators.required],
'allowAccrualPostingInArrears': [false]
});
}
@@ -3,6 +3,7 @@ import { Component, ViewChild } from '@angular/core';
import { MatPaginator } from '@angular/material/paginator';
import { MatTableDataSource } from '@angular/material/table';
import { Router, ActivatedRoute } from '@angular/router';
import { SearchData } from '../search.model';
/**
* Search Page Component
@@ -16,7 +17,7 @@ export class SearchPageComponent {
/** Flags if number of search results exceed 200 */
overload: boolean;
/** Datasource for loans disbursal table */
dataSource: MatTableDataSource<any>;
dataSource: MatTableDataSource<SearchData>;
/** Displayed Columns for serach results */
displayedColumns: string[] = ['entityType', 'entityName', 'entityAccount', 'externalId', 'parentType', 'parentName', 'details'];
/** Paginator for the table */
@@ -31,6 +32,7 @@ export class SearchPageComponent {
constructor(private route: ActivatedRoute,
private router: Router) {
this.route.data.subscribe(( data: { searchResults: any }) => {
console.log(data.searchResults);
this.dataSource = new MatTableDataSource(data.searchResults);
this.dataSource.paginator = this.paginator;
this.hasResults = (data.searchResults.length > 0);
@@ -45,7 +47,7 @@ export class SearchPageComponent {
* Returns link to entity view page.
* @param {any} entity Entity
*/
navigate(entity: any) {
navigate(entity: SearchData) {
switch (entity.entityType) {
case 'CLIENT':
this.router.navigate(['clients', entity.entityId, 'general']);
@@ -60,7 +62,13 @@ export class SearchPageComponent {
this.router.navigate(['clients', entity.parentId, 'shares-accounts', entity.entityId]);
break;
case 'SAVING':
this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']);
if (entity.subEntityType === 'depositAccountType.recurringDeposit') {
this.router.navigate(['clients', entity.parentId, 'recurring-deposits-accounts', entity.entityId, 'transactions']);
} else if (entity.subEntityType === 'depositAccountType.fixedDeposit') {
this.router.navigate(['clients', entity.parentId, 'fixed-deposits-accounts', entity.entityId, 'transactions']);
} else if (entity.subEntityType === 'depositAccountType.savingsDeposit') {
this.router.navigate(['clients', entity.parentId, 'savings-accounts', entity.entityId, 'transactions']);
}
break;
case 'LOAN':
this.router.navigate(['clients', entity.parentId, 'loans-accounts', entity.entityId, 'general']);
+19
View File
@@ -0,0 +1,19 @@
export interface SearchData {
entityId: number;
entityAccountNo: string;
entityExternalId: string;
entityName: string;
entityType: string;
parentId: number;
parentName: string;
entityStatus: EntityStatus;
parentType: string;
subEntityType: string;
}
export interface EntityStatus {
id: number;
code: string;
value: string;
}
@@ -40,7 +40,7 @@ export class NotificationsTrayComponent implements OnInit, OnDestroy {
'center' : '/centers/',
'shareAccount' : '/shares-accounts/',
'fixedDeposit' : '/fixed-deposits-accounts/',
'recurringDepositAccount': '/recurringdeposits/',
'recurringDepositAccount': '/recurring-deposits-accounts/',
'savingsAccount' : '/savings-accounts/',
'shareProduct': '/products/share-products/',
'loanProduct' : '/products/loan-products/'