From e55ff6b76a231e74c9120567160a0f19a747c21f Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Mon, 10 Dec 2018 12:36:39 -0500 Subject: [PATCH] LP1806087 More browse/search form work Signed-off-by: Bill Erickson --- .../src/eg2/src/app/staff/catalog/browse.component.html | 2 +- .../src/eg2/src/app/staff/catalog/browse.component.ts | 16 ++++++++++++++-- .../eg2/src/app/staff/catalog/search-form.component.html | 2 +- .../eg2/src/app/staff/catalog/search-form.component.ts | 6 +++++- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.html index 97742f7da0..b50a415b4b 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.html @@ -1,5 +1,5 @@ - + diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.ts b/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.ts index 996f96546f..41bf67ab19 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/catalog/browse.component.ts @@ -1,18 +1,30 @@ -import {Component, OnInit} from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; import {StaffCatalogService} from './catalog.service'; +import {BasketService} from '@eg/share/catalog/basket.service'; +import {SearchFormComponent} from './search-form.component'; @Component({ templateUrl: 'browse.component.html' }) export class BrowseComponent implements OnInit { + @ViewChild('searchForm') searchForm: SearchFormComponent; + constructor( - private staffCat: StaffCatalogService + private staffCat: StaffCatalogService, + private basket: BasketService ) {} ngOnInit() { // A SearchContext provides all the data needed for browse. this.staffCat.createContext(); + + // Cache the basket on page load. + this.basket.getRecordIds(); + + this.searchForm.searchTab = 'browse'; } + + ngAfterViewInit() { } diff --git a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html index 374df5b1dc..34e11f716d 100644 --- a/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html +++ b/Open-ILS/src/eg2/src/app/staff/catalog/search-form.component.html @@ -299,7 +299,7 @@ TODO focus search input 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 1944a3c3e9..dc4c97687c 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 @@ -29,7 +29,7 @@ export class SearchFormComponent implements OnInit, AfterViewInit { private staffCat: StaffCatalogService ) { this.copyLocations = []; - this.searchTab = 'term'; + //this.searchTab = 'term'; } ngOnInit() { @@ -49,6 +49,10 @@ export class SearchFormComponent implements OnInit, AfterViewInit { // Avoid changing the tab in the lifecycle hook thread. setTimeout(() => { + + // Apply a tab if none was already specified + if (this.searchTab) { return; } + // Assumes that only one type of search will be searchable // at any given time. if (this.context.marcSearch.isSearchable()) { -- 2.11.0