build: Use prettier for typescript
Stop ignoring .ts files in prettier and fix existing issues.
This commit is contained in:
+25
-15
@@ -1,26 +1,26 @@
|
||||
<div class="container">
|
||||
<h3>{{ 'labels.heading.Term Variations' | translate }}</h3>
|
||||
<table mat-table [dataSource]="loanTermVariationsData" *ngIf="loanTermVariationsData.length>0">
|
||||
<table mat-table [dataSource]="loanTermVariationsData" *ngIf="loanTermVariationsData.length > 0">
|
||||
<ng-container matColumnDef="termType">
|
||||
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Type" | translate}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Type' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.termType.value | translate }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="applicableFrom">
|
||||
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Added On" | translate}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Added On' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.termVariationApplicableFrom | dateFormat }}</td>
|
||||
</ng-container>
|
||||
<ng-container matColumnDef="value">
|
||||
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Value" | translate}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Value' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.decimalValue | formatNumber }}</td>
|
||||
</ng-container>
|
||||
|
||||
<ng-container matColumnDef="specificToInstallment">
|
||||
<th mat-header-cell *matHeaderCellDef> {{"labels.inputs.Specific to Installment" | translate}} </th>
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Specific to Installment' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">{{ item.isSpecificToInstallment | yesNo }}</td>
|
||||
</ng-container>
|
||||
<tr mat-header-row *matHeaderRowDef="loanDTermVariationsColumns"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns;"></tr>
|
||||
<tr mat-row *matRowDef="let row; columns: loanDTermVariationsColumns"></tr>
|
||||
</table>
|
||||
|
||||
<h3 class="m-t-20" *ngIf="interestPausesData?.length > 0">{{ 'labels.heading.Interest Pauses' | translate }}</h3>
|
||||
@@ -48,16 +48,26 @@
|
||||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef>{{ 'labels.inputs.Actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let item">
|
||||
<button class="button" mat-icon-button color="primary"
|
||||
matTooltip="{{ 'tooltips.Edit' | translate }}" matTooltipPosition="right"
|
||||
(click)="manageRequest(item, 'Edit')">
|
||||
<button
|
||||
class="button"
|
||||
mat-icon-button
|
||||
color="primary"
|
||||
matTooltip="{{ 'tooltips.Edit' | translate }}"
|
||||
matTooltipPosition="right"
|
||||
(click)="manageRequest(item, 'Edit')"
|
||||
>
|
||||
<fa-icon icon="edit" size="lg"></fa-icon>
|
||||
</button>
|
||||
<button class="button" mat-icon-button color="warn"
|
||||
matTooltip="{{ 'tooltips.Delete' | translate }}" matTooltipPosition="left"
|
||||
(click)="manageRequest(item, 'Delete')">
|
||||
<fa-icon icon="trash" size="lg"></fa-icon>
|
||||
</button>
|
||||
<button
|
||||
class="button"
|
||||
mat-icon-button
|
||||
color="warn"
|
||||
matTooltip="{{ 'tooltips.Delete' | translate }}"
|
||||
matTooltipPosition="left"
|
||||
(click)="manageRequest(item, 'Delete')"
|
||||
>
|
||||
<fa-icon icon="trash" size="lg"></fa-icon>
|
||||
</button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
@@ -71,4 +81,4 @@
|
||||
{{ 'labels.text.No data found' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+2
-3
@@ -8,9 +8,8 @@ describe('LoanTermVariationsTabComponent', () => {
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ LoanTermVariationsTabComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
declarations: [LoanTermVariationsTabComponent]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(LoanTermVariationsTabComponent);
|
||||
component = fixture.componentInstance;
|
||||
|
||||
+21
-8
@@ -16,18 +16,29 @@ import { AnyKindOfDictionary } from 'cypress/types/lodash';
|
||||
styleUrls: ['./loan-term-variations-tab.component.scss']
|
||||
})
|
||||
export class LoanTermVariationsTabComponent {
|
||||
|
||||
/** Loan Term Variation Data */
|
||||
loanTermVariationsData: any[] = [];
|
||||
loanDTermVariationsColumns: string[] = ['termType', 'applicableFrom', 'value', 'specificToInstallment'];
|
||||
loanDTermVariationsColumns: string[] = [
|
||||
'termType',
|
||||
'applicableFrom',
|
||||
'value',
|
||||
'specificToInstallment'
|
||||
];
|
||||
/** Interest Pauses Data */
|
||||
interestPausesData: any[] = [];
|
||||
interestPausesColumns: string[] = ['row', 'startDate', 'endDate', 'days', 'actions'];
|
||||
interestPausesColumns: string[] = [
|
||||
'row',
|
||||
'startDate',
|
||||
'endDate',
|
||||
'days',
|
||||
'actions'
|
||||
];
|
||||
|
||||
loanId: number;
|
||||
clientId: AnyKindOfDictionary;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
constructor(
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private dates: Dates,
|
||||
private settingsService: SettingsService,
|
||||
@@ -36,7 +47,7 @@ export class LoanTermVariationsTabComponent {
|
||||
) {
|
||||
this.interestPausesData = [];
|
||||
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
|
||||
this.route.data.subscribe((data: { loanDetailsData: any, interestPausesData: any }) => {
|
||||
this.route.data.subscribe((data: { loanDetailsData: any; interestPausesData: any }) => {
|
||||
this.loanId = data.loanDetailsData.id;
|
||||
this.loanTermVariationsData = data.loanDetailsData.loanTermVariations;
|
||||
this.interestPausesData = [];
|
||||
@@ -85,7 +96,8 @@ export class LoanTermVariationsTabComponent {
|
||||
value: endDate,
|
||||
maxDate: this.settingsService.maxFutureDate,
|
||||
required: true
|
||||
}),
|
||||
})
|
||||
|
||||
];
|
||||
|
||||
const data = {
|
||||
@@ -104,7 +116,7 @@ export class LoanTermVariationsTabComponent {
|
||||
endDate: this.dates.formatDate(response.data.value.endDate, dateFormat),
|
||||
locale,
|
||||
dateFormat
|
||||
}
|
||||
};
|
||||
this.loansService.updateInterestPause(this.loanId, variation.id, payload).subscribe((response: any) => {
|
||||
this.reload();
|
||||
});
|
||||
@@ -115,7 +127,8 @@ export class LoanTermVariationsTabComponent {
|
||||
|
||||
private reload() {
|
||||
const url: string = this.router.url;
|
||||
this.router.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true })
|
||||
this.router
|
||||
.navigateByUrl(`/clients/${this.clientId}/loans-accounts`, { skipLocationChange: true })
|
||||
.then(() => this.router.navigate([url]));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user