</div>
<div class="col-lg-8 pl-1">
<select class="form-control"
+ [disabled]="!basketCount()"
[(ngModel)]="basketAction" (change)="applyAction()">
<option value='' [disabled]="true" i18n>Basket Actions...</option>
<option value="view" i18n>View Basket</option>
<option value="print" [disabled]="true" i18n>Print Title Details</option>
<option value="email" [disabled]="true" i18n>Email Title Details</option>
<option value="bucket" [disabled]="true" i18n>Add Basket to Bucket</option>
- <option value="clear" [disabled]="true" i18n>Clear Bucket</option>
+ <option value="clear" [disabled]="true" i18n>Clear Basket</option>
</select>
</div>
</div>
--- /dev/null
+<div class="row">
+ <div class="col-lg-4">
+ <h3 i18n>Basket View</h3>
+ </div>
+ <div class="col-lg-8">
+ <div class="float-right">
+ <eg-catalog-result-pagination></eg-catalog-result-pagination>
+ </div>
+ </div>
+</div>
+<div class="row"
+ *ngFor="let summary of searchContext.result.records; let idx = index">
+ <div class="col-lg-12">
+ <ng-container *ngIf="summary">
+ <eg-catalog-result-record [summary]="summary" [index]="idx">
+ </eg-catalog-result-record>
+ </ng-container>
+ </div>
+</div>
+
--- /dev/null
+import {Component, OnInit, OnDestroy, Input} from '@angular/core';
+import {Router} from '@angular/router';
+import {Observable} from 'rxjs/Observable';
+import {Subscription} from 'rxjs/Subscription';
+import {BibRecordService} from '@eg/share/catalog/bib-record.service';
+import {CatalogService} from '@eg/share/catalog/catalog.service';
+import {StaffCatalogService} from '../catalog.service';
+import {CatalogSearchContext, CatalogSearchState} from '@eg/share/catalog/search-context';
+import {BasketService} from '@eg/share/catalog/basket.service';
+
+@Component({
+ selector: 'eg-catalog-basket',
+ templateUrl: 'basket.component.html'
+})
+export class BasketComponent implements OnInit, OnDestroy {
+
+ searchContext: CatalogSearchContext;
+
+ constructor(
+ private router: Router,
+ private bib: BibRecordService,
+ private cat: CatalogService,
+ private staffCat: StaffCatalogService,
+ private basket: BasketService
+ ) {}
+
+ ngOnInit() {
+ this.searchContext = this.staffCat.searchContext;
+
+ this.basket.getRecordIds().then(ids => {
+
+ // Bypass the standard catalog search by providing a
+ // search result object of our own.
+ // Map our list of IDs into a search results object
+ // the search context can understand.
+ const result = {
+ count: ids.length,
+ ids: ids.map(id => [id])
+ };
+
+ this.searchContext.reset();
+ this.cat.applyResultData(this.searchContext, result);
+ this.cat.fetchBibSummaries(this.searchContext)
+ .then(ok => this.fleshSearchResults());
+
+ });
+ }
+
+ ngOnDestroy() {
+ }
+
+ fleshSearchResults(): void {
+ const records = this.searchContext.result.records;
+ if (!records || records.length === 0) { return; }
+ // Flesh the creator / editor fields with the user object.
+ this.bib.fleshBibUsers(records.map(r => r.record));
+ }
+}
+
+
import {RecordActionsComponent} from './record/actions.component';
import {HoldingsService} from '@eg/staff/share/holdings.service';
import {BasketActionsComponent} from './basket-actions.component';
+import {BasketComponent} from './basket/basket.component';
@NgModule({
declarations: [
ResultPaginationComponent,
RecordPaginationComponent,
RecordActionsComponent,
- BasketActionsComponent
+ BasketActionsComponent,
+ BasketComponent
],
imports: [
StaffCommonModule,
import {ResultsComponent} from './result/results.component';
import {RecordComponent} from './record/record.component';
import {CatalogResolver} from './resolver.service';
+import {BasketComponent} from './basket/basket.component';
const routes: Routes = [{
path: '',
path: 'search',
component: ResultsComponent
}, {
+ path: 'basket',
+ component: BasketComponent
+ }, {
path: 'record/:id',
component: RecordComponent
}, {