build: Use prettier for typescript

Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2025-01-15 11:59:30 +00:00
committed by Adam Saghy
parent 9d6cf1514a
commit cac1d11ad7
1812 changed files with 22516 additions and 16862 deletions
@@ -8,9 +8,8 @@ describe('LoanDisbursalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanDisbursalComponent ]
})
.compileComponents();
declarations: [LoanDisbursalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -20,7 +20,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./loan-disbursal.component.scss']
})
export class LoanDisbursalComponent {
/** Loans Data */
loans: any;
/** Batch Requests */
@@ -30,7 +29,13 @@ export class LoanDisbursalComponent {
/** Row Selection */
selection: SelectionModel<any>;
/** Displayed Columns for loan disbursal data */
displayedColumns: string[] = ['select', 'client', 'loanAccountNumber', 'loanProduct', 'principal'];
displayedColumns: string[] = [
'select',
'client',
'loanAccountNumber',
'loanProduct',
'principal'
];
/**
* Retrieves the loans data from `resolve`.
@@ -41,16 +46,18 @@ export class LoanDisbursalComponent {
* @param {SettingsService} settingsService Settings Service.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
private tasksService: TasksService) {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { loansData: any }) => {
this.loans = data.loansData.pageItems;
this.loans = this.loans.filter((account: any) => {
return (account.status.waitingForDisbursal === true);
return account.status.waitingForDisbursal === true;
});
this.dataSource = new MatTableDataSource(this.loans);
this.selection = new SelectionModel(true, []);
@@ -66,9 +73,9 @@ export class LoanDisbursalComponent {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach((row: any) => this.selection.select(row));
this.isAllSelected()
? this.selection.clear()
: this.dataSource.data.forEach((row: any) => this.selection.select(row));
}
/** The label for the checkbox on the passed row */
@@ -81,7 +88,10 @@ export class LoanDisbursalComponent {
disburseLoan() {
const disburseLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Loan Disbursal'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan') }
data: {
heading: this.translateService.instant('labels.heading.Loan Disbursal'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan')
}
});
disburseLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -112,7 +122,7 @@ export class LoanDisbursalComponent {
});
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
response.forEach((responseEle: any) => {
if (responseEle.statusCode = '200') {
if ((responseEle.statusCode = '200')) {
approvedAccounts++;
responseEle.body = JSON.parse(responseEle.body);
if (selectedAccounts === approvedAccounts) {
@@ -127,7 +137,7 @@ export class LoanDisbursalComponent {
this.tasksService.getAllLoansToBeDisbursed().subscribe((response: any) => {
this.loans = response.pageItems;
this.loans = this.loans.filter((account: any) => {
return (account.status.waitingForDisbursal === true);
return account.status.waitingForDisbursal === true;
});
this.dataSource = new MatTableDataSource(this.loans);
this.selection = new SelectionModel(true, []);
@@ -137,5 +147,4 @@ export class LoanDisbursalComponent {
applyFilter(filterValue: string = '') {
this.dataSource.filter = filterValue.trim().toLowerCase();
}
}