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('CreateStandingInstructionsComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CreateStandingInstructionsComponent ]
})
.compileComponents();
declarations: [CreateStandingInstructionsComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./create-standing-instructions.component.scss']
})
export class CreateStandingInstructionsComponent implements OnInit {
/** Standing Instructions Data */
standingIntructionsTemplate: any;
/** Minimum date allowed. */
@@ -45,7 +44,7 @@ export class CreateStandingInstructionsComponent implements OnInit {
/** From Account Data */
fromAccountData: any;
/** Destination Type Data */
destinationTypeData: { id: number; value: string; }[];
destinationTypeData: { id: number; value: string }[];
/** To Office Type Data */
toOfficeTypeData: any;
/** To Client Type Data */
@@ -76,12 +75,14 @@ export class CreateStandingInstructionsComponent implements OnInit {
* @param {SettingsService} settingsService Settings Service
* @param {Dates} dateUtils Date Utils
*/
constructor(private formBuilder: UntypedFormBuilder,
constructor(
private formBuilder: UntypedFormBuilder,
private route: ActivatedRoute,
private router: Router,
private accountTransfersService: AccountTransfersService,
private settingsService: SettingsService,
private dateUtils: Dates) {
private dateUtils: Dates
) {
this.route.data.subscribe((data: { standingIntructionsTemplate: any }) => {
this.standingIntructionsTemplate = data.standingIntructionsTemplate;
this.setParams();
@@ -113,7 +114,7 @@ export class CreateStandingInstructionsComponent implements OnInit {
this.createCreateStandingInstructionsForm();
this.buildDependencies();
this.createStandingInstructionsForm.patchValue({
'applicant': this.standingIntructionsTemplate.fromClient.displayName
applicant: this.standingIntructionsTemplate.fromClient.displayName
});
}
@@ -122,26 +123,83 @@ export class CreateStandingInstructionsComponent implements OnInit {
*/
createCreateStandingInstructionsForm() {
this.createStandingInstructionsForm = this.formBuilder.group({
'name': ['', Validators.required],
'applicant': [{ value: '', disabled: true }],
'transferType': ['', Validators.required],
'priority': ['', Validators.required],
'status': ['', Validators.required],
'fromAccountType': ['', Validators.required],
'fromAccountId': ['', Validators.required],
'destination': ['', Validators.required],
'toOfficeId': ['', Validators.required],
'toClientId': ['', Validators.required],
'toAccountType': ['', Validators.required],
'toAccountId': ['', Validators.required],
'instructionType': ['', Validators.required],
'amount': ['', Validators.required],
'validFrom': ['', Validators.required],
'validTill': ['', Validators.required],
'recurrenceType': ['', Validators.required],
'recurrenceInterval': ['', Validators.required],
'recurrenceFrequency': ['', Validators.required],
'recurrenceOnMonthDay': ['', Validators.required]
name: [
'',
Validators.required
],
applicant: [{ value: '', disabled: true }],
transferType: [
'',
Validators.required
],
priority: [
'',
Validators.required
],
status: [
'',
Validators.required
],
fromAccountType: [
'',
Validators.required
],
fromAccountId: [
'',
Validators.required
],
destination: [
'',
Validators.required
],
toOfficeId: [
'',
Validators.required
],
toClientId: [
'',
Validators.required
],
toAccountType: [
'',
Validators.required
],
toAccountId: [
'',
Validators.required
],
instructionType: [
'',
Validators.required
],
amount: [
'',
Validators.required
],
validFrom: [
'',
Validators.required
],
validTill: [
'',
Validators.required
],
recurrenceType: [
'',
Validators.required
],
recurrenceInterval: [
'',
Validators.required
],
recurrenceFrequency: [
'',
Validators.required
],
recurrenceOnMonthDay: [
'',
Validators.required
]
});
}
@@ -152,7 +210,10 @@ export class CreateStandingInstructionsComponent implements OnInit {
this.statusTypeData = this.standingIntructionsTemplate.statusOptions;
this.fromAccountTypeData = this.standingIntructionsTemplate.fromAccountTypeOptions;
this.fromAccountData = this.standingIntructionsTemplate.fromAccountOptions;
this.destinationTypeData = [{ id: 1, value: 'own account' }, { id: 2, value: 'with in bank' }];
this.destinationTypeData = [
{ id: 1, value: 'own account' },
{ id: 2, value: 'with in bank' }
];
this.toOfficeTypeData = this.standingIntructionsTemplate.toOfficeOptions;
this.toClientTypeData = this.standingIntructionsTemplate.toClientOptions;
this.toAccountTypeData = this.standingIntructionsTemplate.toAccountTypeOptions;
@@ -170,8 +231,8 @@ export class CreateStandingInstructionsComponent implements OnInit {
if (destination === 1) {
this.allowclientedit = false;
this.createStandingInstructionsForm.patchValue({
'toOfficeId': this.officeId,
'toClientId': this.clientId
toOfficeId: this.officeId,
toClientId: this.clientId
});
this.ToOfficeId = true;
this.ToClientId = true;
@@ -179,23 +240,24 @@ export class CreateStandingInstructionsComponent implements OnInit {
} else {
this.allowclientedit = true;
this.createStandingInstructionsForm.patchValue({
'toOfficeId': '',
'toClientId': ''
toOfficeId: '',
toClientId: ''
});
this.createStandingInstructionsForm.controls['toOfficeId'].enable();
this.createStandingInstructionsForm.controls['toClientId'].enable();
}
});
}
/** Executes on change of various select options */
changeEvent() {
const formValue = this.refineObject(this.createStandingInstructionsForm.value);
this.accountTransfersService.getStandingInstructionsTemplate(this.clientId, this.officeId, this.accountTypeId, formValue).subscribe((response: any) => {
this.standingIntructionsTemplate = response;
this.setOptions();
});
this.accountTransfersService
.getStandingInstructionsTemplate(this.clientId, this.officeId, this.accountTypeId, formValue)
.subscribe((response: any) => {
this.standingIntructionsTemplate = response;
this.setOptions();
});
}
/** Refine Object
@@ -219,7 +281,7 @@ export class CreateStandingInstructionsComponent implements OnInit {
const dateFormat = this.settingsService.dateFormat;
const locale = this.settingsService.language.code;
const standingInstructionData = {
... this.createStandingInstructionsForm.value,
...this.createStandingInstructionsForm.value,
dateFormat,
locale,
monthDayFormat: 'dd MMMM',
@@ -227,7 +289,10 @@ export class CreateStandingInstructionsComponent implements OnInit {
fromOfficeId: this.officeId,
validFrom: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.validFrom, dateFormat),
validTill: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.validTill, dateFormat),
recurrenceOnMonthDay: this.dateUtils.formatDate(this.createStandingInstructionsForm.value.recurrenceOnMonthDay, 'dd MMMM'),
recurrenceOnMonthDay: this.dateUtils.formatDate(
this.createStandingInstructionsForm.value.recurrenceOnMonthDay,
'dd MMMM'
)
};
delete standingInstructionData['destination'];
delete standingInstructionData['applicant'];
@@ -235,5 +300,4 @@ export class CreateStandingInstructionsComponent implements OnInit {
this.router.navigate(['../../'], { relativeTo: this.route });
});
}
}