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('CreateGsimAccountComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ CreateGsimAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CreateGsimAccountComponent]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -20,9 +20,7 @@ import { Dates } from 'app/core/utils/dates';
|
||||
templateUrl: './create-gsim-account.component.html',
|
||||
styleUrls: ['./create-gsim-account.component.scss']
|
||||
})
|
||||
|
||||
export class CreateGsimAccountComponent {
|
||||
|
||||
/** Savings Account Template */
|
||||
savingsAccountTemplate: any;
|
||||
/** Savings Account Product Template */
|
||||
@@ -33,11 +31,14 @@ export class CreateGsimAccountComponent {
|
||||
selectedMembers: any;
|
||||
|
||||
/** Savings Account Details Step */
|
||||
@ViewChild(SavingsAccountDetailsStepComponent, { static: true }) savingsAccountDetailsStep: SavingsAccountDetailsStepComponent;
|
||||
@ViewChild(SavingsAccountDetailsStepComponent, { static: true })
|
||||
savingsAccountDetailsStep: SavingsAccountDetailsStepComponent;
|
||||
/** Savings Account Terms Step */
|
||||
@ViewChild(SavingsAccountTermsStepComponent, { static: true }) savingsAccountTermsStep: SavingsAccountTermsStepComponent;
|
||||
@ViewChild(SavingsAccountTermsStepComponent, { static: true })
|
||||
savingsAccountTermsStep: SavingsAccountTermsStepComponent;
|
||||
/** Savings Account Charges Step */
|
||||
@ViewChild(SavingsAccountChargesStepComponent, { static: true }) savingsAccountChargesStep: SavingsAccountChargesStepComponent;
|
||||
@ViewChild(SavingsAccountChargesStepComponent, { static: true })
|
||||
savingsAccountChargesStep: SavingsAccountChargesStepComponent;
|
||||
|
||||
/**
|
||||
* Fetches savings account template from `resolve`
|
||||
@@ -47,13 +48,14 @@ export class CreateGsimAccountComponent {
|
||||
* @param {SavingsService} savingsService Savings Service
|
||||
* @param {SettingsService} settingsService Settings Service
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountTemplate: any, groupsData: any }) => {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dateUtils: Dates,
|
||||
private savingsService: SavingsService,
|
||||
private settingsService: SettingsService
|
||||
) {
|
||||
this.route.data.subscribe((data: { savingsAccountTemplate: any; groupsData: any }) => {
|
||||
this.savingsAccountTemplate = data.savingsAccountTemplate;
|
||||
this.dataSource = data.groupsData.activeClientMembers;
|
||||
});
|
||||
@@ -63,7 +65,7 @@ export class CreateGsimAccountComponent {
|
||||
* Sets savings account product template.
|
||||
* @param {any} $event API response
|
||||
*/
|
||||
setTemplate($event: any) {
|
||||
setTemplate($event: any) {
|
||||
this.savingsAccountProductTemplate = $event;
|
||||
}
|
||||
|
||||
@@ -84,7 +86,7 @@ export class CreateGsimAccountComponent {
|
||||
/**
|
||||
* Retrieves savings account terms form.
|
||||
*/
|
||||
get activeClientMembers() {
|
||||
get activeClientMembers() {
|
||||
return this.dataSource;
|
||||
}
|
||||
|
||||
@@ -92,10 +94,7 @@ export class CreateGsimAccountComponent {
|
||||
* Checks validity of overall savings account form.
|
||||
*/
|
||||
get savingsAccountFormValid() {
|
||||
return (
|
||||
this.savingsAccountDetailsForm.valid &&
|
||||
this.savingsAccountTermsForm.valid
|
||||
);
|
||||
return this.savingsAccountDetailsForm.valid && this.savingsAccountTermsForm.valid;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +118,7 @@ export class CreateGsimAccountComponent {
|
||||
...this.savingsAccount,
|
||||
charges: this.savingsAccount.charges.map((charge: any) => ({
|
||||
chargeId: charge.id,
|
||||
amount: charge.amount,
|
||||
amount: charge.amount
|
||||
})),
|
||||
clientId: client.id,
|
||||
isGSIM: true,
|
||||
@@ -132,7 +131,6 @@ export class CreateGsimAccountComponent {
|
||||
data.groupId = this.savingsAccountTemplate.groupId;
|
||||
|
||||
return data;
|
||||
|
||||
}
|
||||
|
||||
/** Request Body Data */
|
||||
@@ -140,9 +138,7 @@ export class CreateGsimAccountComponent {
|
||||
const requestData = [];
|
||||
const memberSelected = this.selectedMembers.selectedMembers;
|
||||
for (let index = 0; index < 1; index++) {
|
||||
requestData.push(
|
||||
this.setData( memberSelected[ index ] ),
|
||||
);
|
||||
requestData.push(this.setData(memberSelected[index]));
|
||||
}
|
||||
return requestData;
|
||||
}
|
||||
@@ -153,11 +149,16 @@ export class CreateGsimAccountComponent {
|
||||
submit() {
|
||||
const data = this.buildRequestData();
|
||||
const gsimData = {
|
||||
clientArray: data,
|
||||
clientArray: data
|
||||
};
|
||||
this.savingsService.createGsimAcccount(gsimData).subscribe((response: any) => {
|
||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -8,9 +8,8 @@ describe('GsimAccountComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ GsimAccountComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [GsimAccountComponent]
|
||||
}).compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
@@ -13,9 +13,14 @@ import { ActivatedRoute } from '@angular/router';
|
||||
styleUrls: ['./gsim-account.component.scss']
|
||||
})
|
||||
export class GsimAccountComponent implements OnInit {
|
||||
|
||||
/** Columns to be displayed in charge overview table. */
|
||||
displayedColumns: string[] = ['clientDetails', 'savingsAccount', 'products', 'balance', 'Actions'];
|
||||
displayedColumns: string[] = [
|
||||
'clientDetails',
|
||||
'savingsAccount',
|
||||
'products',
|
||||
'balance',
|
||||
'Actions'
|
||||
];
|
||||
/** Data source for charge overview table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
/** Charge Overview data */
|
||||
@@ -33,9 +38,11 @@ export class GsimAccountComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {MatDialog} dialog Dialog reference.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { gsimData: any, savingAccountData: any, groupsData: any }) => {
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { gsimData: any; savingAccountData: any; groupsData: any }) => {
|
||||
this.gsimOverviewData = data.gsimData[0].childGSIMAccounts;
|
||||
this.savingAccountData = data.savingAccountData;
|
||||
this.groupsData = data.groupsData;
|
||||
@@ -49,7 +56,7 @@ export class GsimAccountComponent implements OnInit {
|
||||
/**
|
||||
* Set Client Charge Overview.
|
||||
*/
|
||||
setLoanClientChargeOverview() {
|
||||
setLoanClientChargeOverview() {
|
||||
this.dataSource = new MatTableDataSource(this.gsimOverviewData);
|
||||
// this.dataSource.paginator = this.paginator;
|
||||
}
|
||||
@@ -58,8 +65,7 @@ export class GsimAccountComponent implements OnInit {
|
||||
* Stops the propagation to view pages.
|
||||
* @param $event Mouse Event
|
||||
*/
|
||||
routeEdit($event: MouseEvent) {
|
||||
routeEdit($event: MouseEvent) {
|
||||
$event.stopPropagation();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -13,11 +13,10 @@ import { SavingsService } from '../savings.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class GSIMViewResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {SavingsService} savingsService Savings service.
|
||||
*/
|
||||
constructor(private savingsService: SavingsService) { }
|
||||
constructor(private savingsService: SavingsService) {}
|
||||
|
||||
/**
|
||||
* Returns the Savings Account data.
|
||||
@@ -29,5 +28,4 @@ export class GSIMViewResolver implements Resolve<Object> {
|
||||
const savingAccountId = route.paramMap.get('savingAccountId');
|
||||
return this.savingsService.getGSIMAccountData(savingAccountId, groupId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user