This commit is contained in:
Omar-Nabil2
2026-02-03 12:19:58 +02:00
parent cf7ced043c
commit 07a907955c
16 changed files with 364 additions and 25 deletions
@@ -112,8 +112,17 @@
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="upcomingChargesColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Upcoming Charges Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="upcomingChargesColumns"></tr>
<tr mat-row *matRowDef="let row; columns: upcomingChargesColumns" [routerLink]="['../', 'charges', row.id]"></tr>
<tr mat-footer-row *matFooterRowDef="upcomingCharges?.length === 0 ? ['no-data'] : []"></tr>
</table>
<!-- loans accounts overview table -->
@@ -256,6 +265,15 @@
}
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="openLoansColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Active Loan Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="openLoansColumns"></tr>
<tr
mat-row
@@ -263,6 +281,10 @@
[routerLink]="['../', 'loans-accounts', row.id, 'general']"
class="select-row"
></tr>
<tr
mat-footer-row
*matFooterRowDef="(loanAccounts | accountsFilter: 'loan')?.length === 0 ? ['no-data'] : []"
></tr>
</table>
}
@@ -332,6 +354,15 @@
</button>
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="closedLoansColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Closed Loan Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedLoansColumns"></tr>
<tr
mat-row
@@ -339,6 +370,10 @@
[routerLink]="['../', 'loans-accounts', row.id, 'general']"
class="select-row"
></tr>
<tr
mat-footer-row
*matFooterRowDef="(loanAccounts | accountsFilter: 'loan' : 'closed')?.length === 0 ? ['no-data'] : []"
></tr>
</table>
}
@@ -441,12 +476,27 @@
}
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="openSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Active Saving Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="openSavingsColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: openSavingsColumns"
[routerLink]="['../', 'savings-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'open' : 'isSavings')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -470,12 +520,27 @@
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Closed Date' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.timeline.closedOnDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="closedSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Closed Saving Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: closedSavingsColumns"
[routerLink]="['../', 'savings-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'closed' : 'isSavings')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -554,12 +619,27 @@
}
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="openSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Active Fixed Deposit Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="openSavingsColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: openSavingsColumns"
[routerLink]="['../', 'fixed-deposits-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'open' : 'isFixed')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -584,12 +664,27 @@
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Closed Date' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.timeline.closedOnDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="closedSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Closed Fixed Deposit Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: closedSavingsColumns"
[routerLink]="['../', 'fixed-deposits-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'closed' : 'isFixed')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -672,6 +767,15 @@
}
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="openSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Active Recurring Deposit Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="openSavingsColumns"></tr>
<tr
mat-row
@@ -679,6 +783,12 @@
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']"
class="select-row"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'open' : 'isRecurring')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -702,6 +812,15 @@
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Closed Date' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.timeline.closedOnDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="closedSavingsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Closed Recurring Deposit Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedSavingsColumns"></tr>
<tr
mat-row
@@ -709,6 +828,12 @@
[routerLink]="['../', 'recurring-deposits-accounts', row.id, 'general']"
class="select-row"
></tr>
<tr
mat-footer-row
*matFooterRowDef="
(savingAccounts | accountsFilter: 'saving' : 'closed' : 'isRecurring')?.length === 0 ? ['no-data'] : []
"
></tr>
</table>
}
@@ -789,12 +914,25 @@
}
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="openSharesColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Active Share Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="openSharesColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: openSharesColumns"
[routerLink]="['../', 'shares-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="(shareAccounts | accountsFilter: 'share')?.length === 0 ? ['no-data'] : []"
></tr>
</table>
}
@@ -824,12 +962,25 @@
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Closed Date' | translate }}</th>
<td mat-cell *matCellDef="let element">{{ element.timeline.closedOnDate | dateFormat }}</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="closedSharesColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Closed Share Accounts Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="closedSharesColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: closedSharesColumns"
[routerLink]="['../', 'shares-accounts', row.id, 'general']"
></tr>
<tr
mat-footer-row
*matFooterRowDef="(shareAccounts | accountsFilter: 'share' : 'closed')?.length === 0 ? ['no-data'] : []"
></tr>
</table>
}
@@ -886,12 +1037,21 @@
</td>
</ng-container>
<ng-container matColumnDef="no-data">
<td mat-footer-cell *matFooterCellDef [attr.colspan]="collateralsColumns.length">
<div class="no-data-message">
<p>{{ 'labels.messages.No Collateral Data Available' | translate }}</p>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="collateralsColumns"></tr>
<tr
mat-row
*matRowDef="let row; columns: collateralsColumns"
[routerLink]="['../', 'client-collateral', row.collateralId]"
></tr>
<tr mat-footer-row *matFooterRowDef="collaterals?.length === 0 ? ['no-data'] : []"></tr>
</table>
<!-- PDF Viewer Modal -->
@@ -56,3 +56,15 @@
align-items: center; /* Ensure buttons are vertically aligned */
gap: 0.5rem; /* Add spacing between buttons if needed */
}
.no-data-message {
text-align: center;
padding: 40px 20px;
color: var(--mdc-theme-text-secondary-on-background, #666);
font-size: 14px;
cursor: auto;
p {
margin: 0;
}
}
@@ -23,7 +23,11 @@ import {
MatHeaderRowDef,
MatHeaderRow,
MatRowDef,
MatRow
MatRow,
MatFooterCellDef,
MatFooterCell,
MatFooterRowDef,
MatFooterRow
} from '@angular/material/table';
import { NgClass } from '@angular/common';
import { AccountNumberComponent } from '../../../shared/account-number/account-number.component';
@@ -62,6 +66,10 @@ import { EMPTY } from 'rxjs';
MatHeaderRow,
MatRowDef,
MatRow,
MatFooterCellDef,
MatFooterCell,
MatFooterRowDef,
MatFooterRow,
AccountNumberComponent,
LongTextComponent,
MatTooltip,
@@ -217,13 +225,13 @@ export class GeneralTabComponent implements OnDestroy {
/** Client Account Data */
clientAccountData: any;
/** Loan Accounts Data */
loanAccounts: any;
loanAccounts: any[] = [];
/** Savings Accounts Data */
savingAccounts: any;
savingAccounts: any[] = [];
/** Shares Accounts Data */
shareAccounts: any;
shareAccounts: any[] = [];
/** Upcoming Charges Data */
upcomingCharges: any;
upcomingCharges: any[] = [];
/** Performance History Data */
performanceHistory: {
loanCycle: number;
@@ -239,7 +247,7 @@ export class GeneralTabComponent implements OnDestroy {
totalSavings: 0
};
/** Collaterals Data */
collaterals: any;
collaterals: any[] = [];
/** Show Closed Loan Accounts */
showClosedLoanAccounts = false;
@@ -264,15 +272,18 @@ export class GeneralTabComponent implements OnDestroy {
this.route.data.subscribe(
(data: { clientAccountsData: any; clientChargesData: any; clientSummary: any; clientCollateralData: any }) => {
this.clientAccountData = data.clientAccountsData;
this.savingAccounts = data.clientAccountsData.savingsAccounts;
this.loanAccounts = data.clientAccountsData.loanAccounts;
this.shareAccounts = data.clientAccountsData.shareAccounts;
this.upcomingCharges = data.clientChargesData.pageItems;
this.collaterals = data.clientCollateralData;
this.savingAccounts = data.clientAccountsData?.savingsAccounts ?? [];
this.loanAccounts = data.clientAccountsData?.loanAccounts ?? [];
this.shareAccounts = data.clientAccountsData?.shareAccounts ?? [];
this.upcomingCharges = data.clientChargesData?.pageItems ?? [];
this.collaterals = data.clientCollateralData ?? [];
this.clientid = this.route.parent.snapshot.params['clientId'];
// Compute performance history from accounts data
this.computePerformanceHistory(data.clientAccountsData);
this.computePerformanceHistory(data.clientAccountsData ?? { loanAccounts: [], savingsAccounts: [] });
}
);
}