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('LoansAccountDetailsStepComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoansAccountDetailsStepComponent ]
})
.compileComponents();
declarations: [LoansAccountDetailsStepComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -19,7 +19,6 @@ import { ReplaySubject, Subject } from 'rxjs';
styleUrls: ['./loans-account-details-step.component.scss']
})
export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
/** Loans Account Template */
@Input() loansAccountTemplate: any;
@@ -60,11 +59,13 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
* @param {LoansService} loansService Loans Service.
* @param {SettingsService} settingsService SettingsService
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private route: ActivatedRoute,
private settingsService: SettingsService,
private commons: Commons) {
private commons: Commons
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -76,19 +77,21 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
this.productList = this.loansAccountTemplate.productOptions.sort(this.commons.dynamicSort('name'));
if (this.loansAccountTemplate.loanProductId) {
this.loansAccountDetailsForm.patchValue({
'productId': this.loansAccountTemplate.loanProductId,
'submittedOnDate': this.loansAccountTemplate.timeline.submittedOnDate && new Date(this.loansAccountTemplate.timeline.submittedOnDate),
'loanOfficerId': this.loansAccountTemplate.loanOfficerId,
'loanPurposeId': this.loansAccountTemplate.loanPurposeId,
'fundId': this.loansAccountTemplate.fundId,
'expectedDisbursementDate': this.loansAccountTemplate.timeline.expectedDisbursementDate && new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate),
'externalId': this.loansAccountTemplate.externalId
productId: this.loansAccountTemplate.loanProductId,
submittedOnDate:
this.loansAccountTemplate.timeline.submittedOnDate &&
new Date(this.loansAccountTemplate.timeline.submittedOnDate),
loanOfficerId: this.loansAccountTemplate.loanOfficerId,
loanPurposeId: this.loansAccountTemplate.loanPurposeId,
fundId: this.loansAccountTemplate.fundId,
expectedDisbursementDate:
this.loansAccountTemplate.timeline.expectedDisbursementDate &&
new Date(this.loansAccountTemplate.timeline.expectedDisbursementDate),
externalId: this.loansAccountTemplate.externalId
});
}
}
this.filterFormCtrl.valueChanges
.pipe(takeUntil(this._onDestroy))
.subscribe(() => {
this.filterFormCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => {
this.searchItem();
});
this.productData.next(this.productList.slice());
@@ -104,11 +107,13 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
const search: string = this.filterFormCtrl.value.toLowerCase();
if (!search) {
this.productData.next(this.productList.slice());
this.productData.next(this.productList.slice());
} else {
this.productData.next(this.productList.filter((option: any) => {
return option['name'].toLowerCase().indexOf(search) >= 0;
}));
this.productData.next(
this.productList.filter((option: any) => {
return option['name'].toLowerCase().indexOf(search) >= 0;
})
);
}
}
}
@@ -118,15 +123,24 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
*/
createLoansAccountDetailsForm() {
this.loansAccountDetailsForm = this.formBuilder.group({
'productId': ['', Validators.required],
'loanOfficerId': [''],
'loanPurposeId': [''],
'fundId': [''],
'submittedOnDate': [this.settingsService.businessDate, Validators.required],
'expectedDisbursementDate': ['', Validators.required],
'externalId': [''],
'linkAccountId': [''],
'createStandingInstructionAtDisbursement': ['']
productId: [
'',
Validators.required
],
loanOfficerId: [''],
loanPurposeId: [''],
fundId: [''],
submittedOnDate: [
this.settingsService.businessDate,
Validators.required
],
expectedDisbursementDate: [
'',
Validators.required
],
externalId: [''],
linkAccountId: [''],
createStandingInstructionAtDisbursement: ['']
});
}
@@ -134,8 +148,10 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
* Fetches loans account product template on productId value changes
*/
buildDependencies() {
const entityId = (this.loansAccountTemplate.clientId) ? this.loansAccountTemplate.clientId : this.loansAccountTemplate.group.id;
const isGroup = (this.loansAccountTemplate.clientId) ? false : true;
const entityId = this.loansAccountTemplate.clientId
? this.loansAccountTemplate.clientId
: this.loansAccountTemplate.group.id;
const isGroup = this.loansAccountTemplate.clientId ? false : true;
this.loansAccountDetailsForm.get('productId').valueChanges.subscribe((productId: string) => {
this.loansService.getLoansAccountTemplateResource(entityId, isGroup, productId).subscribe((response: any) => {
this.loansAccountProductTemplate.emit(response);
@@ -145,7 +161,9 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
this.accountLinkingOptions = response.accountLinkingOptions;
this.loanProductSelected = true;
if (response.createStandingInstructionAtDisbursement) {
this.loansAccountDetailsForm.get('createStandingInstructionAtDisbursement').patchValue(response.createStandingInstructionAtDisbursement);
this.loansAccountDetailsForm
.get('createStandingInstructionAtDisbursement')
.patchValue(response.createStandingInstructionAtDisbursement);
}
});
});
@@ -157,5 +175,4 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
get loansAccountDetails() {
return this.loansAccountDetailsForm.getRawValue();
}
}