From: Galen Charlton Date: Fri, 31 Jan 2020 22:21:36 +0000 (-0500) Subject: LP#1850547: eg-grid: indicate error condition to user if data source throws one X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=e3480557cba552315d511107c65acf7372efc75a;p=evergreen%2Ftadl.git LP#1850547: eg-grid: indicate error condition to user if data source throws one Sponsored-by: Evergreen Community Development Initiative Sponsored-by: Georgia Public Library Service Sponsored-by: Indiana State Library Sponsored-by: C/W MARS Signed-off-by: Galen Charlton Signed-off-by: Tiffany Little Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html index 5713d246d3..2ab6be0505 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.component.html +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.component.html @@ -26,7 +26,10 @@ -
+
+ Error Retrieving Results +
+
Nothing to Display
diff --git a/Open-ILS/src/eg2/src/app/share/grid/grid.ts b/Open-ILS/src/eg2/src/app/share/grid/grid.ts index a71a7e4d4f..866e685904 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -1153,6 +1153,7 @@ export class GridDataSource { filters: Object; allRowsRetrieved: boolean; requestingData: boolean; + retrievalError: boolean; getRows: (pager: Pager, sort: any[]) => Observable; constructor() { @@ -1191,6 +1192,7 @@ export class GridDataSource { // If we have to call out for data, set inFetch this.requestingData = true; + this.retrievalError = false; return new Promise((resolve, reject) => { let idx = pager.offset; @@ -1198,14 +1200,18 @@ export class GridDataSource { row => { this.data[idx++] = row; this.requestingData = false; + this.retrievalError = false; }, err => { console.error(`grid getRows() error ${err}`); + this.requestingData = false; + this.retrievalError = true; reject(err); }, () => { this.checkAllRetrieved(pager, idx); this.requestingData = false; + this.retrievalError = false; resolve(); } );