From 67b07312966fb7a85597eb073ee9adc178670818 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 19 Jan 2022 11:46:27 -0500 Subject: [PATCH] LP1958258 Angular login form shows pending offline xacts Signed-off-by: Bill Erickson Signed-off-by: Terran McCanna Signed-off-by: Galen Charlton --- .../src/eg2/src/app/staff/login.component.html | 7 +++++++ Open-ILS/src/eg2/src/app/staff/login.component.ts | 3 +++ .../src/eg2/src/app/staff/share/offline.service.ts | 11 +++++++++++ 3 files changed, 21 insertions(+), 0 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/login.component.html b/Open-ILS/src/eg2/src/app/staff/login.component.html index 63c8b82..e6c2644 100644 --- a/Open-ILS/src/eg2/src/app/staff/login.component.html +++ b/Open-ILS/src/eg2/src/app/staff/login.component.html @@ -55,6 +55,13 @@
Login Failed
+ +
+
+ Unprocessed offline transactions waiting for upload. + Last transaction added at {{pendingXactsDate | date:'short'}}. +
+
diff --git a/Open-ILS/src/eg2/src/app/staff/login.component.ts b/Open-ILS/src/eg2/src/app/staff/login.component.ts index 956b18c..50ec9c6 100644 --- a/Open-ILS/src/eg2/src/app/staff/login.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/login.component.ts @@ -14,6 +14,7 @@ export class StaffLoginComponent implements OnInit { workstations: any[]; loginFailed: boolean; routeTo: string; + pendingXactsDate: Date; args = { username : '', @@ -58,6 +59,8 @@ export class StaffLoginComponent implements OnInit { this.args.workstation = def; this.applyWorkstation(); }); + + this.offline.pendingXactsDate().then(d => this.pendingXactsDate = d); } applyWorkstation() { diff --git a/Open-ILS/src/eg2/src/app/staff/share/offline.service.ts b/Open-ILS/src/eg2/src/app/staff/share/offline.service.ts index 4130d24..e9607a7 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/offline.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/offline.service.ts @@ -124,4 +124,15 @@ export class OfflineService { rows: rows }); } + + // Return promise of cache date when pending transactions exit. + pendingXactsDate(): Promise { + return this.db.request({ + schema: 'cache', + table: 'CacheDate', + action: 'selectWhereEqual', + field: 'type', + value: '_offlineXact' + }).then(results => results[0] ? results[0].cachedate : null); + } } -- 1.7.2.5