From b561dc89d74499b3b30d83d6160e0d1542c71300 Mon Sep 17 00:00:00 2001 From: Kyle Huckins Date: Mon, 16 Nov 2020 20:50:37 +0000 Subject: [PATCH] Angular Library Settings Editor Touch-up - Remove case-sensitivity from Filter - Ensure filter returns you to the beginning of the grid results when applying or clearing the filter. Signed-off-by: Kyle Huckins Signed-off-by: Bill Erickson Signed-off-by: Terran McCanna Signed-off-by: Jane Sandberg --- .../org-unit-settings/org-unit-settings.component.html | 5 +++-- .../org-unit-settings/org-unit-settings.component.ts | 15 +++++++++++---- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.html b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.html index 533c975094..4352a5b41b 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.html @@ -1,5 +1,5 @@ - - + + @@ -28,6 +28,7 @@ class="form-control" [(ngModel)]="filterString" (blur)="applyFilter()" + (keydown.enter)="$event.target.blur()" aria-label="Filter Settings" i18n-aria-label /> diff --git a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts index d0b1092291..5c074c58fa 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/local/org-unit-settings/org-unit-settings.component.ts @@ -9,6 +9,7 @@ import {NetService} from '@eg/core/net.service'; import {GridDataSource} from '@eg/share/grid/grid'; import {GridComponent} from '@eg/share/grid/grid.component'; import {ToastService} from '@eg/share/toast/toast.service'; +import {LocaleService} from '@eg/core/locale.service'; import {EditOuSettingDialogComponent } from '@eg/staff/admin/local/org-unit-settings/edit-org-unit-setting-dialog.component'; @@ -69,6 +70,7 @@ export class OrgUnitSettingsComponent implements OnInit { private pcrud: PcrudService, private auth: AuthService, private toast: ToastService, + private locale: LocaleService, private net: NetService, ) { this.gridDataSource = new GridDataSource(); @@ -221,6 +223,7 @@ export class OrgUnitSettingsComponent implements OnInit { applyFilter(clear?: boolean) { if (clear) { this.filterString = ''; } + this.orgUnitSettingsGrid.context.pager.toFirst() this.updateGrid(this.contextOrg); } @@ -330,10 +333,14 @@ export class OrgUnitSettingsComponent implements OnInit { const tempGrid = this.settingTypeArr; tempGrid.forEach(row => { const containsString = - row.name.includes(this.filterString) || - row.label.includes(this.filterString) || - (row.grp && row.grp.includes(this.filterString)) || - (row.description && row.description.includes(this.filterString)); + row.name.toLocaleLowerCase(this.locale.currentLocaleCode()) + .includes(this.filterString.toLocaleLowerCase(this.locale.currentLocaleCode())) || + row.label.toLocaleLowerCase(this.locale.currentLocaleCode()) + .includes(this.filterString.toLocaleLowerCase(this.locale.currentLocaleCode())) || + (row.grp && row.grp.toLocaleLowerCase(this.locale.currentLocaleCode()) + .includes(this.filterString.toLocaleLowerCase(this.locale.currentLocaleCode()))) || + (row.description && row.description.toLocaleLowerCase(this.locale.currentLocaleCode()) + .includes(this.filterString.toLocaleLowerCase(this.locale.currentLocaleCode()))); if (containsString) { this.gridDataSource.data.push(row); } -- 2.11.0