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('CreateFundComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ CreateFundComponent ]
})
.compileComponents();
declarations: [CreateFundComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -9,7 +9,6 @@ import { OrganizationService } from 'app/organization/organization.service';
styleUrls: ['./create-fund.component.scss']
})
export class CreateFundComponent implements OnInit {
/** Charge form. */
fundForm: UntypedFormGroup;
@@ -20,11 +19,12 @@ export class CreateFundComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(private organizationService: OrganizationService,
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute) {
}
constructor(
private organizationService: OrganizationService,
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute
) {}
ngOnInit() {
this.createFundForm();
@@ -35,19 +35,18 @@ export class CreateFundComponent implements OnInit {
*/
createFundForm() {
this.fundForm = this.formBuilder.group({
'name': ['', Validators.required],
'externalId': ['']
name: [
'',
Validators.required
],
externalId: ['']
});
}
submit() {
const payload = this.fundForm.getRawValue();
this.organizationService.createFund(payload)
.subscribe((response: any) => {
this.router.navigate(['../'], { relativeTo: this.route });
});
this.organizationService.createFund(payload).subscribe((response: any) => {
this.router.navigate(['../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('EditFundComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ EditFundComponent ]
})
.compileComponents();
declarations: [EditFundComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -9,7 +9,6 @@ import { OrganizationService } from 'app/organization/organization.service';
styleUrls: ['./edit-fund.component.scss']
})
export class EditFundComponent implements OnInit {
/** Selected Data. */
fundData: any;
/** Charge form. */
@@ -22,10 +21,12 @@ export class EditFundComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
* @param {Router} router Router for navigation.
*/
constructor(private organizationService: OrganizationService,
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute) {
constructor(
private organizationService: OrganizationService,
private formBuilder: UntypedFormBuilder,
private router: Router,
private route: ActivatedRoute
) {
this.route.data.subscribe((data: { fundData: any }) => {
this.fundData = data.fundData;
});
@@ -40,17 +41,18 @@ export class EditFundComponent implements OnInit {
*/
createFundForm() {
this.fundForm = this.formBuilder.group({
'name': [this.fundData.name, Validators.required],
'externalId': [this.fundData.externalId]
name: [
this.fundData.name,
Validators.required
],
externalId: [this.fundData.externalId]
});
}
submit() {
const payload = this.fundForm.getRawValue();
this.organizationService.editFund(this.fundData.id.toString(), payload)
.subscribe((response: any) => {
this.router.navigate(['../'], { relativeTo: this.route });
});
this.organizationService.editFund(this.fundData.id.toString(), payload).subscribe((response: any) => {
this.router.navigate(['../'], { relativeTo: this.route });
});
}
}
@@ -8,9 +8,8 @@ describe('ManageFundsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ManageFundsComponent ]
})
.compileComponents();
declarations: [ManageFundsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -31,7 +31,6 @@ import { MatSort } from '@angular/material/sort';
styleUrls: ['./manage-funds.component.scss']
})
export class ManageFundsComponent implements OnInit, AfterViewInit {
/** Manage Funds data. */
fundsData: any;
/** New Fund form */
@@ -44,7 +43,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
/* Template for popover on funds form */
@ViewChild('templateFundFormRef') templateFundFormRef: TemplateRef<any>;
/** Columns to be displayed in funds table. */
displayedColumns: string[] = ['name', 'externalId'];
displayedColumns: string[] = [
'name',
'externalId'
];
/** Data source for Funds table. */
dataSource: MatTableDataSource<any>;
@@ -63,14 +65,16 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
* @param {ConfigurationWizardService} configurationWizardService ConfigurationWizard Service.
* @param {PopoverService} popoverService PopoverService.
*/
constructor(private route: ActivatedRoute,
private formBuilder: UntypedFormBuilder,
private organizationservice: OrganizationService,
public dialog: MatDialog,
private router: Router,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService) {
this.route.data.subscribe(( data: { funds: any }) => {
constructor(
private route: ActivatedRoute,
private formBuilder: UntypedFormBuilder,
private organizationservice: OrganizationService,
public dialog: MatDialog,
private router: Router,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService
) {
this.route.data.subscribe((data: { funds: any }) => {
this.fundsData = data.funds;
});
}
@@ -79,7 +83,6 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
this.dataSource = new MatTableDataSource(this.fundsData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
}
/**
@@ -95,7 +98,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
*/
createFundForm() {
this.fundForm = this.formBuilder.group({
'name': ['', Validators.required]
name: [
'',
Validators.required
]
});
}
@@ -105,10 +111,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
addFund() {
const newFund = this.fundForm.value;
this.organizationservice.createFund(newFund).subscribe((response: any) => {
this.fundsData.push({
id: response.resourceId,
name: newFund.name
});
this.fundsData.push({
id: response.resourceId,
name: newFund.name
});
this.formRef.resetForm();
if (this.configurationWizardService.showManageFunds === true) {
this.configurationWizardService.showManageFunds = false;
@@ -131,7 +137,8 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
value: fundContent,
type: 'text',
required: true
}),
})
];
const data = {
title: 'Edit Fund',
@@ -155,7 +162,12 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
* @param position String.
* @param backdrop Boolean.
*/
showPopover(template: TemplateRef<any>, target: HTMLElement | ElementRef<any>, position: string, backdrop: boolean): void {
showPopover(
template: TemplateRef<any>,
target: HTMLElement | ElementRef<any>,
position: string,
backdrop: boolean
): void {
setTimeout(() => this.popoverService.open(template, target, position, backdrop, {}), 200);
}
@@ -165,7 +177,7 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
ngAfterViewInit() {
if (this.configurationWizardService.showManageFunds === true) {
setTimeout(() => {
this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true);
this.showPopover(this.templateFundFormRef, this.fundFormRef.nativeElement, 'bottom', true);
});
}
}
@@ -193,10 +205,10 @@ export class ManageFundsComponent implements OnInit, AfterViewInit {
const continueSetupDialogRef = this.dialog.open(ContinueSetupDialogComponent, {
data: {
stepName: 'fund'
},
}
});
continueSetupDialogRef.afterClosed().subscribe((response: { step: number }) => {
if (response.step === 1) {
if (response.step === 1) {
this.configurationWizardService.showManageFunds = false;
this.router.navigate(['../'], { relativeTo: this.route });
} else if (response.step === 2) {
@@ -13,7 +13,6 @@ import { OrganizationService } from '../organization.service';
*/
@Injectable()
export class ManageFundsResolver implements Resolve<Object> {
/**
* @param {OrganizationService} organizationService Organization service.
*/
@@ -26,5 +25,4 @@ export class ManageFundsResolver implements Resolve<Object> {
resolve(): Observable<any> {
return this.organizationService.getFunds();
}
}
@@ -8,9 +8,8 @@ describe('ViewFundComponent', () => {
beforeEach(async () => {
await TestBed.configureTestingModule({
declarations: [ ViewFundComponent ]
})
.compileComponents();
declarations: [ViewFundComponent]
}).compileComponents();
});
beforeEach(() => {
@@ -7,7 +7,6 @@ import { ActivatedRoute } from '@angular/router';
styleUrls: ['./view-fund.component.scss']
})
export class ViewFundComponent {
/** Fund data. */
fundData: any;
@@ -20,5 +19,4 @@ export class ViewFundComponent {
this.fundData = data.fundData;
});
}
}