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