build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
-2
@@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanProvisioningCriteriaAndTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Products service.
|
||||
*/
|
||||
@@ -27,5 +26,4 @@ export class LoanProvisioningCriteriaAndTemplateResolver implements Resolve<Obje
|
||||
const provisioningId = route.paramMap.get('id');
|
||||
return this.organizationService.getProvisioningCriteria(provisioningId, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanProvisioningCriteriaTemplateResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Products service.
|
||||
*/
|
||||
@@ -26,5 +25,4 @@ export class LoanProvisioningCriteriaTemplateResolver implements Resolve<Object>
|
||||
resolve(): Observable<any> {
|
||||
return this.organizationService.getProvisioningCriteriaTemplate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanProvisioningCriteriaResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Organization service.
|
||||
*/
|
||||
@@ -27,5 +26,4 @@ export class LoanProvisioningCriteriaResolver implements Resolve<Object> {
|
||||
const provisioningId = route.paramMap.get('id');
|
||||
return this.organizationService.getProvisioningCriteria(provisioningId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
-2
@@ -13,7 +13,6 @@ import { OrganizationService } from '../../organization.service';
|
||||
*/
|
||||
@Injectable()
|
||||
export class LoanProvisioningCriteriasResolver implements Resolve<Object> {
|
||||
|
||||
/**
|
||||
* @param {OrganizationService} organizationService Products service.
|
||||
*/
|
||||
@@ -26,5 +25,4 @@ export class LoanProvisioningCriteriasResolver implements Resolve<Object> {
|
||||
resolve(): Observable<any> {
|
||||
return this.organizationService.getProvisioningCriterias();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('CreateLoanProvisioningCriteriaComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ CreateLoanProvisioningCriteriaComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [CreateLoanProvisioningCriteriaComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+96
-64
@@ -26,7 +26,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./create-loan-provisioning-criteria.component.scss']
|
||||
})
|
||||
export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
|
||||
/** Loan Provisioning Criteria form. */
|
||||
provisioningCriteriaForm: UntypedFormGroup;
|
||||
/** Loan Provisioning Criteria Template */
|
||||
@@ -37,16 +36,24 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
expenseAccounts: any;
|
||||
|
||||
/** Columns to be displayed in definitions table. */
|
||||
displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount', 'edit'];
|
||||
displayedColumns: string[] = [
|
||||
'category',
|
||||
'minAge',
|
||||
'maxAge',
|
||||
'percentage',
|
||||
'liabilityAccount',
|
||||
'expenseAccount',
|
||||
'edit'
|
||||
];
|
||||
/** Criteria Definitions Array */
|
||||
definitions: {
|
||||
categoryId: number,
|
||||
categoryName: string,
|
||||
maxAge?: number,
|
||||
minAge?: number,
|
||||
liabilityAccount?: string,
|
||||
expenseAccount?: string,
|
||||
provisioningPercentage?: number
|
||||
categoryId: number;
|
||||
categoryName: string;
|
||||
maxAge?: number;
|
||||
minAge?: number;
|
||||
liabilityAccount?: string;
|
||||
expenseAccount?: string;
|
||||
provisioningPercentage?: number;
|
||||
}[] = [];
|
||||
/** Checks Definitons Table Validity */
|
||||
isDefinitionValid: any = {};
|
||||
@@ -59,18 +66,24 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private organizationService: OrganizationService,
|
||||
private settingsService: SettingsService,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteriaTemplate: any }) => {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private organizationService: OrganizationService,
|
||||
private settingsService: SettingsService,
|
||||
private router: Router,
|
||||
public dialog: MatDialog,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteriaTemplate: any }) => {
|
||||
this.loanProvisioningCriteriaTemplate = data.loanProvisioningCriteriaTemplate;
|
||||
this.definitions = this.loanProvisioningCriteriaTemplate.definitions;
|
||||
this.liabilityAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter((account: any) => account.type.value === 'LIABILITY');
|
||||
this.expenseAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter((account: any) => account.type.value === 'EXPENSE');
|
||||
});
|
||||
this.liabilityAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter(
|
||||
(account: any) => account.type.value === 'LIABILITY'
|
||||
);
|
||||
this.expenseAccounts = this.loanProvisioningCriteriaTemplate.glAccounts.filter(
|
||||
(account: any) => account.type.value === 'EXPENSE'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -82,8 +95,11 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
*/
|
||||
createProvisioningCriteriaForm() {
|
||||
this.provisioningCriteriaForm = this.formBuilder.group({
|
||||
'criteriaName': ['', Validators.required],
|
||||
'loanProducts': ['']
|
||||
criteriaName: [
|
||||
'',
|
||||
Validators.required
|
||||
],
|
||||
loanProducts: ['']
|
||||
});
|
||||
}
|
||||
|
||||
@@ -119,46 +135,56 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
*/
|
||||
getDefinitionFormFields(definition: any) {
|
||||
const formfields: FormfieldBase[] = [];
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'minAge',
|
||||
label: 'Min Age',
|
||||
value: definition ? definition.minAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 1
|
||||
}));
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'maxAge',
|
||||
label: 'Max Age',
|
||||
value: definition ? definition.maxAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 2
|
||||
}));
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'provisioningPercentage',
|
||||
label: 'Percentage (%)',
|
||||
value: definition ? definition.provisioningPercentage : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 3
|
||||
}));
|
||||
formfields.push(new SelectBase({
|
||||
controlName: 'liabilityAccount',
|
||||
label: 'Liability Account',
|
||||
value: definition ? definition.liabilityAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.liabilityAccounts },
|
||||
required: true,
|
||||
order: 4
|
||||
}));
|
||||
formfields.push(new SelectBase({
|
||||
controlName: 'expenseAccount',
|
||||
label: 'Expense Account',
|
||||
value: definition ? definition.expenseAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.expenseAccounts },
|
||||
required: true,
|
||||
order: 5
|
||||
}));
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'minAge',
|
||||
label: 'Min Age',
|
||||
value: definition ? definition.minAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 1
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'maxAge',
|
||||
label: 'Max Age',
|
||||
value: definition ? definition.maxAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 2
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'provisioningPercentage',
|
||||
label: 'Percentage (%)',
|
||||
value: definition ? definition.provisioningPercentage : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 3
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new SelectBase({
|
||||
controlName: 'liabilityAccount',
|
||||
label: 'Liability Account',
|
||||
value: definition ? definition.liabilityAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.liabilityAccounts },
|
||||
required: true,
|
||||
order: 4
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new SelectBase({
|
||||
controlName: 'expenseAccount',
|
||||
label: 'Expense Account',
|
||||
value: definition ? definition.expenseAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.expenseAccounts },
|
||||
required: true,
|
||||
order: 5
|
||||
})
|
||||
);
|
||||
return formfields;
|
||||
}
|
||||
|
||||
@@ -166,7 +192,8 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
* Returns validity of form and table.
|
||||
*/
|
||||
get provisioningCriteriaFormValid() {
|
||||
const definitionsValid: boolean = Object.entries(this.isDefinitionValid).length === this.definitions.length ? true : false;
|
||||
const definitionsValid: boolean =
|
||||
Object.entries(this.isDefinitionValid).length === this.definitions.length ? true : false;
|
||||
return this.provisioningCriteriaForm.valid && definitionsValid;
|
||||
}
|
||||
|
||||
@@ -186,8 +213,13 @@ export class CreateLoanProvisioningCriteriaComponent implements OnInit {
|
||||
locale
|
||||
};
|
||||
this.organizationService.createProvisioningCriteria(loanProvisioningCriteria).subscribe((response: any) => {
|
||||
this.router.navigate(['../', response.resourceId], { relativeTo: this.route });
|
||||
this.router.navigate(
|
||||
[
|
||||
'../',
|
||||
response.resourceId
|
||||
],
|
||||
{ relativeTo: this.route }
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('EditLoanProvisioningCriteriaComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EditLoanProvisioningCriteriaComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [EditLoanProvisioningCriteriaComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+95
-66
@@ -26,7 +26,6 @@ import { SettingsService } from 'app/settings/settings.service';
|
||||
styleUrls: ['./edit-loan-provisioning-criteria.component.scss']
|
||||
})
|
||||
export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
|
||||
/** Loan Provisioning Criteria form. */
|
||||
provisioningCriteriaForm: UntypedFormGroup;
|
||||
/** Loan Provisioning Criteria Template */
|
||||
@@ -39,16 +38,24 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
loanProducts: any;
|
||||
|
||||
/** Columns to be displayed in definitions table. */
|
||||
displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount', 'edit'];
|
||||
displayedColumns: string[] = [
|
||||
'category',
|
||||
'minAge',
|
||||
'maxAge',
|
||||
'percentage',
|
||||
'liabilityAccount',
|
||||
'expenseAccount',
|
||||
'edit'
|
||||
];
|
||||
/** Criteria Definitions Array */
|
||||
definitions: {
|
||||
categoryId: number,
|
||||
categoryName: string,
|
||||
maxAge?: number,
|
||||
minAge?: number,
|
||||
liabilityAccount?: string,
|
||||
expenseAccount?: string,
|
||||
provisioningPercentage?: number
|
||||
categoryId: number;
|
||||
categoryName: string;
|
||||
maxAge?: number;
|
||||
minAge?: number;
|
||||
liabilityAccount?: string;
|
||||
expenseAccount?: string;
|
||||
provisioningPercentage?: number;
|
||||
}[] = [];
|
||||
|
||||
/**
|
||||
@@ -59,19 +66,27 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
* @param {Router} router Router for navigation.
|
||||
*/
|
||||
constructor(private formBuilder: UntypedFormBuilder,
|
||||
private organizationService: OrganizationService,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService,
|
||||
public dialog: MatDialog,
|
||||
private route: ActivatedRoute) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteriaAndTemplate: any }) => {
|
||||
constructor(
|
||||
private formBuilder: UntypedFormBuilder,
|
||||
private organizationService: OrganizationService,
|
||||
private router: Router,
|
||||
private settingsService: SettingsService,
|
||||
public dialog: MatDialog,
|
||||
private route: ActivatedRoute
|
||||
) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteriaAndTemplate: any }) => {
|
||||
this.loanProvisioningCriteriaAndTemplate = data.loanProvisioningCriteriaAndTemplate;
|
||||
this.definitions = this.loanProvisioningCriteriaAndTemplate.definitions;
|
||||
this.loanProducts = this.loanProvisioningCriteriaAndTemplate.loanProducts.concat(this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts);
|
||||
this.liabilityAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter((account: any) => account.type.value === 'LIABILITY');
|
||||
this.expenseAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter((account: any) => account.type.value === 'EXPENSE');
|
||||
});
|
||||
this.loanProducts = this.loanProvisioningCriteriaAndTemplate.loanProducts.concat(
|
||||
this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts
|
||||
);
|
||||
this.liabilityAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter(
|
||||
(account: any) => account.type.value === 'LIABILITY'
|
||||
);
|
||||
this.expenseAccounts = this.loanProvisioningCriteriaAndTemplate.glAccounts.filter(
|
||||
(account: any) => account.type.value === 'EXPENSE'
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -83,8 +98,11 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
*/
|
||||
createProvisioningCriteriaForm() {
|
||||
this.provisioningCriteriaForm = this.formBuilder.group({
|
||||
'criteriaName': [this.loanProvisioningCriteriaAndTemplate.criteriaName, Validators.required],
|
||||
'loanProducts': [this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts]
|
||||
criteriaName: [
|
||||
this.loanProvisioningCriteriaAndTemplate.criteriaName,
|
||||
Validators.required
|
||||
],
|
||||
loanProducts: [this.loanProvisioningCriteriaAndTemplate.selectedLoanProducts]
|
||||
});
|
||||
}
|
||||
|
||||
@@ -128,46 +146,56 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
*/
|
||||
getDefinitionFormFields(definition: any) {
|
||||
const formfields: FormfieldBase[] = [];
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'minAge',
|
||||
label: 'Min Age',
|
||||
value: definition ? definition.minAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 1
|
||||
}));
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'maxAge',
|
||||
label: 'Max Age',
|
||||
value: definition ? definition.maxAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 2
|
||||
}));
|
||||
formfields.push(new InputBase({
|
||||
controlName: 'provisioningPercentage',
|
||||
label: 'Percentage (%)',
|
||||
value: definition ? definition.provisioningPercentage : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 3
|
||||
}));
|
||||
formfields.push(new SelectBase({
|
||||
controlName: 'liabilityAccount',
|
||||
label: 'Liability Account',
|
||||
value: definition ? definition.liabilityAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.liabilityAccounts },
|
||||
required: true,
|
||||
order: 4
|
||||
}));
|
||||
formfields.push(new SelectBase({
|
||||
controlName: 'expenseAccount',
|
||||
label: 'Expense Account',
|
||||
value: definition ? definition.expenseAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.expenseAccounts },
|
||||
required: true,
|
||||
order: 5
|
||||
}));
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'minAge',
|
||||
label: 'Min Age',
|
||||
value: definition ? definition.minAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 1
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'maxAge',
|
||||
label: 'Max Age',
|
||||
value: definition ? definition.maxAge : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 2
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new InputBase({
|
||||
controlName: 'provisioningPercentage',
|
||||
label: 'Percentage (%)',
|
||||
value: definition ? definition.provisioningPercentage : '',
|
||||
type: 'number',
|
||||
required: true,
|
||||
order: 3
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new SelectBase({
|
||||
controlName: 'liabilityAccount',
|
||||
label: 'Liability Account',
|
||||
value: definition ? definition.liabilityAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.liabilityAccounts },
|
||||
required: true,
|
||||
order: 4
|
||||
})
|
||||
);
|
||||
formfields.push(
|
||||
new SelectBase({
|
||||
controlName: 'expenseAccount',
|
||||
label: 'Expense Account',
|
||||
value: definition ? definition.expenseAccount : '',
|
||||
options: { label: 'name', value: 'id', data: this.expenseAccounts },
|
||||
required: true,
|
||||
order: 5
|
||||
})
|
||||
);
|
||||
return formfields;
|
||||
}
|
||||
|
||||
@@ -193,9 +221,10 @@ export class EditLoanProvisioningCriteriaComponent implements OnInit {
|
||||
definitions: this.definitions,
|
||||
locale
|
||||
};
|
||||
this.organizationService.updateProvisioningCriteria(this.loanProvisioningCriteriaAndTemplate.criteriaId, loanProvisioningCriteria).subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
this.organizationService
|
||||
.updateProvisioningCriteria(this.loanProvisioningCriteriaAndTemplate.criteriaId, loanProvisioningCriteria)
|
||||
.subscribe((response: any) => {
|
||||
this.router.navigate(['../'], { relativeTo: this.route });
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('LoanProvisioningCriteriaComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LoanProvisioningCriteriaComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [LoanProvisioningCriteriaComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+5
-4
@@ -17,11 +17,13 @@ import { of } from 'rxjs';
|
||||
styleUrls: ['./loan-provisioning-criteria.component.scss']
|
||||
})
|
||||
export class LoanProvisioningCriteriaComponent implements OnInit {
|
||||
|
||||
/** Loan Provisioning Criteria data. */
|
||||
loanProvisioningCriteriaData: any;
|
||||
/** Columns to be displayed in loan provisioning criteria table. */
|
||||
displayedColumns: string[] = ['criteriaName', 'createdBy'];
|
||||
displayedColumns: string[] = [
|
||||
'criteriaName',
|
||||
'createdBy'
|
||||
];
|
||||
/** Data source for loan provisioning criteria table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
@@ -35,7 +37,7 @@ export class LoanProvisioningCriteriaComponent implements OnInit {
|
||||
* @param {ActivatedRoute} route Activated Route.
|
||||
*/
|
||||
constructor(private route: ActivatedRoute) {
|
||||
this.route.data.subscribe(( data: { loanProvisioningCriterias: any }) => {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriterias: any }) => {
|
||||
this.loanProvisioningCriteriaData = data.loanProvisioningCriterias;
|
||||
});
|
||||
}
|
||||
@@ -63,5 +65,4 @@ export class LoanProvisioningCriteriaComponent implements OnInit {
|
||||
this.dataSource.paginator = this.paginator;
|
||||
this.dataSource.sort = this.sort;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('ViewLoanProvisioningCriteriaComponent', () => {
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ ViewLoanProvisioningCriteriaComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [ViewLoanProvisioningCriteriaComponent]
|
||||
}).compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
|
||||
+20
-14
@@ -19,13 +19,19 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
|
||||
styleUrls: ['./view-loan-provisioning-criteria.component.scss']
|
||||
})
|
||||
export class ViewLoanProvisioningCriteriaComponent implements OnInit {
|
||||
|
||||
/** Loan Provisioning data. */
|
||||
provisioningData: any;
|
||||
/** Loan Product String. */
|
||||
loanProducts = '';
|
||||
/** Column Headers for Mat Table. */
|
||||
displayedColumns: string[] = ['category', 'minAge', 'maxAge', 'percentage', 'liabilityAccount', 'expenseAccount'];
|
||||
displayedColumns: string[] = [
|
||||
'category',
|
||||
'minAge',
|
||||
'maxAge',
|
||||
'percentage',
|
||||
'liabilityAccount',
|
||||
'expenseAccount'
|
||||
];
|
||||
/** Data source for loan provisioning criteria table. */
|
||||
dataSource: MatTableDataSource<any>;
|
||||
|
||||
@@ -36,12 +42,14 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit {
|
||||
* @param {Router} router Router for navigation.
|
||||
* @param {MatDialog} dialog Dialog reference.
|
||||
*/
|
||||
constructor(private organizationService: OrganizationService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
public dialog: MatDialog) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteria: any }) => {
|
||||
this.provisioningData = data.loanProvisioningCriteria;
|
||||
constructor(
|
||||
private organizationService: OrganizationService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
public dialog: MatDialog
|
||||
) {
|
||||
this.route.data.subscribe((data: { loanProvisioningCriteria: any }) => {
|
||||
this.provisioningData = data.loanProvisioningCriteria;
|
||||
});
|
||||
}
|
||||
|
||||
@@ -55,7 +63,7 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit {
|
||||
setLoanProvisioningSelectedCriteria() {
|
||||
this.dataSource = new MatTableDataSource(this.provisioningData.definitions);
|
||||
|
||||
/** Get load products as a string. */
|
||||
/** Get load products as a string. */
|
||||
for (let _id = 0; _id < this.provisioningData.loanProducts.length; _id++) {
|
||||
this.loanProducts += this.provisioningData.loanProducts[_id].name + ',';
|
||||
}
|
||||
@@ -70,12 +78,10 @@ export class ViewLoanProvisioningCriteriaComponent implements OnInit {
|
||||
});
|
||||
deleteCriteriaDialogRef.afterClosed().subscribe((response: any) => {
|
||||
if (response.delete) {
|
||||
this.organizationService.deleteProvisioningCriteria(this.provisioningData.criteriaId)
|
||||
.subscribe(() => {
|
||||
this.router.navigate(['/organization/provisioningcriteria']);
|
||||
});
|
||||
this.organizationService.deleteProvisioningCriteria(this.provisioningData.criteriaId).subscribe(() => {
|
||||
this.router.navigate(['/organization/provisioningcriteria']);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user