From 22e046d33c8bfce2c59f9de075c72ee0b4d9bdbd Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 6 Dec 2019 13:02:55 -0500 Subject: [PATCH 1/1] LP1852782 Catalog search form expand/collapse Collapse the form by default on record detail pages for closer consistency with previous catalogs. When collapsed, provide an option to expand the search form. Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../staff/catalog/search-form.component.html | 17 +++++++++++++---- .../app/staff/catalog/search-form.component.ts | 16 +++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) 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 d032f3d08f..f5d2e50fb0 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 @@ -1,7 +1,15 @@ - -
+
+ + + +
@@ -351,5 +359,6 @@ 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 84dd830538..42e70861f6 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 @@ -1,5 +1,5 @@ import {Component, OnInit, AfterViewInit, Renderer2} from '@angular/core'; -import {ActivatedRoute} from '@angular/router'; +import {Router, ActivatedRoute, NavigationEnd} from '@angular/router'; import {IdlObject} from '@eg/core/idl.service'; import {OrgService} from '@eg/core/org.service'; import {CatalogService} from '@eg/share/catalog/catalog.service'; @@ -21,8 +21,12 @@ export class SearchFormComponent implements OnInit, AfterViewInit { copyLocations: IdlObject[]; searchTab: string; + // Display the full form if true, otherwise display the expandy. + showThyself = true; + constructor( private renderer: Renderer2, + private router: Router, private route: ActivatedRoute, private org: OrgService, private cat: CatalogService, @@ -39,6 +43,16 @@ export class SearchFormComponent implements OnInit, AfterViewInit { this.searchTab = params.searchTab; } }); + + this.router.events.subscribe(routeEvent => { + if (routeEvent instanceof NavigationEnd) { + if (routeEvent.url.match(/catalog\/record/)) { + this.showThyself = false; + } else { + this.showThyself = true; + } + } + }); } ngOnInit() { -- 2.43.2