From eeddd114de18ed8d9c96291d9fd668ec15f58234 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 e4f6715ef6..b6952d9db7 100644 --- a/Open-ILS/src/eg2/src/app/share/grid/grid.ts +++ b/Open-ILS/src/eg2/src/app/share/grid/grid.ts @@ -1151,6 +1151,7 @@ export class GridDataSource { filters: Object; allRowsRetrieved: boolean; requestingData: boolean; + retrievalError: boolean; getRows: (pager: Pager, sort: any[]) => Observable; constructor() { @@ -1189,6 +1190,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; @@ -1196,14 +1198,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