From 2795bc6d178cf40be810cd978af9e364cb21619e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 15 Nov 2018 17:14:14 -0500 Subject: [PATCH] Implement add basket to bucket Signed-off-by: Bill Erickson --- .../app/staff/catalog/basket-actions.component.html | 6 ++++-- .../app/staff/catalog/basket-actions.component.ts | 15 ++++++++++++++- .../app/staff/catalog/result/results.component.html | 13 ++++++++----- .../src/app/staff/catalog/search-form.component.ts | 3 +++ .../buckets/record-bucket-dialog.component.html | 7 ++++++- .../share/buckets/record-bucket-dialog.component.ts | 20 ++++++++++++-------- .../lib/OpenILS/Application/Actor/Container.pm | 4 ++++ 7 files changed, 51 insertions(+), 17 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.html index aa694774b8..ca47c66bcd 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.html @@ -1,3 +1,5 @@ + +
@@ -15,11 +17,11 @@ [disabled]="!basketCount()" [(ngModel)]="basketAction" (change)="applyAction()"> - + - +
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.ts index fd225f1476..90f0e72c90 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/basket-actions.component.ts @@ -1,7 +1,9 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; import {BasketService} from '@eg/share/catalog/basket.service'; import {Subscription} from 'rxjs/Subscription'; import {Router} from '@angular/router'; +import {RecordBucketDialogComponent} + from '@eg/staff/share/buckets/record-bucket-dialog.component'; @Component({ selector: 'eg-catalog-basket-actions', @@ -11,6 +13,9 @@ export class BasketActionsComponent implements OnInit { basketAction: string; + @ViewChild('addBasketToBucketDialog') + addToBucketDialog: RecordBucketDialogComponent; + constructor( private router: Router, private basket: BasketService @@ -38,6 +43,14 @@ export class BasketActionsComponent implements OnInit { case 'clear': this.basket.removeAllRecordIds(); break; + + case 'bucket': + this.basket.getRecordIds().then(ids => { + this.addToBucketDialog.recordId = ids; + this.addToBucketDialog.open({size: 'lg'}); + }); + break; + } // Resetting basketAction inside its onchange handler diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.html index d37981b450..3019b335aa 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/result/results.component.html @@ -23,15 +23,17 @@
-
-
+

Search Results ({{searchContext.result.count}})

+
+

Basket View

+
-
-
+
-
+
diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts index 52a26f2b2b..edb0564cfc 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.ts @@ -95,6 +95,9 @@ export class SearchFormComponent implements OnInit, AfterViewInit { formEnter(source) { this.searchContext.pager.offset = 0; + // Form searches override basket displays. + this.searchContext.basket = null; + switch (source) { case 'query': // main search form query input diff --git a/Open-ILS/src/eg2/src/app/staff/share/buckets/record-bucket-dialog.component.html b/Open-ILS/src/eg2/src/app/staff/share/buckets/record-bucket-dialog.component.html index f5e4c94652..550dac9a36 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/buckets/record-bucket-dialog.component.html +++ b/Open-ILS/src/eg2/src/app/staff/share/buckets/record-bucket-dialog.component.html @@ -1,6 +1,11 @@