From: Galen Charlton Date: Fri, 1 Nov 2019 01:35:18 +0000 (-0400) Subject: add line item search results grid X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=a43089024d1ed37f087d8bba43c1a1b5dfc61e7c;p=working%2FEvergreen.git add line item search results grid TODO: - make invoice link on the results table link to an invoice search once we're further along - move the search to a separate service Signed-off-by: Galen Charlton --- diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.html index a56d0d3ee2..43439aeee2 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.html +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.html @@ -8,6 +8,7 @@
+ diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts index 985cb0e177..f294a108f8 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.component.ts @@ -2,6 +2,7 @@ import {Component, OnInit, AfterViewInit, ViewChild} from '@angular/core'; import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap'; import {Router, ActivatedRoute} from '@angular/router'; import {StaffCommonModule} from '@eg/staff/common.module'; +import {LineitemResultsComponent} from './lineitem-results.component'; @Component({ templateUrl: './acq-search.component.html' diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts index 0a08454a83..b0d73e8e26 100644 --- a/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/acq-search.module.ts @@ -2,10 +2,12 @@ import {NgModule} from '@angular/core'; import {StaffCommonModule} from '@eg/staff/common.module'; import {AcqSearchRoutingModule} from './routing.module'; import {AcqSearchComponent} from './acq-search.component'; +import {LineitemResultsComponent} from './lineitem-results.component'; @NgModule({ declarations: [ - AcqSearchComponent + AcqSearchComponent, + LineitemResultsComponent ], imports: [ StaffCommonModule, diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html new file mode 100644 index 0000000000..ba1e7d79a5 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.html @@ -0,0 +1,57 @@ + + + {{lineitem.id()}} + + + + + + + {{lia.attr_value()}} + + + + + + + {{lineitem.provider().name()}} + + + + + + + + + + + + + + + + + + diff --git a/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts new file mode 100644 index 0000000000..ba63b504a9 --- /dev/null +++ b/Open-ILS/src/eg2/src/app/staff/acq/search/lineitem-results.component.ts @@ -0,0 +1,56 @@ +import {Component, OnInit, ViewChild} from '@angular/core'; +import {Observable} from 'rxjs'; +import {map} from 'rxjs/operators'; +import {Router, ActivatedRoute, ParamMap} from '@angular/router'; +import {Pager} from '@eg/share/util/pager'; +import {IdlObject} from '@eg/core/idl.service'; +import {NetService} from '@eg/core/net.service'; +import {AuthService} from '@eg/core/auth.service'; +import {GridComponent} from '@eg/share/grid/grid.component'; +import {GridDataSource} from '@eg/share/grid/grid'; + +@Component({ + selector: 'eg-lineitem-results', + templateUrl: 'lineitem-results.component.html' +}) +export class LineitemResultsComponent { + + gridSource: GridDataSource; + @ViewChild('acqSearchLineitemsGrid', { static: true }) lineitemResultsGrid: GridComponent; + + constructor( + private router: Router, + private route: ActivatedRoute, + private net: NetService, + private auth: AuthService) { + + this.gridSource = new GridDataSource(); + + this.gridSource.getRows = (pager: Pager) => { + return this.net.request( + 'open-ils.acq', + 'open-ils.acq.lineitem.unified_search', + this.auth.token(), + { + jub: [{ + id: "0", + __gte: true + }] + }, + null, + null, + { + flesh_attrs: true, + flesh_cancel_reason: true, + flesh_notes: true, + flesh_provider: true, + flesh_claim_policy: true, + flesh_queued_record: true, + offset: pager.offset, + limit: pager.limit + } + ); + }; + } + +}