From: Jane Sandberg Date: Sat, 6 Apr 2019 01:29:18 +0000 (-0700) Subject: LP1816475: Pull list screen complete X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=70e8b58af64fb007317580edb15847f9e1bf160b;p=working%2FEvergreen.git LP1816475: Pull list screen complete Signed-off-by: Jane Sandberg --- diff --git a/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.html b/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.html index af326d9352..2152be069b 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.html +++ b/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.html @@ -1,4 +1,3 @@ -{{dataSource | json }} @@ -9,7 +8,9 @@
- + @@ -22,9 +23,12 @@ - + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.ts b/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.ts index 11a13a287f..e8d63e8c4c 100644 --- a/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/booking/pull-list.component.ts @@ -1,41 +1,63 @@ import { Component, Input, OnInit } from '@angular/core'; -import { GridDataSource } from '@eg/share/grid/grid'; +import { Observable } from 'rxjs' +import { AuthService } from '@eg/core/auth.service'; +import { GridColumn, GridDataSource } from '@eg/share/grid/grid'; +import {IdlObject} from '@eg/core/idl.service'; import { NetRequest, NetService } from '@eg/core/net.service'; +import {OrgService} from '@eg/core/org.service'; import { Pager } from '@eg/share/util/pager'; -import { AuthService } from '@eg/core/auth.service'; +import {PcrudService} from '@eg/core/pcrud.service'; + @Component({ - selector: 'eg-pull-list', - templateUrl: './pull-list.component.html' + templateUrl: './pull-list.component.html' }) export class PullListComponent implements OnInit { - @Input( ) daysHence: number; - - public dataSource: GridDataSource; - private auth: AuthService; - - constructor( - private net: NetService, - egAuth: AuthService - ) { - this.auth = egAuth; - this.daysHence = 5; - } - - fill_grid () { - this.net.request( - 'open-ils.booking', 'open-ils.booking.reservations.get_pull_list', - this.auth.token(), null, - (86400 * this.daysHence), // convert seconds to days - 4 - ).subscribe( data => { - this.dataSource.data = data; - }); - } - - ngOnInit() { - this.dataSource = new GridDataSource(); - this.fill_grid(); - } + public daysHence = 5; + public dataSource: GridDataSource; + + public disableOrgs: () => number[]; + public fill_grid: (orgId?: number) => void; + + constructor( + private auth: AuthService, + private net: NetService, + private org: OrgService, + private pcrud: PcrudService + ) { } + + + ngOnInit() { + this.disableOrgs = () => {return this.org.filterList({canHaveVolumes : false}, true);} + + this.fill_grid = (orgId = this.auth.user().ws_ou()) => { + this.net.request( + 'open-ils.booking', 'open-ils.booking.reservations.get_pull_list', + this.auth.token(), null, + (86400 * this.daysHence), // convert seconds to days + orgId + ).subscribe( data => { + data.forEach(resource => { // shouldn't this be streamable? + if (resource['target_resource_type'].catalog_item()) { + this.pcrud.search('acp', { + 'barcode': resource['current_resource'].barcode() + }, { + limit: 1, + flesh: 1, + flesh_fields: {'acp' : ['call_number', 'location' ]} + }).subscribe( (acp) => { + resource['call_number'] = acp.call_number().label(); + resource['call_number_sortkey'] = acp.call_number().label_sortkey(); + resource['shelving_location'] = acp.location().name(); + }); + } + }); + this.dataSource.data = data; + }); + } + this.dataSource = new GridDataSource(); + this.fill_grid(this.auth.user().ws_ou()); + } } + diff --git a/Open-ILS/src/eg2/src/app/staff/nav.component.html b/Open-ILS/src/eg2/src/app/staff/nav.component.html index 0fab3aa5e9..e710c34523 100644 --- a/Open-ILS/src/eg2/src/app/staff/nav.component.html +++ b/Open-ILS/src/eg2/src/app/staff/nav.component.html @@ -286,7 +286,7 @@ add Create Reservations - + list Pull List diff --git a/Open-ILS/src/templates/staff/navbar.tt2 b/Open-ILS/src/templates/staff/navbar.tt2 index 7ed79f1f7b..226e12ba7e 100644 --- a/Open-ILS/src/templates/staff/navbar.tt2 +++ b/Open-ILS/src/templates/staff/navbar.tt2 @@ -438,7 +438,7 @@
  • - + [% l('Pull List') %]