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('CreateGuarantorComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateGuarantorComponent ]
})
.compileComponents();
declarations: [CreateGuarantorComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -18,7 +18,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./create-guarantor.component.scss']
})
export class CreateGuarantorComponent implements OnInit, AfterViewInit {
@Input() dataObject: any;
/** New Guarantor Form */
newGuarantorForm: UntypedFormGroup;
@@ -44,13 +43,15 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
* @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 clientsService: ClientsService,
private settingsService: SettingsService) {
private settingsService: SettingsService
) {
this.loanId = this.route.snapshot.params['loanId'];
}
@@ -64,11 +65,14 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
/** Create Guarantor Details Form */
createNewGuarantorForm() {
this.newGuarantorForm = this.formBuilder.group({
'existingClient': [''],
'name': ['', Validators.required],
'clientRelationshipTypeId': [''],
'savingsId': [''],
'amount': ['']
existingClient: [''],
name: [
'',
Validators.required
],
clientRelationshipTypeId: [''],
savingsId: [''],
amount: ['']
});
}
@@ -123,10 +127,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
if (this.newGuarantorForm.value.existingClient) {
this.newGuarantorForm.get('name').valueChanges.subscribe((value: string) => {
if (value.length >= 2) {
this.clientsService.getFilteredClients('displayName', 'ASC', true, value)
.subscribe((data: any) => {
this.clientsData = data.pageItems;
});
this.clientsService.getFilteredClients('displayName', 'ASC', true, value).subscribe((data: any) => {
this.clientsData = data.pageItems;
});
}
});
}
@@ -155,7 +158,9 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
const dateFormat = this.settingsService.dateFormat;
const prevdob: Date = this.newGuarantorForm.value.dob;
const guarantorTypeId: number = this.newGuarantorForm.value.existingClient ? this.dataObject.guarantorTypeOptions[0].id : this.dataObject.guarantorTypeOptions[2].id;
const guarantorTypeId: number = this.newGuarantorForm.value.existingClient
? this.dataObject.guarantorTypeOptions[0].id
: this.dataObject.guarantorTypeOptions[2].id;
const data = {
...newGuarantorFormData,
locale,
@@ -174,10 +179,8 @@ export class CreateGuarantorComponent implements OnInit, AfterViewInit {
delete data.existingClient;
delete data.name;
this.loanService.createNewGuarantor(this.loanId, data)
.subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
this.loanService.createNewGuarantor(this.loanId, data).subscribe((response: any) => {
this.router.navigate(['../../general'], { relativeTo: this.route });
});
}
}