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('AddEventDialogComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ AddEventDialogComponent ]
})
.compileComponents();
declarations: [AddEventDialogComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -12,7 +12,6 @@ import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms
styleUrls: ['./add-event-dialog.component.scss']
})
export class AddEventDialogComponent implements OnInit {
/** Event Form. */
eventForm: UntypedFormGroup;
/** Entity Data. */
@@ -25,19 +24,29 @@ export class AddEventDialogComponent implements OnInit {
* @param {FormBuilder} formBuilder Form Builder.
* @param {any} data Provides grouping, entities and actions data to fill dropdowns.
*/
constructor(public dialogRef: MatDialogRef<AddEventDialogComponent>,
constructor(
public dialogRef: MatDialogRef<AddEventDialogComponent>,
public formBuilder: UntypedFormBuilder,
@Inject(MAT_DIALOG_DATA) public data: any) {
}
@Inject(MAT_DIALOG_DATA) public data: any
) {}
/**
* Creates add event form.
*/
ngOnInit() {
this.eventForm = this.formBuilder.group({
'grouping': ['', Validators.required],
'entity': ['', Validators.required],
'action': ['', Validators.required]
grouping: [
'',
Validators.required
],
entity: [
'',
Validators.required
],
action: [
'',
Validators.required
]
});
this.setGroupingListener();
this.setEntityListener();
@@ -47,20 +56,18 @@ export class AddEventDialogComponent implements OnInit {
* Subscribes to the grouping dropdown to set entity data for that row accordingly.
*/
setGroupingListener() {
this.eventForm.get('grouping').valueChanges
.subscribe(changedGrouping => {
this.entityData = this.data.groupings.find((grouping: any) => grouping.name === changedGrouping).entities;
});
this.eventForm.get('grouping').valueChanges.subscribe((changedGrouping) => {
this.entityData = this.data.groupings.find((grouping: any) => grouping.name === changedGrouping).entities;
});
}
/**
* Subscribes to the entity dropdown to set entity data for that row accordingly.
*/
setEntityListener() {
this.eventForm.get('entity').valueChanges
.subscribe(changedEntity => {
this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
});
this.eventForm.get('entity').valueChanges.subscribe((changedEntity) => {
this.actionData = this.entityData.find((entity: any) => entity.name === changedEntity).actions;
});
}
/**
@@ -69,5 +76,4 @@ export class AddEventDialogComponent implements OnInit {
submit() {
this.dialogRef.close(this.eventForm.value);
}
}