--- /dev/null
+<div class="row mb-3">
+ <div class="col-lg-2">
+ <button class="btn btn-info label-with-material-icon"
+ routerLink="/staff/cat/vandelay/queue/{{queueType}}/{{queueId}}">
+ <span class="material-icons">arrow_back</span>
+ <span i18n>Return to Queue</span>
+ </button>
+ </div>
+</div>
+
+<eg-grid #itemsGrid
+ showFields="record,import_error,imported_as,import_time,owning_lib,call_number,barcode"
+ persistKey="cat.vandelay.queue.items"
+ idlClass="vii" [dataSource]="gridSource">
+ <eg-grid-toolbar-checkbox [onChange]="limitToImportErrors"
+ i18n-label label="Limit to Import Failures"></eg-grid-toolbar-checkbox>
+
+</eg-grid>
+
--- /dev/null
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {Observable} from 'rxjs/Observable';
+import 'rxjs/add/observable/of';
+import {map} from 'rxjs/operators/map';
+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';
+import {VandelayService} from './vandelay.service';
+
+@Component({
+ templateUrl: 'queue-items.component.html'
+})
+export class QueueItemsComponent {
+
+ queueType: string;
+ queueId: number;
+ filterImportErrors: boolean;
+ limitToImportErrors: (checked: boolean) => void;
+
+ gridSource: GridDataSource;
+ @ViewChild('itemsGrid') itemsGrid: GridComponent;
+
+ constructor(
+ private router: Router,
+ private route: ActivatedRoute,
+ private net: NetService,
+ private auth: AuthService,
+ private vandelay: VandelayService) {
+
+ this.route.paramMap.subscribe((params: ParamMap) => {
+ this.queueId = +params.get('id');
+ this.queueType = params.get('qtype');
+ });
+
+ this.gridSource = new GridDataSource();
+
+ // queue API does not support sorting
+ this.gridSource.getRows = (pager: Pager) => {
+ return this.net.request(
+ 'open-ils.vandelay',
+ 'open-ils.vandelay.import_item.queue.retrieve',
+ this.auth.token(), this.queueId, {
+ with_import_error: this.filterImportErrors,
+ offset: pager.offset,
+ limit: pager.limit
+ }
+ );
+ };
+
+ this.limitToImportErrors = (checked: boolean) => {
+ this.filterImportErrors = checked;
+ this.itemsGrid.reload();
+ }
+ }
+}
+
<li class="list-group-item">
<div class="d-flex">
<div class="flex-1">
- <a i18n>View Import Items</a>
+ <a i18n
+ routerLink="/staff/cat/vandelay/queue/{{queueType}}/{{queueId}}/items">
+ View Import Items
+ </a>
</div>
<div class="flex-1">
<a [routerLink]="" (click)="exportNonImported()"
</ng-template>
<ng-template #errorsTmpl let-row="row">
- <b class="text-danger" title="{{row.error_detail}}">{{row.import_error}}</b>
+ <div *ngIf="row.error_detail">
+ <b class="text-danger" title="{{row.error_detail}}">{{row.import_error}}</b>
+ </div>
+ <div *ngIf="row.error_items.length">
+ <b class="text-danger">Items ({{row.error_items.length}})</b>
+ </div>
</ng-template>
<ng-template #importedAsTmpl let-row="row">
error_detail: rec.error_detail(),
import_time: rec.import_time(),
imported_as: rec.imported_as(),
+ import_items: rec.import_items(),
+ error_items: rec.import_items().filter(i => i.import_error()),
matches: rec.matches()
};
</eg-queued-record-matches>
</ng-template>
</ngb-tab>
+ <ngb-tab title="Import Items" i18n-title id="items">
+ <ng-template ngbTabContent>
+ <eg-queued-record-items [recordId]="recordId">
+ </eg-queued-record-items>
+ </ng-template>
+ </ngb-tab>
</ngb-tabset>
--- /dev/null
+<eg-grid #itemsGrid
+ showFields="record,import_error,imported_as,import_time,owning_lib,call_number,barcode"
+ persistKey="cat.vandelay.queue.bib.items"
+ idlClass="vii" [dataSource]="gridSource">
+</eg-grid>
+
--- /dev/null
+import {Component, Input, ViewChild} from '@angular/core';
+import {Pager} from '@eg/share/util/pager';
+import {IdlObject} from '@eg/core/idl.service';
+import {NetService} from '@eg/core/net.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+import {AuthService} from '@eg/core/auth.service';
+import {GridComponent} from '@eg/share/grid/grid.component';
+import {GridDataSource} from '@eg/share/grid/grid';
+import {VandelayService} from './vandelay.service';
+
+@Component({
+ selector: 'eg-queued-record-items',
+ templateUrl: 'record-items.component.html'
+})
+export class RecordItemsComponent {
+
+ @Input() recordId: number;
+
+ gridSource: GridDataSource;
+ @ViewChild('itemsGrid') itemsGrid: GridComponent;
+
+ constructor(
+ private net: NetService,
+ private auth: AuthService,
+ private pcrud: PcrudService,
+ private vandelay: VandelayService) {
+
+ this.gridSource = new GridDataSource();
+
+ // queue API does not support sorting
+ this.gridSource.getRows = (pager: Pager) => {
+ return this.pcrud.search('vii',
+ {record: this.recordId}, {order_by: {vii: ['id']})
+ };
+ }
+}
+
import {DisplayAttrsComponent} from './display-attrs.component';
import {MergeProfilesComponent} from './merge-profiles.component';
import {HoldingsProfilesComponent} from './holdings-profiles.component';
+import {QueueItemsComponent} from './queue-items.component';
const routes: Routes = [{
path: '',
path: 'queue/:qtype/:id/record/:recordId/:recordTab',
component: QueuedRecordComponent
}, {
+ path: 'queue/:qtype/:id/items',
+ component: QueueItemsComponent
+ }, {
path: 'display_attrs',
component: DisplayAttrsComponent
}, {
import {DisplayAttrsComponent} from './display-attrs.component';
import {MergeProfilesComponent} from './merge-profiles.component';
import {HoldingsProfilesComponent} from './holdings-profiles.component';
+import {QueueItemsComponent} from './queue-items.component';
+import {RecordItemsComponent} from './record-items.component';
@NgModule({
declarations: [
QueuedRecordMatchesComponent,
DisplayAttrsComponent,
MergeProfilesComponent,
- HoldingsProfilesComponent
+ HoldingsProfilesComponent,
+ QueueItemsComponent,
+ RecordItemsComponent
],
imports: [
StaffCommonModule,