fix: WEB-60 Globally Fix Search Placeholder In Different Language (#2325)

This commit is contained in:
Syed Mahmood
2025-03-16 22:02:52 -06:00
committed by GitHub
parent 89414d097a
commit afa91b3d90
4 changed files with 25 additions and 2 deletions
@@ -8,7 +8,11 @@
formControlName="productId"
>
<mat-option>
<ngx-mat-select-search [formControl]="filterFormCtrl"></ngx-mat-select-search>
<ngx-mat-select-search
placeholderLabel="{{ placeHolderLabel }}"
noEntriesFoundLabel="{{ noEntriesFoundLabel }}"
[formControl]="filterFormCtrl"
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let product of productData | async" [value]="product.id">
{{ product.name }}
@@ -3,6 +3,7 @@ import { Component, OnInit, Input, Output, EventEmitter, OnDestroy } from '@angu
import { UntypedFormGroup, UntypedFormBuilder, Validators, UntypedFormControl } from '@angular/forms';
import { ActivatedRoute } from '@angular/router';
import { SettingsService } from 'app/settings/settings.service';
import { TranslateService } from '@ngx-translate/core';
/** Custom Services */
import { LoansService } from '../../loans.service';
@@ -19,6 +20,10 @@ import { ReplaySubject, Subject } from 'rxjs';
styleUrls: ['./loans-account-details-step.component.scss']
})
export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
//** Defining PlaceHolders for the search bar */
placeHolderLabel = '';
noEntriesFoundLabel = '';
/** Loans Account Template */
@Input() loansAccountTemplate: any;
@@ -63,6 +68,7 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
private formBuilder: UntypedFormBuilder,
private loansService: LoansService,
private route: ActivatedRoute,
private translateService: TranslateService,
private settingsService: SettingsService,
private commons: Commons
) {
@@ -70,6 +76,8 @@ export class LoansAccountDetailsStepComponent implements OnInit, OnDestroy {
}
ngOnInit() {
this.placeHolderLabel = this.translateService.instant('labels.text.Search');
this.noEntriesFoundLabel = this.translateService.instant('labels.text.No data found');
this.createLoansAccountDetailsForm();
this.maxDate = this.settingsService.maxFutureDate;
this.buildDependencies();
@@ -14,7 +14,11 @@
<mat-label>{{ 'labels.inputs.Currency' | translate }}</mat-label>
<mat-select required formControlName="currency">
<mat-option>
<ngx-mat-select-search [formControl]="filterFormCtrl"></ngx-mat-select-search>
<ngx-mat-select-search
placeholderLabel="{{ placeHolderLabel }}"
noEntriesFoundLabel="{{ noEntriesFoundLabel }}"
[formControl]="filterFormCtrl"
></ngx-mat-select-search>
</mat-option>
<mat-option *ngFor="let currency of currencyData | async" [value]="currency">
({{ currency.code }}) {{ currency.name }}
@@ -13,6 +13,7 @@ import {
import { ActivatedRoute, Router } from '@angular/router';
import { MatDialog } from '@angular/material/dialog';
import { UntypedFormBuilder, UntypedFormControl, Validators } from '@angular/forms';
import { TranslateService } from '@ngx-translate/core';
/** Custom Dialogs */
import { DeleteDialogComponent } from '../../../shared/delete-dialog/delete-dialog.component';
@@ -37,6 +38,9 @@ import { Currency } from 'app/shared/models/general.model';
styleUrls: ['./manage-currencies.component.scss']
})
export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestroy, OnChanges {
//** Defining PlaceHolders for the search bar */
placeHolderLabel = '';
noEntriesFoundLabel = '';
/** Selected Currencies data. */
selectedCurrencies: any[];
/** Currency options data */
@@ -71,6 +75,7 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
private organizationservice: OrganizationService,
public dialog: MatDialog,
private router: Router,
private translateService: TranslateService,
private configurationWizardService: ConfigurationWizardService,
private popoverService: PopoverService
) {
@@ -81,6 +86,8 @@ export class ManageCurrenciesComponent implements OnInit, AfterViewInit, OnDestr
}
ngOnInit() {
this.placeHolderLabel = this.translateService.instant('labels.text.Search');
this.noEntriesFoundLabel = this.translateService.instant('labels.text.No data found');
this.filterFormCtrl.valueChanges.pipe(takeUntil(this._onDestroy)).subscribe(() => {
this.searchItem();
});