build: Use prettier for typescript

Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
Ralph Hopman
2025-01-15 11:59:30 +00:00
committed by Adam Saghy
parent 9d6cf1514a
commit cac1d11ad7
1812 changed files with 22516 additions and 16862 deletions
@@ -8,9 +8,8 @@ describe('CheckerInboxComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CheckerInboxComponent ]
})
.compileComponents();
declarations: [CheckerInboxComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./checker-inbox.component.scss']
})
export class CheckerInboxComponent implements OnInit {
/** Data to be displayed */
searchData: any;
/** Maker Checker Template */
@@ -41,7 +40,15 @@ export class CheckerInboxComponent implements OnInit {
/** Selecting rows from table */
selection: SelectionModel<any>;
/** Displayed Column in table */
displayedColumns: string[] = ['select', 'id', 'madeOnDate', 'status', 'user', 'action', 'entity'];
displayedColumns: string[] = [
'select',
'id',
'madeOnDate',
'status',
'user',
'action',
'entity'
];
/**
* Retrieves the maker checker data from `resolve`.
@@ -53,15 +60,17 @@ export class CheckerInboxComponent implements OnInit {
* @param {TasksService} tasksService Tasks Service.
* @param {FormBuilder} formBuilder Form Builder.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
private tasksService: TasksService,
private settingsService: SettingsService,
private formBuilder: UntypedFormBuilder) {
this.route.data.subscribe((data: { makerCheckerResource: any, makerCheckerTemplate: any }) => {
private formBuilder: UntypedFormBuilder
) {
this.route.data.subscribe((data: { makerCheckerResource: any; makerCheckerTemplate: any }) => {
this.searchData = data.makerCheckerResource;
if (this.searchData.length > 0) {
this.checkerData = true;
@@ -81,11 +90,11 @@ export class CheckerInboxComponent implements OnInit {
*/
createMakerCheckerSearchForm() {
this.makerCheckerSearchForm = this.formBuilder.group({
'makerDateTimeFrom': [''],
'makerDateTimeto': [''],
'actionName': [''],
'entityName': [''],
'resourceId': ['']
makerDateTimeFrom: [''],
makerDateTimeto: [''],
actionName: [''],
entityName: [''],
resourceId: ['']
});
}
@@ -117,9 +126,9 @@ export class CheckerInboxComponent implements OnInit {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach((row: any) => this.selection.select(row));
this.isAllSelected()
? this.selection.clear()
: this.dataSource.data.forEach((row: any) => this.selection.select(row));
}
/** The label for the checkbox on the passed row */
@@ -132,7 +141,10 @@ export class CheckerInboxComponent implements OnInit {
approveChecker() {
const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Approve Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker') }
data: {
heading: this.translateService.instant('labels.heading.Approve Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker')
}
});
approveCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -143,7 +155,10 @@ export class CheckerInboxComponent implements OnInit {
rejectChecker() {
const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Reject Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker') }
data: {
heading: this.translateService.instant('labels.heading.Reject Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker')
}
});
rejectCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -154,7 +169,10 @@ export class CheckerInboxComponent implements OnInit {
deleteChecker() {
const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Delete Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker') }
data: {
heading: this.translateService.instant('labels.heading.Delete Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker')
}
});
deleteCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -201,8 +219,8 @@ export class CheckerInboxComponent implements OnInit {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
this.router
.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('ClientApprovalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ClientApprovalComponent ]
})
.compileComponents();
declarations: [ClientApprovalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -22,7 +22,6 @@ import { Dates } from 'app/core/utils/dates';
styleUrls: ['./client-approval.component.scss']
})
export class ClientApprovalComponent {
/** Grouped Clients Data */
groupedClients: any;
/** Checks to show the data */
@@ -34,7 +33,12 @@ export class ClientApprovalComponent {
/** Row Selection Data */
selection: SelectionModel<any>;
/** Displayed Columns */
displayedColumns: string[] = ['select', 'name', 'accountNumber', 'staff'];
displayedColumns: string[] = [
'select',
'name',
'accountNumber',
'staff'
];
/**
* Retrieves the grouped client data from `resolve`.
@@ -45,12 +49,14 @@ export class ClientApprovalComponent {
* @param {SettingsService} settingsService Settings Service.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService,
private tasksService: TasksService) {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { groupedClientData: any }) => {
this.groupedClients = _.groupBy(data.groupedClientData.pageItems, 'officeName');
if (Object.keys(this.groupedClients).length) {
@@ -72,9 +78,9 @@ export class ClientApprovalComponent {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle(dataSource3: any) {
if (dataSource3) {
this.isAllSelected(dataSource3) ?
dataSource3.forEach((row: any) => this.selection.deselect(row)) :
dataSource3.forEach((row: any) => this.selection.select(row));
this.isAllSelected(dataSource3)
? dataSource3.forEach((row: any) => this.selection.deselect(row))
: dataSource3.forEach((row: any) => this.selection.select(row));
}
}
@@ -94,7 +100,8 @@ export class ClientApprovalComponent {
value: new Date(),
type: 'datetime-local',
required: true
}),
})
];
const data = {
title: 'Enter Clients Activation Date',
@@ -131,7 +138,7 @@ export class ClientApprovalComponent {
});
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
response.forEach((responseEle: any) => {
if (responseEle.statusCode = '200') {
if ((responseEle.statusCode = '200')) {
activatedAccounts++;
responseEle.body = JSON.parse(responseEle.body);
if (selectedAccounts === activatedAccounts) {
@@ -152,8 +159,8 @@ export class ClientApprovalComponent {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
this.router
.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('LoanApprovalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanApprovalComponent ]
})
.compileComponents();
declarations: [LoanApprovalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./loan-approval.component.scss']
})
export class LoanApprovalComponent {
/** Offices Data */
offices: any;
/** Loans Data */
@@ -39,7 +38,13 @@ export class LoanApprovalComponent {
/** List of Requests */
batchRequests: any[];
/** Displayed Columns */
displayedColumns: string[] = ['select', 'clientName', 'loan', 'amount', 'loanPurpose'];
displayedColumns: string[] = [
'select',
'clientName',
'loan',
'amount',
'loanPurpose'
];
/**
* Retrieves the offices and loans data from `resolve`.
@@ -50,14 +55,16 @@ export class LoanApprovalComponent {
* @param {SettingsService} settingsService Settings Service.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
private settingsService: SettingsService,
private tasksService: TasksService) {
this.route.data.subscribe((data: { officesData: any, loansData: any }) => {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { officesData: any; loansData: any }) => {
this.offices = data.officesData;
this.loans = data.loansData.pageItems;
this.setOfficeData();
@@ -107,9 +114,9 @@ export class LoanApprovalComponent {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle(dataSource3: any) {
if (dataSource3) {
this.isAllSelected(dataSource3) ?
dataSource3.forEach((row: any) => this.selection.deselect(row)) :
dataSource3.forEach((row: any) => this.selection.select(row));
this.isAllSelected(dataSource3)
? dataSource3.forEach((row: any) => this.selection.deselect(row))
: dataSource3.forEach((row: any) => this.selection.select(row));
}
}
@@ -123,7 +130,10 @@ export class LoanApprovalComponent {
approveLoan() {
const approveLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Approve Loan'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Approve Loan') }
data: {
heading: this.translateService.instant('labels.heading.Approve Loan'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Approve Loan')
}
});
approveLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -154,7 +164,7 @@ export class LoanApprovalComponent {
});
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
response.forEach((responseEle: any) => {
if (responseEle.statusCode = '200') {
if ((responseEle.statusCode = '200')) {
approvedAccounts++;
responseEle.body = JSON.parse(responseEle.body);
if (selectedAccounts === approvedAccounts) {
@@ -174,7 +184,7 @@ export class LoanApprovalComponent {
this.tasksService.getAllLoansToBeApproved().subscribe((response: any) => {
this.loans = response.pageItems;
this.loans = this.loans.filter((account: any) => {
return (account.status.waitingForDisbursal === true);
return account.status.waitingForDisbursal === true;
});
this.dataSource = new MatTableDataSource(this.loans);
this.selection = new SelectionModel(true, []);
@@ -187,8 +197,8 @@ export class LoanApprovalComponent {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
this.router
.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('LoanDisbursalComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ LoanDisbursalComponent ]
})
.compileComponents();
declarations: [LoanDisbursalComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -20,7 +20,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./loan-disbursal.component.scss']
})
export class LoanDisbursalComponent {
/** Loans Data */
loans: any;
/** Batch Requests */
@@ -30,7 +29,13 @@ export class LoanDisbursalComponent {
/** Row Selection */
selection: SelectionModel<any>;
/** Displayed Columns for loan disbursal data */
displayedColumns: string[] = ['select', 'client', 'loanAccountNumber', 'loanProduct', 'principal'];
displayedColumns: string[] = [
'select',
'client',
'loanAccountNumber',
'loanProduct',
'principal'
];
/**
* Retrieves the loans data from `resolve`.
@@ -41,16 +46,18 @@ export class LoanDisbursalComponent {
* @param {SettingsService} settingsService Settings Service.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
private tasksService: TasksService) {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { loansData: any }) => {
this.loans = data.loansData.pageItems;
this.loans = this.loans.filter((account: any) => {
return (account.status.waitingForDisbursal === true);
return account.status.waitingForDisbursal === true;
});
this.dataSource = new MatTableDataSource(this.loans);
this.selection = new SelectionModel(true, []);
@@ -66,9 +73,9 @@ export class LoanDisbursalComponent {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach((row: any) => this.selection.select(row));
this.isAllSelected()
? this.selection.clear()
: this.dataSource.data.forEach((row: any) => this.selection.select(row));
}
/** The label for the checkbox on the passed row */
@@ -81,7 +88,10 @@ export class LoanDisbursalComponent {
disburseLoan() {
const disburseLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Loan Disbursal'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan') }
data: {
heading: this.translateService.instant('labels.heading.Loan Disbursal'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to Disburse Loan')
}
});
disburseLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -112,7 +122,7 @@ export class LoanDisbursalComponent {
});
this.tasksService.submitBatchData(this.batchRequests).subscribe((response: any) => {
response.forEach((responseEle: any) => {
if (responseEle.statusCode = '200') {
if ((responseEle.statusCode = '200')) {
approvedAccounts++;
responseEle.body = JSON.parse(responseEle.body);
if (selectedAccounts === approvedAccounts) {
@@ -127,7 +137,7 @@ export class LoanDisbursalComponent {
this.tasksService.getAllLoansToBeDisbursed().subscribe((response: any) => {
this.loans = response.pageItems;
this.loans = this.loans.filter((account: any) => {
return (account.status.waitingForDisbursal === true);
return account.status.waitingForDisbursal === true;
});
this.dataSource = new MatTableDataSource(this.loans);
this.selection = new SelectionModel(true, []);
@@ -137,5 +147,4 @@ export class LoanDisbursalComponent {
applyFilter(filterValue: string = '') {
this.dataSource.filter = filterValue.trim().toLowerCase();
}
}
@@ -8,9 +8,8 @@ describe('RescheduleLoanComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ RescheduleLoanComponent ]
})
.compileComponents();
declarations: [RescheduleLoanComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -21,7 +21,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./reschedule-loan.component.scss']
})
export class RescheduleLoanComponent {
/** Loans Data */
loans: any;
/** Datasource */
@@ -31,7 +30,14 @@ export class RescheduleLoanComponent {
/** Batch Requests */
batchRequests: any[];
/** Displayed Columns */
displayedColumns: string[] = ['select', 'client', 'rescheduleRequestNo', 'loanAccountNo', 'rescheduleForm', 'rescheduleReason'];
displayedColumns: string[] = [
'select',
'client',
'rescheduleRequestNo',
'loanAccountNo',
'rescheduleForm',
'rescheduleReason'
];
/**
* Retrieves the reschedule loan data from `resolve`.
@@ -42,13 +48,15 @@ export class RescheduleLoanComponent {
* @param {SettingsService} settingsService Settings Service.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService,
private translateService: TranslateService,
private tasksService: TasksService) {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { recheduleLoansData: any }) => {
this.loans = data.recheduleLoansData;
this.dataSource = new MatTableDataSource(this.loans);
@@ -65,9 +73,9 @@ export class RescheduleLoanComponent {
/** Selects all rows if they are not all selected; otherwise clear selection. */
masterToggle() {
this.isAllSelected() ?
this.selection.clear() :
this.dataSource.data.forEach((row: any) => this.selection.select(row));
this.isAllSelected()
? this.selection.clear()
: this.dataSource.data.forEach((row: any) => this.selection.select(row));
}
/** The label for the checkbox on the passed row */
@@ -80,7 +88,13 @@ export class RescheduleLoanComponent {
bulkLoanReschedule(action: string) {
const rescheduleLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Reschedule Loan'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to') + action + this.translateService.instant('labels.dialogContext.the Reschedule Loan') }
data: {
heading: this.translateService.instant('labels.heading.Reschedule Loan'),
dialogContext:
this.translateService.instant('labels.dialogContext.Are you sure you want to') +
action +
this.translateService.instant('labels.dialogContext.the Reschedule Loan')
}
});
rescheduleLoanDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -126,8 +140,8 @@ export class RescheduleLoanComponent {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
this.router
.navigateByUrl(`/checker-inbox-and-tasks`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
}
@@ -8,9 +8,8 @@ describe('CheckerInboxAndTasksComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ CheckerInboxAndTasksComponent ]
})
.compileComponents();
declarations: [CheckerInboxAndTasksComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -10,7 +10,5 @@ import { Component } from '@angular/core';
styleUrls: ['./checker-inbox-and-tasks.component.scss']
})
export class CheckerInboxAndTasksComponent {
constructor() { }
constructor() {}
}
@@ -13,19 +13,17 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetCheckerInboxDetailResolver implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns the detail data of the checker inbox.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const checkerId = route.paramMap.get('id');
return this.tasksService.getCheckerInboxDetail(checkerId);
}
/**
* Returns the detail data of the checker inbox.
* @returns {Observable<any>}
*/
resolve(route: ActivatedRouteSnapshot): Observable<any> {
const checkerId = route.paramMap.get('id');
return this.tasksService.getCheckerInboxDetail(checkerId);
}
}
@@ -13,7 +13,6 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetGroupedClientsData implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
@@ -26,5 +25,4 @@ export class GetGroupedClientsData implements Resolve<Object> {
resolve(): Observable<any> {
return this.tasksService.getGroupedClientsData();
}
}
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetLoansToBeApproved implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns all the loans data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllLoansToBeApproved();
}
/**
* Returns all the loans data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllLoansToBeApproved();
}
}
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetLoansToBeDisbursed implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns all the loans data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllLoansToBeDisbursed();
}
/**
* Returns all the loans data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllLoansToBeDisbursed();
}
}
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetOffices implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns the offices data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllOffices();
}
/**
* Returns the offices data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getAllOffices();
}
}
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetRescheduleLoans implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns the pending reschedule data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getPendingRescheduleLoans();
}
/**
* Returns the pending reschedule data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getPendingRescheduleLoans();
}
}
@@ -13,7 +13,6 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class GetMakerCheckers implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
@@ -26,5 +25,4 @@ export class GetMakerCheckers implements Resolve<Object> {
resolve(): Observable<any> {
return this.tasksService.getMakerCheckerData();
}
}
@@ -13,18 +13,16 @@ import { TasksService } from '../tasks.service';
*/
@Injectable()
export class MakerCheckerTemplate implements Resolve<Object> {
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) {}
/**
* @param {TasksService} tasksService Tasks service.
*/
constructor(private tasksService: TasksService) { }
/**
* Returns the maker checker template data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getMakerCheckerTemplate();
}
/**
* Returns the maker checker template data.
* @returns {Observable<any>}
*/
resolve(): Observable<any> {
return this.tasksService.getMakerCheckerTemplate();
}
}
+5 -4
View File
@@ -47,7 +47,7 @@ const routes: Routes = [
data: { title: 'Client Approval' },
resolve: {
groupedClientData: GetGroupedClientsData
},
}
},
{
path: 'loan-approval',
@@ -56,7 +56,7 @@ const routes: Routes = [
resolve: {
officesData: GetOffices,
loansData: GetLoansToBeApproved
},
}
},
{
path: 'loan-disbursal',
@@ -88,8 +88,9 @@ const routes: Routes = [
}
}
]
},
}
])
];
@NgModule({
@@ -106,4 +107,4 @@ const routes: Routes = [
GetCheckerInboxDetailResolver
]
})
export class TasksRoutingModule { }
export class TasksRoutingModule {}
+2 -2
View File
@@ -34,6 +34,6 @@ import { ViewCheckerInboxComponent } from './view-checker-inbox/view-checker-inb
RescheduleLoanComponent,
ViewCheckerInboxComponent
],
providers: [ ]
providers: []
})
export class TasksModule { }
export class TasksModule {}
+5 -10
View File
@@ -12,11 +12,10 @@ import { Observable } from 'rxjs';
providedIn: 'root'
})
export class TasksService {
/**
* @param {HttpClient} http Http Client to send requests.
*/
constructor(private http: HttpClient) { }
constructor(private http: HttpClient) {}
/**
* Get Maker Checker Data
@@ -47,9 +46,8 @@ export class TasksService {
* Get Grouped Clients Data
*/
getGroupedClientsData(): Observable<any> {
const httpParams = new HttpParams().set('limit', '1000')
.set('status', 'PENDING');
return this.http.get('/clients', { params: httpParams});
const httpParams = new HttpParams().set('limit', '1000').set('status', 'PENDING');
return this.http.get('/clients', { params: httpParams });
}
/**
@@ -63,8 +61,7 @@ export class TasksService {
* Get all loans to be approved
*/
getAllLoansToBeApproved(): Observable<any> {
const httpParams = new HttpParams().set('limit', '1000')
.set('status', '100');
const httpParams = new HttpParams().set('limit', '1000').set('status', '100');
return this.http.get('/loans', { params: httpParams });
}
@@ -72,8 +69,7 @@ export class TasksService {
* Get all loans to be created
*/
getAllLoansToBeDisbursed(): Observable<any> {
const httpParams = new HttpParams().set('limit', '1000')
.set('status', '200');
const httpParams = new HttpParams().set('limit', '1000').set('status', '200');
return this.http.get('/loans', { params: httpParams });
}
@@ -126,5 +122,4 @@ export class TasksService {
getCheckerInboxDetail(makerCheckerId: any): Observable<any> {
return this.http.get(`/audits/${makerCheckerId}`);
}
}
@@ -8,9 +8,8 @@ describe('ViewCheckerInboxComponent', () => {
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [ ViewCheckerInboxComponent ]
})
.compileComponents();
declarations: [ViewCheckerInboxComponent]
}).compileComponents();
}));
beforeEach(() => {
@@ -17,7 +17,6 @@ import { TranslateService } from '@ngx-translate/core';
styleUrls: ['./view-checker-inbox.component.scss']
})
export class ViewCheckerInboxComponent {
/** Checker Inbox Details Data */
checkerInboxDetail: any;
/** JsonData */
@@ -32,25 +31,29 @@ export class ViewCheckerInboxComponent {
* @param {router} router Router.
* @param {TasksService} tasksService Tasks Service.
*/
constructor(private route: ActivatedRoute,
constructor(
private route: ActivatedRoute,
private dialog: MatDialog,
private router: Router,
private translateService: TranslateService,
private tasksService: TasksService) {
private tasksService: TasksService
) {
this.route.data.subscribe((data: { checkerInboxDetail: any }) => {
this.checkerInboxDetail = data.checkerInboxDetail;
this.jsondata = JSON.parse(this.checkerInboxDetail.commandAsJson);
this.displayJSONData = !(_.isEmpty(this.jsondata));
this.displayJSONData = !_.isEmpty(this.jsondata);
});
}
/**
* Approve Checker
*/
approveChecker() {
const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Approve Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker') }
data: {
heading: this.translateService.instant('labels.heading.Approve Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to approve checker')
}
});
approveCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -66,7 +69,10 @@ export class ViewCheckerInboxComponent {
*/
rejectChecker() {
const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Reject Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker') }
data: {
heading: this.translateService.instant('labels.heading.Reject Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to reject checker')
}
});
rejectCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -82,7 +88,10 @@ export class ViewCheckerInboxComponent {
*/
deleteChecker() {
const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: this.translateService.instant('labels.heading.Delete Checker'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker') }
data: {
heading: this.translateService.instant('labels.heading.Delete Checker'),
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to delete checker')
}
});
deleteCheckerDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -92,5 +101,4 @@ export class ViewCheckerInboxComponent {
}
});
}
}