added translation of dialogContext

This commit is contained in:
Pushpendra Kumar
2023-12-13 10:54:09 +01:00
committed by Adam Saghy
parent 6e068189be
commit 927562a872
31 changed files with 3360 additions and 2994 deletions
@@ -22,6 +22,7 @@ import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicke
import { Dates } from 'app/core/utils/dates';
import { SystemService } from 'app/system/system.service';
import { GlobalConfiguration } from 'app/system/configurations/global-configurations-tab/configuration.model';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-charges-tab',
@@ -54,13 +55,14 @@ export class ChargesTabComponent implements OnInit {
* @param {SettingsService} settingsService Settings Service
*/
constructor(private loansService: LoansService,
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private settingsService: SettingsService,
private systemService: SystemService) {
this.route.parent.data.subscribe(( data: { loanDetailsData: any }) => {
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
public dialog: MatDialog,
private settingsService: SettingsService,
private systemService: SystemService) {
this.route.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.loanDetails = data.loanDetailsData;
});
}
@@ -81,7 +83,7 @@ export class ChargesTabComponent implements OnInit {
}
element.actionFlag = actionFlag;
});
this.chargesData = this.chargesData.sort(function(a: any, b: any) { return b.dueDate - a.dueDate; } );
this.chargesData = this.chargesData.sort(function (a: any, b: any) { return b.dueDate - a.dueDate; });
this.dataSource = new MatTableDataSource(this.chargesData);
this.dataSource.paginator = this.paginator;
this.dataSource.sort = this.sort;
@@ -138,7 +140,7 @@ export class ChargesTabComponent implements OnInit {
* @param {any} chargeId Charge Id
*/
waiveCharge(chargeId: any) {
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${chargeId}`, type: 'Basic' } });
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id') + `${chargeId} ?`, type: 'Basic' } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountChargesCommand(this.loanDetails.id, 'waive', {}, chargeId)
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Dates } from 'app/core/utils/dates';
import { LoansService } from 'app/loans/loans.service';
import { SettingsService } from 'app/settings/settings.service';
@@ -41,6 +42,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
private route: ActivatedRoute,
private dialog: MatDialog,
private dateUtils: Dates,
private translateService: TranslateService,
private settingsService: SettingsService) {
this.loanId = this.route.snapshot.params['loanId'];
this.getRepaymentSchedule();
@@ -60,7 +62,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
const periods: any = [];
this.repaymentScheduleDetails['periods'].forEach((period: any) => {
if (period.period) {
periods.push({idx: period.period, dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat) });
periods.push({ idx: period.period, dueDate: this.dateUtils.formatDate(period.dueDate, this.settingsService.dateFormat) });
}
});
const formfields: FormfieldBase[] = [
@@ -102,7 +104,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
if (period.period && fromPeriod <= period.period && toPeriod >= period.period) {
if (period.totalDueForPeriod !== amount) {
period.totalDueForPeriod = amount;
this.repaymentScheduleChanges[dueDate] = {dueDate: dueDate, installmentAmount: amount};
this.repaymentScheduleChanges[dueDate] = { dueDate: dueDate, installmentAmount: amount };
this.wasChanged = true;
period['changed'] = true;
}
@@ -116,7 +118,7 @@ export class EditRepaymentScheduleComponent implements OnInit {
reset(): void {
const recoverScheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Recover Original Schedule', dialogContext: 'Are you sure you want recover the Original Schedule'}
data: { heading: 'Recover Original Schedule', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover the Original Schedule') }
});
recoverScheduleDialogRef.afterClosed().subscribe((responseConfirmation: any) => {
if (responseConfirmation.confirm) {
@@ -1,6 +1,7 @@
import { Component, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Dates } from 'app/core/utils/dates';
import { LoanDelinquencyActionDialogComponent } from 'app/loans/custom-dialog/loan-delinquency-action-dialog/loan-delinquency-action-dialog.component';
import { LoansService } from 'app/loans/loans.service';
@@ -32,19 +33,22 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
dateFormat: string;
constructor(private route: ActivatedRoute,
private loansServices: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService,
public dialog: MatDialog) {
private loansServices: LoansService,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
public dialog: MatDialog) {
this.loanId = this.route.parent.parent.snapshot.params['loanId'];
this.route.parent.data.subscribe((data: { loanDelinquencyTagsData: LoanDelinquencyTags[],
this.route.parent.data.subscribe((data: {
loanDelinquencyTagsData: LoanDelinquencyTags[],
loanDelinquencyData: any,
loanDelinquencyActions: LoanDelinquencyAction[] }) => {
loanDelinquencyActions: LoanDelinquencyAction[]
}) => {
this.loanDelinquencyTags = data.loanDelinquencyTagsData;
this.loanDelinquencyActions = data.loanDelinquencyActions || [];
this.validateDelinquencyActions();
const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null;
const loanDelinquencyData: DelinquentData | null = data.loanDelinquencyData.delinquent || null;
this.currency = data.loanDelinquencyData.currency;
this.installmentLevelDelinquency = [];
if (loanDelinquencyData != null) {
@@ -85,10 +89,11 @@ export class LoanDelinquencyTagsTabComponent implements OnInit {
resumeDelinquencyClassification(item: LoanDelinquencyAction): void {
const removePauseDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Loan Delinquency Classification',
dialogContext: 'Are you sure you want resume the Delinquency Classification for Loan ' + this.loanId,
type: 'Mild'
}
data: {
heading: 'Loan Delinquency Classification',
dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want resume the Delinquency Classification for Loan') + this.loanId,
type: 'Mild'
}
});
removePauseDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -15,6 +15,7 @@ import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.co
import { LoanStatus } from '../models/loan-status.model';
import { Currency } from 'app/shared/models/general.model';
import { DelinquencyPausePeriod } from '../models/loan-account.model';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-loans-view',
@@ -50,6 +51,7 @@ export class LoansViewComponent implements OnInit {
constructor(private route: ActivatedRoute,
private router: Router,
public loansService: LoansService,
private translateService:TranslateService,
public dialog: MatDialog) {
this.route.data.subscribe((data: { loanDetailsData: any, loanDatatables: any, loanArrearsDelinquencyConfig: any}) => {
this.loanDetailsData = data.loanDetailsData;
@@ -191,7 +193,7 @@ export class LoansViewComponent implements OnInit {
*/
private recoverFromGuarantor() {
const recoverFromGuarantorDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Recover from Guarantor', dialogContext: 'Are you sure you want recover from Guarantor', type: 'Mild' }
data: { heading: 'Recover from Guarantor', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want recover from Guarantor'), type: 'Mild' }
});
recoverFromGuarantorDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -1,6 +1,7 @@
import { Component, Input, OnInit } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { Dates } from 'app/core/utils/dates';
import { LoansService } from 'app/loans/loans.service';
import { LoanStatus } from 'app/loans/models/loan-status.model';
@@ -24,6 +25,7 @@ export class RescheduleLoanTabComponent implements OnInit {
private loansServices: LoansService,
private settingsService: SettingsService,
private dateUtils: Dates,
private translateService: TranslateService,
private dialog: MatDialog) {
this.clientId = this.route.parent.parent.snapshot.paramMap.get('clientId');
this.route.parent.data.subscribe((data: { loanRescheduleData: any }) => {
@@ -36,7 +38,7 @@ export class RescheduleLoanTabComponent implements OnInit {
manageRequest(request: any, command: string): void {
const approveLoanRescheduleDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: `${command} Loan Reschedule`, dialogContext: `Are you sure you want ${command} the Loan Reschedule ${request.id}` }
data: { heading: `${command} Loan Reschedule`, dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want') + `${command}` + this.translateService.instant('labels.dialogContext.the Loan Reschedule') + `${request.id}` }
});
approveLoanRescheduleDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -9,6 +9,7 @@ import { LoansService } from 'app/loans/loans.service';
import { MatDialog } from '@angular/material/dialog';
import { SettingsService } from 'app/settings/settings.service';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-transactions-tab',
@@ -41,6 +42,7 @@ export class TransactionsTabComponent implements OnInit {
private router: Router,
private dialog: MatDialog,
private loansService: LoansService,
private translateService: TranslateService,
private settingsService: SettingsService) {
this.route.parent.parent.data.subscribe((data: { loanDetailsData: any }) => {
this.transactions = data.loanDetailsData.transactions;
@@ -177,7 +179,7 @@ export class TransactionsTabComponent implements OnInit {
}
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Undo Transaction', dialogContext: `Are you sure you want undo the transaction type ${transaction.type.value} with id ${transaction.id}` }
data: { heading: 'Undo Transaction', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction type') + `${transaction.type.value}` + this.translateService.instant('labels.dialogContext.with id') + `${transaction.id}` }
});
undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -193,15 +195,15 @@ export class TransactionsTabComponent implements OnInit {
});
}
private isAccrual(transactionType: any): boolean {
private isAccrual(transactionType: any): boolean {
return (transactionType.accrual || transactionType.code === 'loanTransactionType.overdueCharge');
}
private isChargeOff(transactionType: any): boolean {
private isChargeOff(transactionType: any): boolean {
return (transactionType.chargeoff || transactionType.code === 'loanTransactionType.chargeOff');
}
private isDownPayment(transactionType: any): boolean {
private isDownPayment(transactionType: any): boolean {
return (transactionType.downPayment || transactionType.code === 'loanTransactionType.downPayment');
}
@@ -16,6 +16,7 @@ import { FormDialogComponent } from 'app/shared/form-dialog/form-dialog.componen
import { MatTableDataSource } from '@angular/material/table';
import { LoanTransactionType } from 'app/loans/models/loan-transaction-type.model';
import { AlertService } from 'app/core/alert/alert.service';
import { TranslateService } from '@ngx-translate/core';
/** Custom Dialogs */
@@ -65,6 +66,7 @@ export class ViewTransactionComponent implements OnInit {
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private translateService:TranslateService,
private settingsService: SettingsService,
private organizationService: OrganizationService,
private alertService: AlertService) {
@@ -131,7 +133,7 @@ export class ViewTransactionComponent implements OnInit {
undoTransaction() {
const accountId = this.route.snapshot.params['loanId'];
const undoTransactionAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Undo Transaction', dialogContext: `Are you sure you want undo the transaction ${this.transactionData.id}` }
data: { heading: 'Undo Transaction', dialogContext:this.translateService.instant('labels.dialogContext.Are you sure you want undo the transaction') +`${this.transactionData.id}` }
});
undoTransactionAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -17,6 +17,7 @@ import { FormfieldBase } from 'app/shared/form-dialog/formfield/model/formfield-
import { InputBase } from 'app/shared/form-dialog/formfield/model/input-base';
import { DatepickerBase } from 'app/shared/form-dialog/formfield/model/datepicker-base';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
/**
* View Charge Component.
@@ -45,11 +46,12 @@ export class ViewChargeComponent {
* @param {SettingsService} settingsService Settings Service
*/
constructor(private loansService: LoansService,
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private settingsService: SettingsService) {
private route: ActivatedRoute,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
public dialog: MatDialog,
private settingsService: SettingsService) {
this.route.data.subscribe((data: { loansAccountCharge: any, loanDetailsData: any }) => {
this.chargeData = data.loansAccountCharge;
this.allowPayCharge = (this.chargeData.chargePayable && !this.chargeData.paid);
@@ -99,7 +101,7 @@ export class ViewChargeComponent {
* Waive's the charge
*/
waiveCharge() {
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${this.chargeData.id}`, type: 'Basic' } });
const waiveChargeDialogRef = this.dialog.open(ConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id:')` ${this.chargeData.id}`, type: 'Basic' } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.loansService.executeLoansAccountChargesCommand(this.chargeData.loanId, 'waive', {}, this.chargeData.id)
@@ -179,7 +181,7 @@ export class ViewChargeComponent {
}
adjustmentCharge(): void {
this.router.navigate(['adjustment'], { relativeTo: this.route});
this.router.navigate(['adjustment'], { relativeTo: this.route });
}
/**