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
@@ -9,7 +9,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
/** Custom Services */
import { CentersService } from '../centers.service';
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { TranslateService } from '@ngx-translate/core';
/**
* Create Center View
*/
@@ -32,17 +32,18 @@ export class CentersViewComponent implements OnInit {
* @param route route Activated Route.
*/
constructor(private route: ActivatedRoute,
private router: Router,
public dialog: MatDialog,
public centersService: CentersService) {
this.route.data.subscribe((data: {
centerViewData: any,
centerDatatables: any
}) => {
this.centerViewData = data.centerViewData;
this.centerDatatables = data.centerDatatables;
});
}
private router: Router,
public dialog: MatDialog,
public centersService: CentersService,
private translateService: TranslateService) {
this.route.data.subscribe((data: {
centerViewData: any,
centerDatatables: any
}) => {
this.centerViewData = data.centerViewData;
this.centerDatatables = data.centerDatatables;
});
}
ngOnInit() {
if (this.centerViewData.collectionMeetingCalendar) {
@@ -56,7 +57,7 @@ export class CentersViewComponent implements OnInit {
get editMeeting() {
if (this.centerViewData.collectionMeetingCalendar) {
const entityType = this.centerViewData.collectionMeetingCalendar.entityType.value;
if (entityType === 'CENTERS' && this.centerViewData.hierarchy === '.' + this.centerViewData.id + '.' ) {
if (entityType === 'CENTERS' && this.centerViewData.hierarchy === '.' + this.centerViewData.id + '.') {
return true;
}
}
@@ -97,8 +98,9 @@ export class CentersViewComponent implements OnInit {
* Unassign's the centers's staff.
*/
private centersUnassignStaff() {
const dialogcontext: string = ""
const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Unassign Staff', dialogContext: 'Are you sure you want Unassign Staff' }
data: { heading: 'Unassign Staff', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want Unassign Staff') }
});
unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -132,7 +134,7 @@ export class CentersViewComponent implements OnInit {
*/
reload() {
const url: string = this.router.url;
this.router.navigateByUrl(`/centers`, {skipLocationChange: true})
this.router.navigateByUrl(`/centers`, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
@@ -18,6 +18,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';
/**
* Charges Tab Component
@@ -60,12 +61,13 @@ export class ChargesTabComponent implements OnInit {
* @param {ActivatedRoute} route Activated Route.
*/
constructor(private route: ActivatedRoute,
private savingsService: SavingsService,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private settingsService: SettingsService, ) {
this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => {
private savingsService: SavingsService,
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private translateService: TranslateService,
private settingsService: SettingsService,) {
this.route.parent.data.subscribe((data: { recurringDepositsAccountData: any }) => {
this.recurringDepositsAccountData = data.recurringDepositsAccountData;
this.chargesData = this.recurringDepositsAccountData.charges;
});
@@ -126,7 +128,7 @@ export class ChargesTabComponent implements OnInit {
* @param {any} chargeId Charge Id
*/
waiveCharge(chargeId: any) {
const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: `Are you sure you want to waive charge with id: ${chargeId}?` } });
const waiveChargeDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Waive Charge', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to waive charge with id: ')+ `${chargeId} ?` } });
waiveChargeDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.savingsService.executeSavingsAccountChargesCommand(this.recurringDepositsAccountData.id, 'waive', {}, chargeId)
@@ -14,6 +14,7 @@ import { RecurringDepositsButtonsConfiguration } from './recurring-deposits-butt
import { DeleteDialogComponent } from 'app/shared/delete-dialog/delete-dialog.component';
import { RecurringDepositConfirmationDialogComponent } from './custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component';
import { Currency } from 'app/shared/models/general.model';
import { TranslateService } from '@ngx-translate/core';
/**
@@ -48,7 +49,8 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
private router: Router,
private recurringDepositsService: RecurringDepositsService,
private savingsService: SavingsService,
public dialog: MatDialog) {
public dialog: MatDialog,
private translateService:TranslateService) {
this.route.data.subscribe((data: { recurringDepositsAccountData: any, savingsDatatables: any }) => {
this.recurringDepositsAccountData = data.recurringDepositsAccountData;
this.charges = this.recurringDepositsAccountData.charges;
@@ -207,7 +209,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private calculateInterest() {
const calculateInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Calculate Interest', dialogContext: `Are you sure you want to calculate interest ?` }
data: { heading: 'Calculate Interest', dialogContext: this.translateService.instant(`labels.dialogContext.Are you sure you want to calculate interest ?`) }
});
calculateInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -223,7 +225,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private postInterest() {
const postInterestAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Post Interest', dialogContext: 'Are you sure you want to post interest ?' }
data: { heading: 'Post Interest', dialogContext:this.translateService.instant('lables.dialogContext.Are you sure you want to post interest ?') }
});
postInterestAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -241,7 +243,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private enableWithHoldTax() {
const deleteSavingsAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Enable Withhold Tax', dialogContext: `Enable withhold tax for this account ?` }
data: { heading: 'Enable Withhold Tax', dialogContext: this.translateService.instant('labels.dialogContext.Enable withhold tax for this account ?') }
});
deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -259,7 +261,7 @@ export class RecurringDepositsAccountViewComponent implements OnInit {
*/
private disableWithHoldTax() {
const disableWithHoldTaxDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, {
data: { heading: 'Disable Withhold Tax', dialogContext: 'Disable withhold tax for this account ?' }
data: { heading: 'Disable Withhold Tax', dialogContext: this.translateService.instant('labels.dialogContext.Disable withhold tax for this account ?') }
});
disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
@@ -10,6 +10,7 @@ import { SettingsService } from 'app/settings/settings.service';
/** Custom Dialogs */
import { RecurringDepositConfirmationDialogComponent } from '../../custom-dialogs/recurring-deposit-confirmation-dialog/recurring-deposit-confirmation-dialog.component';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
/**
* View Transaction Component.
@@ -24,6 +25,7 @@ export class ViewTransactionComponent {
/** Transaction data. */
transactionData: any;
/**
* Retrieves the Transaction data from `resolve`.
@@ -39,6 +41,7 @@ export class ViewTransactionComponent {
private dateUtils: Dates,
private router: Router,
public dialog: MatDialog,
private translateService:TranslateService,
private settingsService: SettingsService, ) {
this.route.data.subscribe((data: { recurringDepositsAccountTransaction: any }) => {
this.transactionData = data.recurringDepositsAccountTransaction;
@@ -50,7 +53,7 @@ export class ViewTransactionComponent {
*/
undoTransaction() {
const accountId = this.route.parent.snapshot.params['recurringDepositAccountId'];
const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Undo Transaction', dialogContext: 'Are you sure you want to undo this transaction ?' } });
const undoTransactionAccountDialogRef = this.dialog.open(RecurringDepositConfirmationDialogComponent, { data: { heading: 'Undo Transaction', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to undo this transaction ?') } });
undoTransactionAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
const locale = this.settingsService.language.code;
@@ -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 });
}
/**
@@ -9,6 +9,7 @@ import { OrganizationService } from 'app/organization/organization.service';
/** Custom Components. */
import { ConfirmationDialogComponent } from '../../../shared/confirmation-dialog/confirmation-dialog.component';
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
import { TranslateService } from '@ngx-translate/core';
/**
* View Holidays component.
@@ -30,6 +31,7 @@ export class ViewHolidaysComponent {
constructor(private route: ActivatedRoute,
private router: Router,
private dialog: MatDialog,
private translateService: TranslateService,
private organizationService: OrganizationService) {
this.route.data.subscribe((data: { holidays: any }) => {
this.holidayData = data.holidays;
@@ -58,7 +60,7 @@ export class ViewHolidaysComponent {
*/
activateHoliday() {
const unAssignStaffDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Holiday', dialogContext: `Are you sure you want to activate ${this.holidayData.name} holiday` }
data: { heading: 'Holiday', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want to activate') + ` ${this.holidayData.name} ` + this.translateService.instant('labels.dialogContext.holiday') }
});
unAssignStaffDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
@@ -14,6 +14,7 @@ import { SavingsButtonsConfiguration } from './savings-buttons.config';
import { SavingsService } from '../savings.service';
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { Currency } from 'app/shared/models/general.model';
import { TranslateService } from '@ngx-translate/core';
/**
* Savings Account View Component
@@ -44,9 +45,10 @@ export class SavingsAccountViewComponent implements OnInit {
* @param {SavingsService} savingsService Savings Service
*/
constructor(private route: ActivatedRoute,
private router: Router,
private savingsService: SavingsService,
public dialog: MatDialog) {
private router: Router,
private savingsService: SavingsService,
private translateService: TranslateService,
public dialog: MatDialog) {
this.route.data.subscribe((data: { savingsAccountData: any, savingsDatatables: any }) => {
this.savingsAccountData = data.savingsAccountData;
this.currency = this.savingsAccountData.currency;
@@ -123,7 +125,7 @@ export class SavingsAccountViewComponent implements OnInit {
private reload() {
const url: string = this.router.url;
const refreshUrl: string = this.router.url.slice(0, this.router.url.indexOf('savings-accounts') + 'savings-accounts'.length);
this.router.navigateByUrl(refreshUrl, {skipLocationChange: true})
this.router.navigateByUrl(refreshUrl, { skipLocationChange: true })
.then(() => this.router.navigate([url]));
}
@@ -237,7 +239,7 @@ export class SavingsAccountViewComponent implements OnInit {
});
deleteSavingsAccountDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: true})
this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: true })
.subscribe(() => {
this.reload();
});
@@ -254,7 +256,7 @@ export class SavingsAccountViewComponent implements OnInit {
});
disableWithHoldTaxDialogRef.afterClosed().subscribe((response: any) => {
if (response.confirm) {
this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: false})
this.savingsService.executeSavingsAccountUpdateCommand(this.savingsAccountData.id, 'updateWithHoldTax', { withHoldTax: false })
.subscribe(() => {
this.reload();
});
@@ -267,7 +269,7 @@ export class SavingsAccountViewComponent implements OnInit {
*/
private unblockSavingsAccount(action: string) {
const unblockSavingsAccountDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Savings Account', dialogContext: 'Are you sure you want ' + action + ' this Savings Account' }
data: { heading: 'Savings Account', dialogContext: this.translateService.instant('labels.dialogContext.Are you sure you want') + action + this.translateService.instant('this Savings Account') }
});
let command = 'unblock';
if (action === 'Unblock Deposit') {
@@ -278,7 +280,7 @@ export class SavingsAccountViewComponent implements OnInit {
}
unblockSavingsAccountDialogRef.afterClosed().subscribe((response: { confirm: any }) => {
if (response.confirm) {
this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, { })
this.savingsService.executeSavingsAccountCommand(this.savingsAccountData.id, command, {})
.subscribe(() => {
this.reload();
});
@@ -13,6 +13,7 @@ import { SettingsService } from 'app/settings/settings.service';
/** Dialog Components */
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-checker-inbox',
@@ -56,6 +57,7 @@ export class CheckerInboxComponent implements OnInit {
private dialog: MatDialog,
private dateUtils: Dates,
private router: Router,
private translateService: TranslateService,
private tasksService: TasksService,
private settingsService: SettingsService,
private formBuilder: UntypedFormBuilder) {
@@ -130,7 +132,7 @@ export class CheckerInboxComponent implements OnInit {
approveChecker() {
const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Approve Checker', dialogContext: 'Are you sure you want to approve checker' }
data: { 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) {
@@ -141,7 +143,7 @@ export class CheckerInboxComponent implements OnInit {
rejectChecker() {
const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Reject Checker', dialogContext: 'Are you sure you want to reject checker' }
data: { 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) {
@@ -152,7 +154,7 @@ export class CheckerInboxComponent implements OnInit {
deleteChecker() {
const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Delete Checker', dialogContext: 'Are you sure you want to delete checker' }
data: { 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) {
@@ -13,6 +13,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
import { TasksService } from '../../tasks.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-loan-approval',
@@ -53,6 +54,7 @@ export class LoanApprovalComponent {
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 }) => {
@@ -121,7 +123,7 @@ export class LoanApprovalComponent {
approveLoan() {
const approveLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Approve Loan', dialogContext: 'Are you sure you want to Approve Loan' }
data: { 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) {
@@ -12,6 +12,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
import { TasksService } from '../../tasks.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-loan-disbursal',
@@ -44,6 +45,7 @@ export class LoanDisbursalComponent {
private dialog: MatDialog,
private dateUtils: Dates,
private settingsService: SettingsService,
private translateService: TranslateService,
private tasksService: TasksService) {
this.route.data.subscribe((data: { loansData: any }) => {
this.loans = data.loansData.pageItems;
@@ -79,7 +81,7 @@ export class LoanDisbursalComponent {
disburseLoan() {
const disburseLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Loan Disbursal', dialogContext: 'Are you sure you want to Disburse Loan' }
data: { 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) {
@@ -13,6 +13,7 @@ import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/conf
import { TasksService } from '../../tasks.service';
import { SettingsService } from 'app/settings/settings.service';
import { Dates } from 'app/core/utils/dates';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-reschedule-loan',
@@ -46,6 +47,7 @@ export class RescheduleLoanComponent implements OnInit {
private dateUtils: Dates,
private router: Router,
private settingsService: SettingsService,
private translateService: TranslateService,
private tasksService: TasksService) {
this.route.data.subscribe((data: { recheduleLoansData: any }) => {
this.loans = data.recheduleLoansData;
@@ -81,7 +83,7 @@ export class RescheduleLoanComponent implements OnInit {
bulkLoanReschedule(action: string) {
const rescheduleLoanDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Reschedule Loan', dialogContext: 'Are you sure you want to ' + action + ' the Reschedule Loan' }
data: { 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) {
@@ -9,6 +9,7 @@ import { TasksService } from '../tasks.service';
/** Dialog Components */
import { ConfirmationDialogComponent } from 'app/shared/confirmation-dialog/confirmation-dialog.component';
import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'mifosx-view-checker-inbox',
@@ -34,21 +35,22 @@ export class ViewCheckerInboxComponent {
constructor(private route: ActivatedRoute,
private dialog: MatDialog,
private router: Router,
private translateService: TranslateService,
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));
});
}
}
/**
* Approve Checker
*/
/**
* Approve Checker
*/
approveChecker() {
const approveCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Approve Checker', dialogContext: 'Are you sure you want to approve checker' }
data: { 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) {
@@ -64,7 +66,7 @@ export class ViewCheckerInboxComponent {
*/
rejectChecker() {
const rejectCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Reject Checker', dialogContext: 'Are you sure you want to reject checker' }
data: { 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) {
@@ -80,7 +82,7 @@ export class ViewCheckerInboxComponent {
*/
deleteChecker() {
const deleteCheckerDialogRef = this.dialog.open(ConfirmationDialogComponent, {
data: { heading: 'Delete Checker', dialogContext: 'Are you sure you want to delete checker' }
data: { 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) {