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
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./disburse.component.scss']
})
export class DisburseComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
loanId: string;
@@ -41,16 +40,17 @@ export class DisburseComponent implements OnInit {
* @param {Router} router Router for navigation.
* @param {SettingsService} settingsService Settings Service
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loanService: LoansService,
private route: ActivatedRoute,
private router: Router,
private dateUtils: Dates,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
/**
* Creates the disbursement loan form
* and initialize with the required values
@@ -69,18 +69,24 @@ export class DisburseComponent implements OnInit {
*/
createDisbursementLoanForm() {
this.disbursementLoanForm = this.formBuilder.group({
'actualDisbursementDate': [this.settingsService.businessDate, Validators.required],
'transactionAmount': ['', Validators.required],
'externalId': '',
'paymentTypeId': '',
'note': ''
actualDisbursementDate: [
this.settingsService.businessDate,
Validators.required
],
transactionAmount: [
'',
Validators.required
],
externalId: '',
paymentTypeId: '',
note: ''
});
}
setDisbursementLoanDetails() {
this.paymentTypes = this.dataObject.paymentTypeOptions;
this.disbursementLoanForm.patchValue({
transactionAmount: this.dataObject.amount,
transactionAmount: this.dataObject.amount
// actualDisbursementDate: new Date(this.dataObject.date)
});
}
@@ -112,7 +118,10 @@ export class DisburseComponent implements OnInit {
const dateFormat = this.settingsService.dateFormat;
const prevActualDisbursementDate: Date = this.disbursementLoanForm.value.actualDisbursementDate;
if (disbursementLoanFormData.actualDisbursementDate instanceof Date) {
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(prevActualDisbursementDate, dateFormat);
disbursementLoanFormData.actualDisbursementDate = this.dateUtils.formatDate(
prevActualDisbursementDate,
dateFormat
);
}
const data = {
...disbursementLoanFormData,
@@ -120,10 +129,8 @@ export class DisburseComponent implements OnInit {
locale
};
data['transactionAmount'] = data['transactionAmount'] * 1;
this.loanService.loanActionButtons(this.loanId, 'disburse', data )
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.loanActionButtons(this.loanId, 'disburse', data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}