build: Replace Codelyzer and TSLint with Angular ESLint

Migrate from the deprecated TSLint to Angluar ESLint. Also fix current
linting issues in the code, in particular:

- Use strict equals operators (=== and !==)
- Remove empty lifecycle methods (mostly ngOnInit)
- Output bindings including aliases should not be named as standard dom
  events (submit)
- Async pipe results should not be negated
This commit is contained in:
Ralph Hopman
2024-11-08 09:37:08 +01:00
committed by Adam Saghy
parent e910679673
commit 9034ce2847
204 changed files with 2184 additions and 1173 deletions
@@ -76,7 +76,7 @@
<ng-template matStepLabel>{{"labels.inputs.PREVIEW" | translate}}</ng-template>
<mifosx-loans-account-preview-step [loansAccountTemplate]="loansAccountTemplate"
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submit)="submit()">
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submitEvent)="submit()">
</mifosx-loans-account-preview-step>
</mat-step>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';
import { Component, QueryList, ViewChild, ViewChildren } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
/** Custom Services */
@@ -21,7 +21,7 @@ import { LoansAccountDatatableStepComponent } from '../loans-account-stepper/loa
templateUrl: './create-loans-account.component.html',
styleUrls: ['./create-loans-account.component.scss']
})
export class CreateLoansAccountComponent implements OnInit {
export class CreateLoansAccountComponent {
/** Imports all the step component */
@ViewChild(LoansAccountDetailsStepComponent, { static: true }) loansAccountDetailsStep: LoansAccountDetailsStepComponent;
@@ -63,8 +63,6 @@ export class CreateLoansAccountComponent implements OnInit {
});
}
ngOnInit() { }
/**
* Sets loans account product template and collateral template
* @param {any} $event API response
@@ -1,4 +1,4 @@
import { Component, Inject, OnInit } from '@angular/core';
import { Component, Inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
@@ -7,7 +7,7 @@ import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog';
templateUrl: './loan-delinquency-action-dialog.component.html',
styleUrls: ['./loan-delinquency-action-dialog.component.scss']
})
export class LoanDelinquencyActionDialogComponent implements OnInit {
export class LoanDelinquencyActionDialogComponent {
delinquencyActionForm: UntypedFormGroup;
/** Minimum date allowed. */
@@ -21,8 +21,6 @@ export class LoanDelinquencyActionDialogComponent implements OnInit {
this.createDelinquencyActionForm();
}
ngOnInit(): void { }
createDelinquencyActionForm() {
this.delinquencyActionForm = this.formBuilder.group({
'startDate': [new Date(), Validators.required],
@@ -68,7 +68,7 @@
<ng-template matStepLabel>{{"labels.inputs.PREVIEW" | translate}}</ng-template>
<mifosx-loans-account-preview-step [loansAccountTemplate]="loansAccountAndTemplate"
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submit)="submit()">
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submitEvent)="submit()">
</mifosx-loans-account-preview-step>
</mat-step>
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { LoansService } from '../loans.service';
import { LoansAccountDetailsStepComponent } from '../loans-account-stepper/loans-account-details-step/loans-account-details-step.component';
@@ -17,7 +17,7 @@ import { Dates } from 'app/core/utils/dates';
templateUrl: './edit-loans-account.component.html',
styleUrls: ['./edit-loans-account.component.scss']
})
export class EditLoansAccountComponent implements OnInit {
export class EditLoansAccountComponent {
@ViewChild(LoansAccountDetailsStepComponent, { static: true }) loansAccountDetailsStep: LoansAccountDetailsStepComponent;
@ViewChild(LoansAccountTermsStepComponent, { static: true }) loansAccountTermsStep: LoansAccountTermsStepComponent;
@@ -53,9 +53,6 @@ export class EditLoansAccountComponent implements OnInit {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit() {
}
/**
* Sets loans account product template and collateral template
* @param {any} $event API response
@@ -58,7 +58,7 @@
<ng-template matStepLabel>{{"labels.inputs.PREVIEW" | translate}}</ng-template>
<mifosx-loans-account-preview-step [loansAccountTemplate]="loansAccountTemplate"
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submit)="submit()">
[loansAccountProductTemplate]="loansAccountProductTemplate" [loansAccount]="loansAccount" (submitEvent)="submit()">
</mifosx-loans-account-preview-step>
</mat-step>
@@ -1,4 +1,4 @@
import { Component, OnInit, ViewChild } from '@angular/core';
import { Component, ViewChild } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { Dates } from 'app/core/utils/dates';
@@ -13,7 +13,7 @@ import { GlimTermsStepComponent } from './glim-account-stepper/glim-terms-step/g
templateUrl: './create-glim-account.component.html',
styleUrls: ['./create-glim-account.component.scss']
})
export class CreateGlimAccountComponent implements OnInit {
export class CreateGlimAccountComponent {
/** Imports all the step component */
@ViewChild(GlimDetailsStepComponent, { static: true }) loansAccountDetailsStep: GlimDetailsStepComponent;
@@ -61,9 +61,6 @@ export class CreateGlimAccountComponent implements OnInit {
});
}
ngOnInit(): void {
}
/**
* Sets loans account product template and collateral template
* @param {any} $event API response
@@ -269,7 +269,7 @@
<button mat-raised-button [routerLink]="['../']">
{{"labels.buttons.Cancel" | translate}}
</button>
<button mat-raised-button color="primary" (click)="submit.emit()">
<button mat-raised-button color="primary" (click)="submitEvent.emit()">
{{"labels.buttons.Submit" | translate}}
</button>
</div>
@@ -1,11 +1,11 @@
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { Component, EventEmitter, Input, Output } from '@angular/core';
@Component({
selector: 'mifosx-glim-preview-step',
templateUrl: './glim-preview-step.component.html',
styleUrls: ['./glim-preview-step.component.scss']
})
export class GlimPreviewStepComponent implements OnInit {
export class GlimPreviewStepComponent {
/** Loans Account Template */
@@ -15,7 +15,7 @@ export class GlimPreviewStepComponent implements OnInit {
/** Loans Account Data */
@Input() loansAccount: any;
/** Submit Loans Account */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
/** Charges Displayed Columns */
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date'];
@@ -24,7 +24,4 @@ export class GlimPreviewStepComponent implements OnInit {
constructor() { }
ngOnInit(): void {
}
}
@@ -62,7 +62,7 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value === 2">
<mat-label>{{"labels.inputs.Select On" | translate}}</mat-label>
<mat-select formControlName="repaymentFrequencyNthDayType">
<mat-option
@@ -73,7 +73,7 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
<mat-form-field fxFlex="48%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value === 2">
<mat-label>{{"labels.inputs.Select Day" | translate}}</mat-label>
<mat-select formControlName="repaymentFrequencyDayOfWeekType">
<mat-option
@@ -290,7 +290,7 @@
<button mat-raised-button [routerLink]="['../..']">
{{"labels.buttons.Cancel" | translate}}
</button>
<button mat-raised-button color="primary" (click)="submit.emit()">
<button mat-raised-button color="primary" (click)="submitEvent.emit()">
{{"labels.buttons.Submit" | translate}}
</button>
</div>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input, Output, EventEmitter, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
import { Component, Input, Output, EventEmitter, OnChanges, SimpleChanges } from '@angular/core';
/**
* Create Loans Account Preview Step
@@ -9,7 +9,7 @@ import { Component, OnInit, Input, Output, EventEmitter, OnDestroy, OnChanges, S
templateUrl: './loans-account-preview-step.component.html',
styleUrls: ['./loans-account-preview-step.component.scss']
})
export class LoansAccountPreviewStepComponent implements OnInit, OnChanges {
export class LoansAccountPreviewStepComponent implements OnChanges {
/** Loans Account Template */
@Input() loansAccountTemplate: any = [];
@@ -18,7 +18,7 @@ export class LoansAccountPreviewStepComponent implements OnInit, OnChanges {
/** Loans Account Data */
@Input() loansAccount: any;
/** Submit Loans Account */
@Output() submit = new EventEmitter();
@Output() submitEvent = new EventEmitter();
/** Charges Displayed Columns */
chargesDisplayedColumns: string[] = ['name', 'chargeCalculationType', 'amount', 'chargeTimeType', 'date'];
@@ -29,8 +29,6 @@ export class LoansAccountPreviewStepComponent implements OnInit, OnChanges {
constructor() { }
ngOnInit() { }
ngOnChanges(changes: SimpleChanges): void {
this.productEnableDownPayment = this.loansAccountProductTemplate.product.enableDownPayment;
}
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
import { LoansService } from 'app/loans/loans.service';
import { SettingsService } from 'app/settings/settings.service';
@@ -8,7 +8,7 @@ import { SettingsService } from 'app/settings/settings.service';
templateUrl: './loans-account-schedule-step.component.html',
styleUrls: ['./loans-account-schedule-step.component.scss']
})
export class LoansAccountScheduleStepComponent implements OnInit {
export class LoansAccountScheduleStepComponent {
/** Currency Code */
@Input() currencyCode: string;
@@ -29,8 +29,6 @@ export class LoansAccountScheduleStepComponent implements OnInit {
this.loanId = this.route.snapshot.params['loanId'];
}
ngOnInit(): void { }
showRepaymentInfo(): void {
this.repaymentScheduleDetails = {periods: []};
const locale = this.settingsService.language.code;
@@ -83,7 +83,7 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="14%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
<mat-form-field fxFlex="14%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value === 2">
<mat-label>{{"labels.inputs.Select On" | translate}}</mat-label>
<mat-select formControlName="repaymentFrequencyNthDayType">
<mat-option *ngFor="let repaymentFrequencyNthDayType of repaymentFrequencyNthDayTypeData"
@@ -93,7 +93,7 @@
</mat-select>
</mat-form-field>
<mat-form-field fxFlex="14%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value == 2">
<mat-form-field fxFlex="14%" *ngIf="loansAccountTermsForm.controls.repaymentFrequencyType.value === 2">
<mat-label>{{"labels.inputs.Select Day" | translate}}</mat-label>
<mat-select formControlName="repaymentFrequencyDayOfWeekType">
<mat-option *ngFor="let repaymentFrequencyDayOfWeekType of repaymentFrequencyDaysOfWeekTypeData"
@@ -329,15 +329,15 @@
<span fxFlex="40%">{{"labels.inputs.Frequency Interval for recalculation" | translate}}</span>
<span fxFlex="60%">
<span>{{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.value}}</span>
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id == 3 &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyWeekday != null">
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id === 3 &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyWeekday">
on {{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyWeekday.value}}</span>
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id == 4 &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyOnDay != null">on day
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id === 4 &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyOnDay">on day
{{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyOnDay}}</span>
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id == 4 &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyOnDay == null &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyNthDay != null">on
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id === 4 &&
! loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyOnDay &&
loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyNthDay">on
{{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyNthDay.value}}
{{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyWeekday.value}}</span>
</span>
@@ -346,7 +346,7 @@
</ng-container>
<div fxFlexFill
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id != 1">
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyType.id !== 1">
<span fxFlex="40%">{{"labels.inputs.Frequency Interval for recalculation" | translate}}</span>
<span fxFlex="60%">{{ loansAccountTermsData.interestRecalculationData.recalculationRestFrequencyInterval}}</span>
</div>
@@ -401,23 +401,23 @@
</ng-container>
<ng-container
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.interestRecalculationCompoundingType.id != 0">
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.interestRecalculationCompoundingType.id !== 0">
<div fxFlexFill>
<span fxFlex="40%">{{"labels.inputs.Frequency for compounding" | translate}}</span>
<span fxFlex="60%">{{
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.value}}
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id == 3 &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyWeekday != null">
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id === 3 &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyWeekday">
on {{ loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}}
</span>
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id == 4 &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyOnDay != null">on day
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id === 4 &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyOnDay">on day
{{ loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyOnDay}}
</span>
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id == 4 &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyOnDay == null &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyNthDay != null">on
<span *ngIf="loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id === 4 &&
! loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyOnDay &&
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyNthDay">on
{{ loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyNthDay.value}}
{{ loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyWeekday.value}}
</span>
@@ -426,7 +426,7 @@
</ng-container>
<div fxFlexFill
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.interestRecalculationCompoundingType.id != 0 && loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id != 1">
*ngIf="loansAccountTermsData?.isInterestRecalculationEnabled && loansAccountTermsData.interestRecalculationData.interestRecalculationCompoundingType.id !== 0 && loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyType.id !== 1">
<span fxFlex="40%">{{"labels.inputs.Frequency Interval for compounding" | translate}}</span>
<span fxFlex="60%">{{
loansAccountTermsData.interestRecalculationData.recalculationCompoundingFrequencyInterval}}</span>
@@ -11,7 +11,7 @@
<div fxFlexFill>
<span fxFlex="50%">{{"labels.inputs.Repayments" | translate}}</span>
<span fxFlex="50%">{{loanDetails.numberOfRepayments}} every {{loanDetails.repaymentEvery}}&nbsp;{{loanDetails.repaymentFrequencyType.value | translateKey:'catalogs' }}
<span *ngIf="loanDetails.repaymentFrequencyType?.id == 2 && loanDetails.repaymentFrequencyNthDayType?.id != 0 && loanDetails.repaymentFrequencyDayOfWeekType?.id != 0" class="m-l-10">
<span *ngIf="loanDetails.repaymentFrequencyType?.id === 2 && loanDetails.repaymentFrequencyNthDayType?.id !== 0 && loanDetails.repaymentFrequencyDayOfWeekType?.id !== 0" class="m-l-10">
<span *ngIf="loanDetails.repaymentFrequencyDayOfWeekType">
<span class="m-l-10">{{"labels.commons.on" | translate}}</span>{{loanDetails.repaymentFrequencyNthDayType?.value}}
<span class="m-l-10">{{loanDetails.repaymentFrequencyDayOfWeekType?.value | translateKey:'catalogs' }}</span>
@@ -166,7 +166,7 @@
<span fxFlex="50%"> {{loanDetails.interestRecalculationData.calendarData.humanReadable}} </span>
</div>
<div fxFlexFill *ngIf="loanDetails.isInterestRecalculationEnabled && loanDetails.interestRecalculationData.interestRecalculationCompoundingType.id !=0">
<div fxFlexFill *ngIf="loanDetails.isInterestRecalculationEnabled && loanDetails.interestRecalculationData.interestRecalculationCompoundingType.id !== 0">
<span fxFlex="50%"> {{"labels.inputs.Frequency for compounding" | translate}}</span>
<span fxFlex="50%"> {{loanDetails.interestRecalculationData.compoundingCalendarData.humanReadable}} </span>
</div>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
@Component({
@@ -6,7 +6,7 @@ import { ActivatedRoute } from '@angular/router';
templateUrl: './account-details.component.html',
styleUrls: ['./account-details.component.scss']
})
export class AccountDetailsComponent implements OnInit {
export class AccountDetailsComponent {
loanDetails: any;
dataObject: {
@@ -20,7 +20,4 @@ export class AccountDetailsComponent implements OnInit {
});
}
ngOnInit() {
}
}
@@ -79,12 +79,12 @@
</button>
</span>
<button class="account-action-button" mat-raised-button color="accent" matTooltip="{{ 'tooltips.Adjust Charge' | translate}}"
*ngIf="!charge.paid && status=='Active'"
*ngIf="!charge.paid && status==='Active'"
(click)="routeEdit($event); adjustCharge(charge.id)">
<i class="fa fa-pencil"></i>
</button>
<button class="account-action-button" mat-raised-button color="primary" matTooltip="{{ 'tooltips.Pay Charge' | translate}}"
*ngIf="charge.chargePayable && !charge.paid && status=='Active'"
*ngIf="charge.chargePayable && !charge.paid && status==='Active'"
(click)="routeEdit($event); payCharge(charge.id)">
<i class="fa fa-dollar"></i>
</button>
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -17,7 +17,7 @@ import { Currency } from 'app/shared/models/general.model';
templateUrl: './make-repayment.component.html',
styleUrls: ['./make-repayment.component.scss']
})
export class MakeRepaymentComponent implements OnInit, OnDestroy {
export class MakeRepaymentComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
@@ -63,10 +63,6 @@ export class MakeRepaymentComponent implements OnInit, OnDestroy {
}
}
ngOnDestroy(): void {
}
/**
* Creates the create close form.
*/
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit, Input, OnDestroy } from '@angular/core';
import { Component, OnInit, Input } from '@angular/core';
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute, Router } from '@angular/router';
@@ -18,7 +18,7 @@ import { Currency } from 'app/shared/models/general.model';
templateUrl: './prepay-loan.component.html',
styleUrls: ['./prepay-loan.component.scss']
})
export class PrepayLoanComponent implements OnInit, OnDestroy {
export class PrepayLoanComponent implements OnInit {
@Input() dataObject: any;
/** Loan Id */
@@ -71,9 +71,6 @@ export class PrepayLoanComponent implements OnInit, OnDestroy {
}
}
ngOnDestroy(): void {
}
/**
* Creates the prepay loan form.
*/
@@ -161,7 +161,7 @@
<fa-icon icon="eye" class="m-r-10"></fa-icon>
</button>
<button mat-raised-button class="account-action-button" color="primary"
*ngIf="guarantor.status && guarantor.guarantorType.id == 3 && guarantor.id">
*ngIf="guarantor.status && guarantor.guarantorType.id === 3 && guarantor.id">
<fa-icon icon="edit" class="m-r-10"></fa-icon>
</button>
<span *ngIf="guarantor.status">
@@ -1,5 +1,5 @@
/** Angular Imports */
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/** Custom Services */
@@ -15,7 +15,7 @@ import { SettingsService } from 'app/settings/settings.service';
templateUrl: './loan-documents-tab.component.html',
styleUrls: ['./loan-documents-tab.component.scss']
})
export class LoanDocumentsTabComponent implements OnInit {
export class LoanDocumentsTabComponent {
/** Stores the resolved loan documents data */
entityDocuments: any;
@@ -37,8 +37,6 @@ export class LoanDocumentsTabComponent implements OnInit {
});
}
ngOnInit() { }
getLoanDocumentsData(data: any) {
data.forEach((ele: any) => {
ele.docUrl = this.settingsService.serverUrl + '/loans/' + ele.parentEntityId + '/documents/' + ele.id + '/attachment?tenantIdentifier=' + environment.fineractPlatformTenantId;
@@ -28,7 +28,7 @@
<span class="m-r-10">{{'labels.text.' + entityType | translate}} {{"labels.inputs.name" | translate}} :</span> {{loanDetailsData.clientName ||
loanDetailsData.groupName}}<span class="m-l-5">({{loanDetailsData.clientAccountNo}})</span><br />
</span>
<div *ngIf="loanDisplayArrearsDelinquency != 1">
<div *ngIf="loanDisplayArrearsDelinquency !== 1">
<table class="account-overview">
<tbody>
<tr *ngIf="loanDetailsData.delinquencyRange">
@@ -43,7 +43,7 @@
<td>{{loanDetailsData?.delinquent.pastDueDays | formatNumber }}</td>
</tr>
<tr *ngIf="loanDetailsData.delinquent && loanDetailsData.delinquent.delinquentDays > 0
&& loanDetailsData.delinquent.pastDueDays != loanDetailsData.delinquent.delinquentDays">
&& loanDetailsData.delinquent.pastDueDays !== loanDetailsData.delinquent.delinquentDays">
<td>{{"labels.inputs.Delinquent Days" | translate}} :</td>
<td>{{loanDetailsData?.delinquent.delinquentDays | formatNumber }}</td>
</tr>
@@ -1,4 +1,4 @@
import { Component, OnInit } from '@angular/core';
import { Component } from '@angular/core';
import { ActivatedRoute } from '@angular/router';
/** Custom Components */
@@ -12,7 +12,7 @@ import { AuthenticationService } from '../../../core/authentication/authenticati
templateUrl: './notes-tab.component.html',
styleUrls: ['./notes-tab.component.scss']
})
export class NotesTabComponent implements OnInit {
export class NotesTabComponent {
entityId: string;
username: string;
@@ -29,8 +29,6 @@ export class NotesTabComponent implements OnInit {
});
}
ngOnInit() { }
addNote(noteContent: any) {
this.loansService.createLoanNote(this.entityId, noteContent).subscribe((response: any) => {
this.entityNotes.push({
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core';
import { Component, Input } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
@@ -13,7 +13,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
templateUrl: './reschedule-loan-tab.component.html',
styleUrls: ['./reschedule-loan-tab.component.scss']
})
export class RescheduleLoanTabComponent implements OnInit {
export class RescheduleLoanTabComponent {
@Input() loanStatus: LoanStatus;
loanRescheduleData: any;
@@ -33,9 +33,6 @@ export class RescheduleLoanTabComponent implements OnInit {
});
}
ngOnInit(): void {
}
manageRequest(request: any, command: string): void {
const approveLoanRescheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: `${command}` + this.translateService.instant('labels.heading.Loan Reschedule'), dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want') + `${command}` + this.translateService.instant('labels.dialogContext.the Loan Reschedule') + `${request.id}` }
@@ -23,8 +23,8 @@
<ng-container matColumnDef="beneficiary">
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Beneficiary" | translate}} </th>
<td mat-cell *matCellDef="let instruction">
<span *ngIf="instruction.fromClient.id != instruction.toClient.id"> {{instruction.toClient.displayName}} </span>
<span *ngIf="instruction.fromClient.id == instruction.toClient.id">{{"labels.inputs.Own Account" | translate}}</span>
<span *ngIf="instruction.fromClient.id !== instruction.toClient.id"> {{instruction.toClient.displayName}} </span>
<span *ngIf="instruction.fromClient.id === instruction.toClient.id">{{"labels.inputs.Own Account" | translate}}</span>
</td>
</ng-container>