From: Bill Erickson Date: Tue, 25 Sep 2018 21:39:30 +0000 (-0400) Subject: LP#1779158 Active -> Recent Imports UI X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=2aaa115997e49417c2e092e7dd7a1ae467e4f28b;p=working%2FEvergreen.git LP#1779158 Active -> Recent Imports UI Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.html deleted file mode 100644 index f77ae51bcb..0000000000 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.html +++ /dev/null @@ -1,58 +0,0 @@ - -
-
-
-
- No Imports In Progress -
-
-
-
- -
-
-
-
-
- Import Tracker - {{tracker.name()}} -
-
-
-
-
- - - Created on {{tracker.create_time() | date}} for - - Queue {{tracker.queue().name()}} - - -
-
- Enqueuing... - Importing... -
-
- State: - Active - Complete - Error - - thumb_up - -
-
- - - -
-
-
-
-
-
- diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.ts deleted file mode 100644 index 6ebcb66378..0000000000 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/active-imports.component.ts +++ /dev/null @@ -1,99 +0,0 @@ -import {Component, OnInit} from '@angular/core'; -import {IdlService, IdlObject} from '@eg/core/idl.service'; -import {AuthService} from '@eg/core/auth.service'; -import {PcrudService} from '@eg/core/pcrud.service'; -import {VandelayService} from './vandelay.service'; - -@Component({ - templateUrl: 'active-imports.component.html' -}) - -export class ActiveImportsComponent implements OnInit { - - trackers: IdlObject[]; - refreshInterval = 2000; // ms - - constructor( - private idl: IdlService, - private auth: AuthService, - private pcrud: PcrudService, - private vandelay: VandelayService - ) { - this.trackers = []; - } - - ngOnInit() { - this.pollTrackers(); - } - - pollTrackers() { - - const prevTrackers = this.trackers; - - // Report on active trackers for this workstation and for the - // logged in user, plus any that were already reported in the - // current instance of the UI. - const query: any = { - '-and' : [ - { - '-or': [ - {workstation: this.auth.user().wsid()}, - {usr: this.auth.user().id()} - ] - } - ] - }; - - if (this.trackers.length) { - query['-and'].push({ - '-or': [ - {state: 'active'}, - {id: prevTrackers.map(t => t.id())} - ] - }); - } else { - query['-and'].push({state: 'active'}); - } - - this.pcrud.search('vst', query, {order_by: {vst: 'create_time'}}) - .subscribe( - tracker => { - // The screen flickers less if the tracker array is - // updated inline instead of rebuilt every time. - - const existing = - this.trackers.filter(t => t.id() === tracker.id())[0]; - - if (existing) { - existing.update_time(tracker.update_time()); - existing.state(tracker.state()); - existing.total_actions(tracker.total_actions()); - existing.actions_performed(tracker.actions_performed()); - } else { - // TODO: replace enqueue trackers with import trackers - // for a given session instead of appending? - this.trackers.push(tracker); - this.fleshTrackerQueue(tracker); - } - }, - err => {}, - () => { - const active = - this.trackers.filter(t => t.state() === 'active'); - - // Continue updating the display with updated tracker - // data as long as we have any active trackers. - if (active.length > 0) { - setTimeout( - () => this.pollTrackers(), this.refreshInterval); - } - } - ); - } - - fleshTrackerQueue(tracker: IdlObject) { - const qClass = tracker.record_type() === 'bib' ? 'vbq' : 'vaq'; - this.pcrud.retrieve(qClass, tracker.queue()) - .subscribe(queue => tracker.queue(queue)); - } -} diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html index 6f48fb649b..95be13db7a 100644 --- a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html +++ b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/import.component.html @@ -150,9 +150,12 @@
-
+
+
+ No Removal Groups Configured +