From dad8178a6683da3ef58c44a804e430e70b25b6e1 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 7 Jul 2022 10:55:15 -0400 Subject: [PATCH] LP1840773 SCKO Angular Hatch Accessible Signed-off-by: Bill Erickson --- Open-ILS/src/eg2/src/app/routing.module.ts | 4 ++-- .../src/eg2/src/app/{ => staff}/scko/banner.component.html | 13 +++++++++---- .../src/eg2/src/app/{ => staff}/scko/banner.component.ts | 8 +++++--- .../eg2/src/app/{ => staff}/scko/checkout.component.html | 0 .../src/eg2/src/app/{ => staff}/scko/checkout.component.ts | 0 .../src/eg2/src/app/{ => staff}/scko/fines.component.html | 2 +- .../src/eg2/src/app/{ => staff}/scko/fines.component.ts | 2 +- .../src/eg2/src/app/{ => staff}/scko/holds.component.html | 2 +- .../src/eg2/src/app/{ => staff}/scko/holds.component.ts | 2 +- .../src/eg2/src/app/{ => staff}/scko/items.component.html | 2 +- .../src/eg2/src/app/{ => staff}/scko/items.component.ts | 2 +- Open-ILS/src/eg2/src/app/{ => staff}/scko/routing.module.ts | 0 .../src/eg2/src/app/{ => staff}/scko/scko.component.css | 0 .../src/eg2/src/app/{ => staff}/scko/scko.component.html | 0 Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.component.ts | 0 Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.module.ts | 0 Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.service.ts | 12 ++++++------ .../src/eg2/src/app/{ => staff}/scko/summary.component.html | 8 ++++---- .../src/eg2/src/app/{ => staff}/scko/summary.component.ts | 0 19 files changed, 32 insertions(+), 25 deletions(-) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/banner.component.html (91%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/banner.component.ts (96%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/checkout.component.html (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/checkout.component.ts (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/fines.component.html (91%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/fines.component.ts (98%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/holds.component.html (91%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/holds.component.ts (97%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/items.component.html (93%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/items.component.ts (97%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/routing.module.ts (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.component.css (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.component.html (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.component.ts (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.module.ts (100%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/scko.service.ts (98%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/summary.component.html (91%) rename Open-ILS/src/eg2/src/app/{ => staff}/scko/summary.component.ts (100%) diff --git a/Open-ILS/src/eg2/src/app/routing.module.ts b/Open-ILS/src/eg2/src/app/routing.module.ts index 087c0cc3ad..c440a3a860 100644 --- a/Open-ILS/src/eg2/src/app/routing.module.ts +++ b/Open-ILS/src/eg2/src/app/routing.module.ts @@ -18,9 +18,9 @@ const routes: Routes = [ resolve : {startup : BaseResolver}, loadChildren: () => import('./staff/staff.module').then(m => m.StaffModule) }, { - path: 'scko', + path: 'staff/scko', resolve : {startup : BaseResolver}, - loadChildren: () => import('./scko/scko.module').then(m => m.SckoModule) + loadChildren: () => import('./staff/scko/scko.module').then(m => m.SckoModule) } ]; diff --git a/Open-ILS/src/eg2/src/app/scko/banner.component.html b/Open-ILS/src/eg2/src/app/staff/scko/banner.component.html similarity index 91% rename from Open-ILS/src/eg2/src/app/scko/banner.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/banner.component.html index cea5bd0ecb..6f72e126ba 100644 --- a/Open-ILS/src/eg2/src/app/scko/banner.component.html +++ b/Open-ILS/src/eg2/src/app/staff/scko/banner.component.html @@ -69,7 +69,7 @@
-

Staff Account Login

+

Self-Checkout Staff Login


@@ -111,7 +111,7 @@ id="workstation" name="workstation" required - [(ngModel)]="args.workstation"> + [(ngModel)]="staffWorkstation"> @@ -122,8 +122,13 @@
-
-
Login Failed
+ +
+
Login Failed
diff --git a/Open-ILS/src/eg2/src/app/scko/banner.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/banner.component.ts similarity index 96% rename from Open-ILS/src/eg2/src/app/scko/banner.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/banner.component.ts index 4485f86827..11476d26f8 100644 --- a/Open-ILS/src/eg2/src/app/scko/banner.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/scko/banner.component.ts @@ -7,6 +7,7 @@ import {StoreService} from '@eg/core/store.service'; import {SckoService} from './scko.service'; import {OrgService} from '@eg/core/org.service'; import {EventService, EgEvent} from '@eg/core/event.service'; +import {HatchService} from '@eg/core/hatch.service'; @Component({ selector: 'eg-scko-banner', @@ -37,13 +38,14 @@ export class SckoBannerComponent implements OnInit, AfterViewInit { private evt: EventService, private ngLocation: Location, private org: OrgService, + private hatch: HatchService, public scko: SckoService ) {} ngOnInit() { - // NOTE: Displaying a list of workstations will not work for users - // of Hatch until the extension is updated to support /eg2/*/scko + this.hatch.connect(); + this.store.getWorkstations() .then(wsList => { this.workstations = wsList; @@ -112,7 +114,7 @@ export class SckoBannerComponent implements OnInit, AfterViewInit { // Force reload of the app after a successful login. window.location.href = - this.ngLocation.prepareExternalUrl('/scko'); + this.ngLocation.prepareExternalUrl('/staff/scko'); }); } diff --git a/Open-ILS/src/eg2/src/app/scko/checkout.component.html b/Open-ILS/src/eg2/src/app/staff/scko/checkout.component.html similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/checkout.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/checkout.component.html diff --git a/Open-ILS/src/eg2/src/app/scko/checkout.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/checkout.component.ts similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/checkout.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/checkout.component.ts diff --git a/Open-ILS/src/eg2/src/app/scko/fines.component.html b/Open-ILS/src/eg2/src/app/staff/scko/fines.component.html similarity index 91% rename from Open-ILS/src/eg2/src/app/scko/fines.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/fines.component.html index d4444c3cb1..97f7464eee 100644 --- a/Open-ILS/src/eg2/src/app/scko/fines.component.html +++ b/Open-ILS/src/eg2/src/app/staff/scko/fines.component.html @@ -1,7 +1,7 @@
- +
diff --git a/Open-ILS/src/eg2/src/app/scko/fines.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/fines.component.ts similarity index 98% rename from Open-ILS/src/eg2/src/app/scko/fines.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/fines.component.ts index f13bda7615..220961475d 100644 --- a/Open-ILS/src/eg2/src/app/scko/fines.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/scko/fines.component.ts @@ -30,7 +30,7 @@ export class SckoFinesComponent implements OnInit { ngOnInit() { if (!this.scko.patronSummary) { - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); return; } diff --git a/Open-ILS/src/eg2/src/app/scko/holds.component.html b/Open-ILS/src/eg2/src/app/staff/scko/holds.component.html similarity index 91% rename from Open-ILS/src/eg2/src/app/scko/holds.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/holds.component.html index ff10e9bc7d..09e3b259eb 100644 --- a/Open-ILS/src/eg2/src/app/scko/holds.component.html +++ b/Open-ILS/src/eg2/src/app/staff/scko/holds.component.html @@ -1,7 +1,7 @@
- +
diff --git a/Open-ILS/src/eg2/src/app/scko/holds.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/holds.component.ts similarity index 97% rename from Open-ILS/src/eg2/src/app/scko/holds.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/holds.component.ts index 131cf73a23..eddc802c9f 100644 --- a/Open-ILS/src/eg2/src/app/scko/holds.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/scko/holds.component.ts @@ -30,7 +30,7 @@ export class SckoHoldsComponent implements OnInit { ngOnInit() { if (!this.scko.patronSummary) { - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); return; } diff --git a/Open-ILS/src/eg2/src/app/scko/items.component.html b/Open-ILS/src/eg2/src/app/staff/scko/items.component.html similarity index 93% rename from Open-ILS/src/eg2/src/app/scko/items.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/items.component.html index c4a247bedf..63e36db4bd 100644 --- a/Open-ILS/src/eg2/src/app/scko/items.component.html +++ b/Open-ILS/src/eg2/src/app/staff/scko/items.component.html @@ -1,7 +1,7 @@
- +
diff --git a/Open-ILS/src/eg2/src/app/scko/items.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/items.component.ts similarity index 97% rename from Open-ILS/src/eg2/src/app/scko/items.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/items.component.ts index 7a662a5245..2926a27866 100644 --- a/Open-ILS/src/eg2/src/app/scko/items.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/scko/items.component.ts @@ -30,7 +30,7 @@ export class SckoItemsComponent implements OnInit { ngOnInit() { if (!this.scko.patronSummary) { - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); return; } diff --git a/Open-ILS/src/eg2/src/app/scko/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/scko/routing.module.ts similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/routing.module.ts rename to Open-ILS/src/eg2/src/app/staff/scko/routing.module.ts diff --git a/Open-ILS/src/eg2/src/app/scko/scko.component.css b/Open-ILS/src/eg2/src/app/staff/scko/scko.component.css similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/scko.component.css rename to Open-ILS/src/eg2/src/app/staff/scko/scko.component.css diff --git a/Open-ILS/src/eg2/src/app/scko/scko.component.html b/Open-ILS/src/eg2/src/app/staff/scko/scko.component.html similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/scko.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/scko.component.html diff --git a/Open-ILS/src/eg2/src/app/scko/scko.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/scko.component.ts similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/scko.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/scko.component.ts diff --git a/Open-ILS/src/eg2/src/app/scko/scko.module.ts b/Open-ILS/src/eg2/src/app/staff/scko/scko.module.ts similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/scko.module.ts rename to Open-ILS/src/eg2/src/app/staff/scko/scko.module.ts diff --git a/Open-ILS/src/eg2/src/app/scko/scko.service.ts b/Open-ILS/src/eg2/src/app/staff/scko/scko.service.ts similarity index 98% rename from Open-ILS/src/eg2/src/app/scko/scko.service.ts rename to Open-ILS/src/eg2/src/app/staff/scko/scko.service.ts index 501e094cde..1398fa9892 100644 --- a/Open-ILS/src/eg2/src/app/scko/scko.service.ts +++ b/Open-ILS/src/eg2/src/app/staff/scko/scko.service.ts @@ -89,7 +89,7 @@ export class SckoService { logoutStaff() { this.resetPatron(); this.auth.logout(); - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); } resetPatron() { @@ -152,7 +152,7 @@ export class SckoService { if (username && !this.patronPasswordRequired) { return this.loadPatron(username); } - }); + }).catch(_ => {}); // console errors } getFleshedCircs(circIds: number[]): Observable { @@ -247,7 +247,7 @@ export class SckoService { this.resetPatronTimeout(); } else { this.resetPatron(); - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); } }); @@ -257,7 +257,7 @@ export class SckoService { () => { console.debug('Clearing patron on warning dialog timeout'); this.resetPatron(); - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); }, this.logoutWarningTimeout * 1000 ); @@ -315,7 +315,7 @@ export class SckoService { // so we can see our items out in progress. }) .then(ctx => this.notifyPatron(ctx)) - .finally(() => this.router.navigate(['/scko'])); + .finally(() => this.router.navigate(['/staff/scko'])); } renew(barcode: string, override?: boolean): Promise { @@ -609,7 +609,7 @@ export class SckoService { return promise.then(_ => { this.resetPatron(); - this.router.navigate(['/scko']); + this.router.navigate(['/staff/scko']); }); } diff --git a/Open-ILS/src/eg2/src/app/scko/summary.component.html b/Open-ILS/src/eg2/src/app/staff/scko/summary.component.html similarity index 91% rename from Open-ILS/src/eg2/src/app/scko/summary.component.html rename to Open-ILS/src/eg2/src/app/staff/scko/summary.component.html index f7329a04e3..7ca92bb327 100644 --- a/Open-ILS/src/eg2/src/app/scko/summary.component.html +++ b/Open-ILS/src/eg2/src/app/staff/scko/summary.component.html @@ -3,7 +3,7 @@
- + @@ -47,7 +47,7 @@ {{scko.accountTotalCheckouts()}}
@@ -65,7 +65,7 @@ total holds.
@@ -80,7 +80,7 @@
- + diff --git a/Open-ILS/src/eg2/src/app/scko/summary.component.ts b/Open-ILS/src/eg2/src/app/staff/scko/summary.component.ts similarity index 100% rename from Open-ILS/src/eg2/src/app/scko/summary.component.ts rename to Open-ILS/src/eg2/src/app/staff/scko/summary.component.ts -- 2.11.0