build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+28
-21
@@ -18,7 +18,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./edit-transaction.component.scss']
|
||||
})
|
||||
export class EditTransactionComponent implements OnInit {
|
||||
|
||||
/** Minimum Due Date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum Due Date allowed. */
|
||||
@@ -27,11 +26,11 @@ export class EditTransactionComponent implements OnInit {
|
||||
editTransactionForm: UntypedFormGroup;
|
||||
/** savings account transaction payment options. */
|
||||
paymentTypeOptions: {
|
||||
id: number,
|
||||
name: string,
|
||||
description: string,
|
||||
isCashPayment: boolean,
|
||||
position: number
|
||||
id: number;
|
||||
name: string;
|
||||
description: string;
|
||||
isCashPayment: boolean;
|
||||
position: number;
|
||||
}[];
|
||||
/** Flag to enable payment details fields. */
|
||||
showPaymentDetails: Boolean = false;
|
||||
@@ -50,12 +49,14 @@ export class EditTransactionComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {SettingsService} settingsService Setting service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountTransactionTemplate: any }) => {
|
||||
this.transactionTemplateData = data.savingsAccountTransactionTemplate;
|
||||
if (data.savingsAccountTransactionTemplate.currency) {
|
||||
@@ -73,9 +74,9 @@ export class EditTransactionComponent implements OnInit {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
this.createEditTransactionForm();
|
||||
this.editTransactionForm.patchValue({
|
||||
'transactionDate': this.transactionTemplateData.date && new Date(this.transactionTemplateData.date),
|
||||
'transactionAmount': this.transactionTemplateData.amount,
|
||||
'paymentTypeId': this.transactionTemplateData.paymentTypeId
|
||||
transactionDate: this.transactionTemplateData.date && new Date(this.transactionTemplateData.date),
|
||||
transactionAmount: this.transactionTemplateData.amount,
|
||||
paymentTypeId: this.transactionTemplateData.paymentTypeId
|
||||
});
|
||||
}
|
||||
|
||||
@@ -84,9 +85,15 @@ export class EditTransactionComponent implements OnInit {
|
||||
*/
|
||||
createEditTransactionForm() {
|
||||
this.editTransactionForm = this.formBuilder.group({
|
||||
'transactionDate': ['', Validators.required],
|
||||
'transactionAmount': ['', Validators.required],
|
||||
'paymentTypeId': [''],
|
||||
transactionDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
transactionAmount: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
paymentTypeId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -126,10 +133,10 @@ export class EditTransactionComponent implements OnInit {
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.savingAccountId, 'modify', data, this.transactionTemplateData.id)
|
||||
.subscribe(res => {
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.savingAccountId, 'modify', data, this.transactionTemplateData.id)
|
||||
.subscribe((res) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user