From: Galen Charlton Date: Fri, 31 Jan 2020 22:21:36 +0000 (-0500) Subject: 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=4b85750ed63fc21ee1725b1c24c56cb96769c9e7;p=working%2FEvergreen.git eg-grid: indicate error condition to user if data source throws one Signed-off-by: Galen Charlton --- 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 87dfc2bd9a..0da502a5f6 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -1127,6 +1127,7 @@ export class GridDataSource { filters: Object; allRowsRetrieved: boolean; requestingData: boolean; + retrievalError: boolean; getRows: (pager: Pager, sort: any[]) => Observable; constructor() { @@ -1165,6 +1166,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; @@ -1172,14 +1174,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(); } );