build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+2
-3
@@ -8,9 +8,8 @@ describe('EditTransactionComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditTransactionComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditTransactionComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+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 });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ViewRecieptComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewRecieptComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ViewRecieptComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+5
-5
@@ -12,7 +12,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./view-reciept.component.scss']
|
||||
})
|
||||
export class ViewRecieptComponent implements OnInit {
|
||||
|
||||
/** trusted resource url for pentaho output */
|
||||
pentahoUrl: any;
|
||||
/** Transaction Reciept Data */
|
||||
@@ -23,8 +22,10 @@ export class ViewRecieptComponent implements OnInit {
|
||||
* @param {DomSanitizer} sanitizer DOM Sanitizer
|
||||
* @param {ActivatedRoute} route Activated Route
|
||||
*/
|
||||
constructor(private sanitizer: DomSanitizer,
|
||||
private route: ActivatedRoute) {
|
||||
constructor(
|
||||
private sanitizer: DomSanitizer,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsTransactionReciept: any }) => {
|
||||
this.transactionRecieptData = data.savingsTransactionReciept;
|
||||
});
|
||||
@@ -32,9 +33,8 @@ export class ViewRecieptComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
const contentType = this.transactionRecieptData.headers.get('Content-Type');
|
||||
const file = new Blob([this.transactionRecieptData.body], {type: contentType});
|
||||
const file = new Blob([this.transactionRecieptData.body], { type: contentType });
|
||||
const filecontent = URL.createObjectURL(file);
|
||||
this.pentahoUrl = this.sanitizer.bypassSecurityTrustResourceUrl(filecontent);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('DatatableTransactionTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ DatatableTransactionTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [DatatableTransactionTabComponent]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
-1
@@ -6,7 +6,6 @@ import { ActivatedRoute } from '@angular/router';
|
||||
templateUrl: './datatable-transaction-tab.component.html',
|
||||
styleUrls: ['./datatable-transaction-tab.component.scss']
|
||||
})
|
||||
|
||||
export class DatatableTransactionTabComponent {
|
||||
/** Transaction Id */
|
||||
entityId: string;
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SavingsTransactionDatatableTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SavingsTransactionDatatableTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingsTransactionDatatableTabComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(SavingsTransactionDatatableTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+1
-3
@@ -6,7 +6,5 @@ import { Component } from '@angular/core';
|
||||
styleUrls: ['./savings-transaction-datatable-tab.component.scss']
|
||||
})
|
||||
export class SavingsTransactionDatatableTabComponent {
|
||||
|
||||
constructor() { }
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SavingsTransactionGeneralTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ SavingsTransactionGeneralTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SavingsTransactionGeneralTabComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(SavingsTransactionGeneralTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+23
-15
@@ -13,22 +13,23 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./savings-transaction-general-tab.component.scss']
|
||||
})
|
||||
export class SavingsTransactionGeneralTabComponent {
|
||||
|
||||
accountId: string;
|
||||
transactionId: string;
|
||||
transactionData: any;
|
||||
|
||||
constructor(private savingsService: SavingsService,
|
||||
constructor(
|
||||
private savingsService: SavingsService,
|
||||
private route: ActivatedRoute,
|
||||
private dateUtils: Dates,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private settingsService: SettingsService) {
|
||||
this.route.data.subscribe((data: { savingsAccountTransaction: any }) => {
|
||||
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
this.transactionData = data.savingsAccountTransaction;
|
||||
});
|
||||
}
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountTransaction: any }) => {
|
||||
this.accountId = this.route.parent.snapshot.params['savingAccountId'];
|
||||
this.transactionData = data.savingsAccountTransaction;
|
||||
});
|
||||
}
|
||||
|
||||
allowUndo(): boolean {
|
||||
if (this.transactionData.reversed && this.transactionData.transactionType.amountHold) {
|
||||
@@ -42,9 +43,11 @@ export class SavingsTransactionGeneralTabComponent {
|
||||
releaseAmountDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.confirm) {
|
||||
const data = {};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'releaseAmount', data, this.transactionData.id).subscribe(() => {
|
||||
this.router.navigate(['../..'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.accountId, 'releaseAmount', data, this.transactionData.id)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../..'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -56,14 +59,19 @@ export class SavingsTransactionGeneralTabComponent {
|
||||
const locale = this.settingsService.language.code;
|
||||
const dateFormat = this.settingsService.dateFormat;
|
||||
const data = {
|
||||
transactionDate: this.dateUtils.formatDate(this.transactionData.date && new Date(this.transactionData.date), dateFormat),
|
||||
transactionDate: this.dateUtils.formatDate(
|
||||
this.transactionData.date && new Date(this.transactionData.date),
|
||||
dateFormat
|
||||
),
|
||||
transactionAmount: 0,
|
||||
dateFormat,
|
||||
locale
|
||||
};
|
||||
this.savingsService.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id).subscribe(() => {
|
||||
this.router.navigate(['../..'], { relativeTo: this.route });
|
||||
});
|
||||
this.savingsService
|
||||
.executeSavingsAccountTransactionsCommand(this.accountId, 'undo', data, this.transactionData.id)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['../..'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ViewTransactionComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewTransactionComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ViewTransactionComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+8
-7
@@ -9,7 +9,6 @@ import { MatDialog } from '@angular/material/dialog';
|
||||
styleUrls: ['./view-transaction.component.scss']
|
||||
})
|
||||
export class ViewTransactionComponent {
|
||||
|
||||
/** Transaction data. */
|
||||
transactionData: any;
|
||||
|
||||
@@ -21,11 +20,13 @@ export class ViewTransactionComponent {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {MatDialog} dialog Dialog reference.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { transactionDatatables: any}) => {
|
||||
this.accountId = this.route.snapshot.params['savingAccountId'];
|
||||
this.entityDatatables = data.transactionDatatables;
|
||||
});
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { transactionDatatables: any }) => {
|
||||
this.accountId = this.route.snapshot.params['savingAccountId'];
|
||||
this.entityDatatables = data.transactionDatatables;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user