From 4b85750ed63fc21ee1725b1c24c56cb96769c9e7 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Fri, 31 Jan 2020 17:21:36 -0500 Subject: [PATCH] eg-grid: indicate error condition to user if data source throws one Signed-off-by: Galen Charlton --- Open-ILS/src/eg2/src/app/share/grid/grid.component.html | 5 ++++- Open-ILS/src/eg2/src/app/share/grid/grid.ts | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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(); } ); -- 2.11.0