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('SharesAccountChargesStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountChargesStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountChargesStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+14
-7
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
|
||||
styleUrls: ['./shares-account-charges-step.component.scss']
|
||||
})
|
||||
export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
|
||||
/** Shares Account Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** Shares Account Template */
|
||||
@@ -38,13 +37,21 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
/** For Edit Shares Account Form */
|
||||
isChargesPatched = false;
|
||||
/** Display columns for charges table */
|
||||
displayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'action'];
|
||||
displayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType',
|
||||
'action'
|
||||
];
|
||||
|
||||
/**
|
||||
* @param {MatDialog} dialog Mat Dialog
|
||||
*/
|
||||
constructor(private dialog: MatDialog,
|
||||
private translateService: TranslateService) { }
|
||||
constructor(
|
||||
private dialog: MatDialog,
|
||||
private translateService: TranslateService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.currencyCode.valueChanges.subscribe(() => {
|
||||
@@ -85,8 +92,9 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
label: this.translateService.instant('labels.inputs.Amount'),
|
||||
value: charge.amount || charge.amountOrPercentage,
|
||||
type: 'number',
|
||||
required: false,
|
||||
}),
|
||||
required: false
|
||||
})
|
||||
|
||||
];
|
||||
const data = {
|
||||
title: this.translateService.instant('labels.heading.Edit Charge'),
|
||||
@@ -127,5 +135,4 @@ export class SharesAccountChargesStepComponent implements OnInit, OnChanges {
|
||||
get sharesAccountCharges() {
|
||||
return { charges: this.chargesDataSource };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountDetailsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountDetailsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountDetailsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+19
-11
@@ -15,7 +15,6 @@ import { SharesService } from 'app/shares/shares.service';
|
||||
styleUrls: ['./shares-account-details-step.component.scss']
|
||||
})
|
||||
export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
|
||||
/** Shares Account Template */
|
||||
@Input() sharesAccountTemplate: any;
|
||||
|
||||
@@ -37,9 +36,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
* @param {SharesService} sharesService Shares Service.
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private sharesService: SharesService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createSharesAccountDetailsForm();
|
||||
}
|
||||
|
||||
@@ -50,9 +51,11 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
this.productData = this.sharesAccountTemplate.productOptions;
|
||||
if (this.sharesAccountTemplate.productId) {
|
||||
this.sharesAccountDetailsForm.patchValue({
|
||||
'productId': this.sharesAccountTemplate.productId,
|
||||
'submittedDate': this.sharesAccountTemplate.timeline.submittedOnDate && new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
|
||||
'externalId': this.sharesAccountTemplate.externalId
|
||||
productId: this.sharesAccountTemplate.productId,
|
||||
submittedDate:
|
||||
this.sharesAccountTemplate.timeline.submittedOnDate &&
|
||||
new Date(this.sharesAccountTemplate.timeline.submittedOnDate),
|
||||
externalId: this.sharesAccountTemplate.externalId
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -63,9 +66,15 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
*/
|
||||
createSharesAccountDetailsForm() {
|
||||
this.sharesAccountDetailsForm = this.formBuilder.group({
|
||||
'productId': ['', Validators.required],
|
||||
'submittedDate': ['', Validators.required],
|
||||
'externalId': ['']
|
||||
productId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
submittedDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
externalId: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -87,5 +96,4 @@ export class SharesAccountDetailsStepComponent implements OnInit {
|
||||
get sharesAccountDetails() {
|
||||
return this.sharesAccountDetailsForm.value;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountPreviewStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountPreviewStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountPreviewStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+7
-4
@@ -10,7 +10,6 @@ import { Component, Input, Output, EventEmitter } from '@angular/core';
|
||||
styleUrls: ['./shares-account-preview-step.component.scss']
|
||||
})
|
||||
export class SharesAccountPreviewStepComponent {
|
||||
|
||||
/** Shares Account Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** Shares Account Template */
|
||||
@@ -21,11 +20,15 @@ export class SharesAccountPreviewStepComponent {
|
||||
@Input() sharesAccount: any;
|
||||
|
||||
/** Display columns for charges table. */
|
||||
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType'];
|
||||
chargesDisplayedColumns: string[] = [
|
||||
'name',
|
||||
'chargeCalculationType',
|
||||
'amount',
|
||||
'chargeTimeType'
|
||||
];
|
||||
|
||||
/** Form submission event */
|
||||
@Output() submitEvent = new EventEmitter();
|
||||
|
||||
constructor() { }
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('SharesAccountTermsStepComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ SharesAccountTermsStepComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [SharesAccountTermsStepComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+44
-29
@@ -13,7 +13,6 @@ import { Currency } from 'app/shared/models/general.model';
|
||||
styleUrls: ['./shares-account-terms-step.component.scss']
|
||||
})
|
||||
export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
|
||||
/** Shares Account and Product Template */
|
||||
@Input() sharesAccountProductTemplate: any;
|
||||
/** [Optional] Shares Account Template */
|
||||
@@ -40,8 +39,10 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
* @param {FormBuilder} formBuilder Form Builder
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService) {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.createSharesAccountTermsForm();
|
||||
}
|
||||
|
||||
@@ -49,11 +50,11 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
if (this.sharesAccountProductTemplate) {
|
||||
this.currency = this.sharesAccountProductTemplate.currency;
|
||||
this.sharesAccountTermsForm.patchValue({
|
||||
'currencyCode': this.sharesAccountProductTemplate.currency.code,
|
||||
'decimal': this.sharesAccountProductTemplate.currency.decimalPlaces,
|
||||
'currencyMultiple': this.sharesAccountProductTemplate.currency.inMultiplesOf,
|
||||
'unitPrice': this.sharesAccountProductTemplate.currentMarketPrice,
|
||||
'savingsAccountId': ''
|
||||
currencyCode: this.sharesAccountProductTemplate.currency.code,
|
||||
decimal: this.sharesAccountProductTemplate.currency.decimalPlaces,
|
||||
currencyMultiple: this.sharesAccountProductTemplate.currency.inMultiplesOf,
|
||||
unitPrice: this.sharesAccountProductTemplate.currentMarketPrice,
|
||||
savingsAccountId: ''
|
||||
});
|
||||
this.setOptions();
|
||||
if (this.sharesAccountTemplate) {
|
||||
@@ -69,13 +70,18 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
this.maxDate = this.settingsService.businessDate;
|
||||
if (this.sharesAccountTemplate) {
|
||||
this.sharesAccountTermsForm.patchValue({
|
||||
'requestedShares': this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
|
||||
'minimumActivePeriod': this.sharesAccountTemplate.minimumActivePeriod,
|
||||
'minimumActivePeriodFrequencyType': this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
|
||||
'lockinPeriodFrequency': this.sharesAccountTemplate.lockinPeriod,
|
||||
'lockinPeriodFrequencyType': this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
|
||||
'applicationDate': this.sharesAccountTemplate.purchasedShares[0].purchasedDate && new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
|
||||
'allowDividendCalculationForInactiveClients': this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
|
||||
requestedShares: this.sharesAccountTemplate.summary.totalPendingForApprovalShares,
|
||||
minimumActivePeriod: this.sharesAccountTemplate.minimumActivePeriod,
|
||||
minimumActivePeriodFrequencyType:
|
||||
this.sharesAccountTemplate.minimumActivePeriod && this.sharesAccountTemplate.minimumActivePeriodTypeEnum.id,
|
||||
lockinPeriodFrequency: this.sharesAccountTemplate.lockinPeriod,
|
||||
lockinPeriodFrequencyType:
|
||||
this.sharesAccountTemplate.lockinPeriod && this.sharesAccountTemplate.lockPeriodTypeEnum.id,
|
||||
applicationDate:
|
||||
this.sharesAccountTemplate.purchasedShares[0].purchasedDate &&
|
||||
new Date(this.sharesAccountTemplate.purchasedShares[0].purchasedDate),
|
||||
allowDividendCalculationForInactiveClients:
|
||||
this.sharesAccountTemplate.allowDividendCalculationForInactiveClients
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -85,18 +91,27 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
*/
|
||||
createSharesAccountTermsForm() {
|
||||
this.sharesAccountTermsForm = this.formBuilder.group({
|
||||
'currencyCode': [{value: '', disabled: true}],
|
||||
'decimal': [{value: '', disabled: true}],
|
||||
'requestedShares': ['', Validators.required],
|
||||
'unitPrice': [{value: '', disabled: true}],
|
||||
'currencyMultiple': [{value: '', disabled: true}],
|
||||
'savingsAccountId': ['', Validators.required],
|
||||
'minimumActivePeriod': [''],
|
||||
'minimumActivePeriodFrequencyType': [''],
|
||||
'lockinPeriodFrequency': [''],
|
||||
'lockinPeriodFrequencyType': [''],
|
||||
'applicationDate': ['', Validators.required],
|
||||
'allowDividendCalculationForInactiveClients': [false]
|
||||
currencyCode: [{ value: '', disabled: true }],
|
||||
decimal: [{ value: '', disabled: true }],
|
||||
requestedShares: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
unitPrice: [{ value: '', disabled: true }],
|
||||
currencyMultiple: [{ value: '', disabled: true }],
|
||||
savingsAccountId: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
minimumActivePeriod: [''],
|
||||
minimumActivePeriodFrequencyType: [''],
|
||||
lockinPeriodFrequency: [''],
|
||||
lockinPeriodFrequencyType: [''],
|
||||
applicationDate: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
allowDividendCalculationForInactiveClients: [false]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -104,7 +119,8 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
* Sets all select dropdown options.
|
||||
*/
|
||||
setOptions() {
|
||||
this.minimumActivePeriodFrequencyTypeData = this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
|
||||
this.minimumActivePeriodFrequencyTypeData =
|
||||
this.sharesAccountProductTemplate.minimumActivePeriodFrequencyTypeOptions;
|
||||
this.lockinPeriodFrequencyTypeData = this.sharesAccountProductTemplate.lockinPeriodFrequencyTypeOptions;
|
||||
this.savingsAccountsData = this.sharesAccountProductTemplate.clientSavingsAccounts;
|
||||
}
|
||||
@@ -122,5 +138,4 @@ export class SharesAccountTermsStepComponent implements OnChanges, OnInit {
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user