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('LoanDelinquencyActionDialogComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ LoanDelinquencyActionDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [LoanDelinquencyActionDialogComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(LoanDelinquencyActionDialogComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+13
-7
@@ -8,24 +8,30 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
|
||||
styleUrls: ['./loan-delinquency-action-dialog.component.scss']
|
||||
})
|
||||
export class LoanDelinquencyActionDialogComponent {
|
||||
|
||||
delinquencyActionForm: UntypedFormGroup;
|
||||
/** Minimum date allowed. */
|
||||
minDate = new Date(2000, 0, 1);
|
||||
/** Maximum date allowed. */
|
||||
maxDate = new Date(2100, 0, 1);
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<LoanDelinquencyActionDialogComponent>,
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<LoanDelinquencyActionDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private formBuilder: UntypedFormBuilder) {
|
||||
this.createDelinquencyActionForm();
|
||||
private formBuilder: UntypedFormBuilder
|
||||
) {
|
||||
this.createDelinquencyActionForm();
|
||||
}
|
||||
|
||||
createDelinquencyActionForm() {
|
||||
this.delinquencyActionForm = this.formBuilder.group({
|
||||
'startDate': [new Date(), Validators.required],
|
||||
'endDate': ['', Validators.required],
|
||||
startDate: [
|
||||
new Date(),
|
||||
Validators.required
|
||||
],
|
||||
endDate: [
|
||||
'',
|
||||
Validators.required
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('LoansAccountAddCollateralDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoansAccountAddCollateralDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [LoansAccountAddCollateralDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+20
-14
@@ -8,12 +8,11 @@ import { UntypedFormGroup, UntypedFormBuilder, Validators } from '@angular/forms
|
||||
styleUrls: ['./loans-account-add-collateral-dialog.component.scss']
|
||||
})
|
||||
export class LoansAccountAddCollateralDialogComponent implements OnInit {
|
||||
|
||||
layout: {
|
||||
addButtonText?: string
|
||||
addButtonText?: string;
|
||||
} = {
|
||||
addButtonText: 'Add'
|
||||
};
|
||||
addButtonText: 'Add'
|
||||
};
|
||||
|
||||
addCollateralForm: UntypedFormGroup;
|
||||
/** All Collateral Options */
|
||||
@@ -23,9 +22,11 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit {
|
||||
/** Maximum ALlowed Quantity of selected collateral */
|
||||
maxQuantity: any = 0;
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<LoansAccountAddCollateralDialogComponent>,
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<LoansAccountAddCollateralDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any,
|
||||
private formBuilder: UntypedFormBuilder) {
|
||||
private formBuilder: UntypedFormBuilder
|
||||
) {
|
||||
this.createAddCollateralForm();
|
||||
}
|
||||
|
||||
@@ -37,17 +38,23 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit {
|
||||
|
||||
createAddCollateralForm() {
|
||||
this.addCollateralForm = this.formBuilder.group({
|
||||
'collateral': ['', Validators.required],
|
||||
'quantity': ['', Validators.required],
|
||||
'totalValue': [{value: '', disabled: true}],
|
||||
'totalCollateralValue': [{value: '', disabled: true}],
|
||||
collateral: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
quantity: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
totalValue: [{ value: '', disabled: true }],
|
||||
totalCollateralValue: [{ value: '', disabled: true }]
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Subscribe to Form controls value changes
|
||||
*/
|
||||
buildDependencies() {
|
||||
buildDependencies() {
|
||||
this.addCollateralForm.controls.collateral.valueChanges.subscribe((collateral: any) => {
|
||||
this.collateralData = collateral;
|
||||
this.maxQuantity = collateral.quantity;
|
||||
@@ -55,10 +62,9 @@ export class LoansAccountAddCollateralDialogComponent implements OnInit {
|
||||
|
||||
this.addCollateralForm.controls.quantity.valueChanges.subscribe((quantity: any) => {
|
||||
this.addCollateralForm.patchValue({
|
||||
'totalValue': this.collateralData.basePrice * quantity,
|
||||
'totalCollateralValue': this.collateralData.basePrice * this.collateralData.pctToBase * quantity / 100
|
||||
totalValue: this.collateralData.basePrice * quantity,
|
||||
totalCollateralValue: (this.collateralData.basePrice * this.collateralData.pctToBase * quantity) / 100
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('LoansAccountViewGuarantorDetailsDialogComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoansAccountViewGuarantorDetailsDialogComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [LoansAccountViewGuarantorDetailsDialogComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+4
-5
@@ -7,13 +7,12 @@ import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
|
||||
styleUrls: ['./loans-account-view-guarantor-details-dialog.component.scss']
|
||||
})
|
||||
export class LoansAccountViewGuarantorDetailsDialogComponent implements OnInit {
|
||||
|
||||
constructor(public dialogRef: MatDialogRef<LoansAccountViewGuarantorDetailsDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any) {
|
||||
}
|
||||
constructor(
|
||||
public dialogRef: MatDialogRef<LoansAccountViewGuarantorDetailsDialogComponent>,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.dialogRef.updateSize('400px');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user