[GIT] Evergreen ILS branch main updated. 7dfe7cd53939a0c3faed5ca4255099bd0389a7b0

This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Evergreen ILS". The branch, main has been updated via 7dfe7cd53939a0c3faed5ca4255099bd0389a7b0 (commit) via 4c15ce361e7fd6fd877df405444a22b41dd7f04f (commit) from b25f6a8837881e0c9b050a63764418bf9849d770 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 7dfe7cd53939a0c3faed5ca4255099bd0389a7b0 Author: Stephanie Leary <stephanie.leary@equinoxoli.org> Date: Fri Mar 21 17:57:29 2025 +0000 LP2037689 Follow-up: handle query errors gracefully Adds an error catch to reset the search button's in-progress state. Also clears progress and errors when switching between ID and TCN modes. Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org> Signed-off-by: Llewellyn Marshall <llewellyn.marshall@dncr.nc.gov> Signed-off-by: Bill Erickson <berickxx@gmail.com> diff --git a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html index c062f4c14a..7cf4ac55f8 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html @@ -16,7 +16,7 @@ </label> <select class="form-select w-auto mx-2" id="bib-ident-type" - [(ngModel)]="identType" formControlName="bibIdentType"> + [(ngModel)]="identType" (ngModelChange)="resetQuery()" formControlName="bibIdentType"> <option value="id">ID</option> <option value="tcn">TCN</option> </select> @@ -29,23 +29,28 @@ (keyup.enter)="search()" [(ngModel)]="identValue" formControlName="bibIdentValue" class="form-control mx-2 w-auto" aria-describedby="bib-ident-status" /> - <button class="btn btn-primary" [disabled]="searchInProgress" (click)="search()" i18n> - Search + <button class="btn btn-primary" [disabled]="searchInProgress" (click)="search()"> + <span *ngIf="!searchInProgress" i18n>Search</span> + <span *ngIf="searchInProgress" i18n>Searching...</span> </button> <div *ngIf="searchInProgress" role="status"> <span class="visually-hidden">Searching...</span> - <span class="material-icons" aria-hidden="true">pending</span> </div> </div> - <div class="invalid-feedback d-block fs-4" role="status" id="bib-ident-status"> - <div *ngIf="notFound && !multiRecordsFound" i18n> - Record not found: {{identValue}} - </div> - <div *ngIf="multiRecordsFound" i18n> - More than one Bib Record found with TCN: {{identValue}} + <div role="status" id="bib-ident-status"> + <div class="invalid-feedback d-block fs-4"> + <div *ngIf="notFound && !multiRecordsFound" i18n> + Record not found: {{identValue}} + </div> + <div *ngIf="multiRecordsFound" i18n> + More than one Bib Record found with TCN: {{identValue}} + </div> + <div *ngIf="queryError" i18n> + The server encountered an error. Please try a different search. + </div> </div> </div> </form> diff --git a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts index dcd844d9d0..68489f85aa 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts @@ -16,7 +16,8 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { notFound = false; multiRecordsFound = false; bibIdentGroup: FormGroup; - searchInProgress: boolean = null; + searchInProgress = false; + queryError = false; constructor( private router: Router, @@ -44,6 +45,7 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { search() { if (!this.identValue) { return; } this.searchInProgress = true; + this.queryError = null; this.notFound = false; this.multiRecordsFound = false; @@ -63,9 +65,18 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { } else { this.goToRecord(id); } + }).catch(err => { + this.queryError = true; + this.searchInProgress = false; }); } + resetQuery() { + this.notFound = false; + this.queryError = false; + this.searchInProgress = false; + } + getById(): Promise<number> { // Confirm the record exists before redirecting. return this.pcrud.retrieve('bre', this.identValue).toPromise() commit 4c15ce361e7fd6fd877df405444a22b41dd7f04f Author: Stephanie Leary <stephanie.leary@equinoxoli.org> Date: Fri Mar 14 05:45:26 2025 +0000 LP2037689 Retrieve Bib by ID/TCN form accessibility Fixes overly wide search input and isolated submit button in Retrieve Bib by ID/TCN form. Adds a dropdown to switch between ID and TCN without having to go to the navbar. Adds search in progress icon, form labels, ARIA messaging, and Angular form validation logic. Release-note: Fixes display and accessibility bugs in Retrieve Bib by ID/TCN form Signed-off-by: Stephanie Leary <stephanie.leary@equinoxoli.org> Signed-off-by: Llewellyn Marshall <llewellyn.marshall@dncr.nc.gov> Signed-off-by: Bill Erickson <berickxx@gmail.com> diff --git a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html index 475f6c4f48..c062f4c14a 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.html @@ -9,28 +9,43 @@ </ng-container> -<div class="row form-validated mt-5"> - <div class="col-lg-6 form-inline"> - <div class="input-group"> - <span class="input-group-text" id="bib-ident-label"> - <ng-container *ngIf="identType === 'id'" i18n>Record ID:</ng-container> - <ng-container *ngIf="identType === 'tcn'" i18n>Record TCN:</ng-container> - </span> - <input id="bib-ident-value" type="text" required - (keyup.enter)="search()" [(ngModel)]="identValue" - class="form-control" aria-describedby="bib-ident-label"/> +<form class="mt-3"> + <div class="hstack align-items-baseline w-auto" [formGroup]="bibIdentGroup"> + <label class="form-label" for="bib-ident-type"> + Retrieve record by + </label> + + <select class="form-select w-auto mx-2" id="bib-ident-type" + [(ngModel)]="identType" formControlName="bibIdentType"> + <option value="id">ID</option> + <option value="tcn">TCN</option> + </select> + + <label class="form-label mx-2" for="bib-ident-value"> + <ng-container *ngIf="identType === 'id'" i18n>ID:</ng-container> + <ng-container *ngIf="identType === 'tcn'" i18n>TCN:</ng-container> + </label> + <input id="bib-ident-value" type="text" required + (keyup.enter)="search()" [(ngModel)]="identValue" formControlName="bibIdentValue" + class="form-control mx-2 w-auto" aria-describedby="bib-ident-status" /> + + <button class="btn btn-primary" [disabled]="searchInProgress" (click)="search()" i18n> + Search + </button> + + <div *ngIf="searchInProgress" role="status"> + <span class="visually-hidden">Searching...</span> + <span class="material-icons" aria-hidden="true">pending</span> </div> - <button type="button" class="btn btn-outline-dark" (click)="search()" i18n>Submit</button> + </div> -</div> -<div class="row mt-3"> - <div class="col-lg-6"> - <div class="alert alert-warning" *ngIf="notFound && !multiRecordsFound" i18n> + <div class="invalid-feedback d-block fs-4" role="status" id="bib-ident-status"> + <div *ngIf="notFound && !multiRecordsFound" i18n> Record not found: {{identValue}} </div> - <div class="alert alert-warning" *ngIf="multiRecordsFound" i18n> + <div *ngIf="multiRecordsFound" i18n> More than one Bib Record found with TCN: {{identValue}} </div> </div> -</div> +</form> diff --git a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts index 1eaacd0460..dcd844d9d0 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/cat/bib-by-ident.component.ts @@ -1,8 +1,8 @@ -import {Component, OnInit, ViewChild, Input, AfterViewInit} from '@angular/core'; +import {Component, OnInit, AfterViewInit} from '@angular/core'; import {Router, ActivatedRoute, ParamMap} from '@angular/router'; -import {IdlObject} from '@eg/core/idl.service'; import {NetService} from '@eg/core/net.service'; import {PcrudService} from '@eg/core/pcrud.service'; +import {FormControl, FormGroup} from '@angular/forms'; /* Component for retrieving bib records by ID, TCN */ @@ -15,6 +15,8 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { identValue: string; notFound = false; multiRecordsFound = false; + bibIdentGroup: FormGroup; + searchInProgress: boolean = null; constructor( private router: Router, @@ -24,18 +26,24 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { ) {} ngOnInit() { + this.bibIdentGroup = new FormGroup({ + bibIdentType: new FormControl(), + bibIdentValue: new FormControl() + }); + this.route.paramMap.subscribe((params: ParamMap) => { this.identType = params.get('identType') as 'id' | 'tcn'; }); } ngAfterViewInit() { - const node = document.getElementById('bib-ident-value'); + const node = document.getElementById('bib-ident-type'); setTimeout(() => node.focus()); } search() { if (!this.identValue) { return; } + this.searchInProgress = true; this.notFound = false; this.multiRecordsFound = false; @@ -51,6 +59,7 @@ export class BibByIdentComponent implements OnInit, AfterViewInit { promise.then(id => { if (id === null) { this.notFound = true; + this.searchInProgress = false; } else { this.goToRecord(id); } ----------------------------------------------------------------------- Summary of changes: .../src/app/staff/cat/bib-by-ident.component.html | 60 ++++++++++++++-------- .../src/app/staff/cat/bib-by-ident.component.ts | 26 ++++++++-- 2 files changed, 63 insertions(+), 23 deletions(-) hooks/post-receive -- Evergreen ILS
participants (1)
-
Git User