submit search form immediately (LH#14)
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Jul 2020 21:44:39 +0000 (17:44 -0400)
committerGalen Charlton <gmc@equinoxinitiative.org>
Thu, 9 Jul 2020 21:44:39 +0000 (17:44 -0400)
TODO: see if we can defer this if all we've done is gone
      directly to a specific provider

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/acq/provider/provider-results.component.html
Open-ILS/src/eg2/src/app/staff/acq/provider/provider-results.component.ts

index 9691ddb..a0b8408 100644 (file)
@@ -1,4 +1,4 @@
-<eg-acq-provider-search-form (searchSubmitted)="doSearch($event)"></eg-acq-provider-search-form>
+<eg-acq-provider-search-form #providerSearchForm (searchSubmitted)="doSearch($event)"></eg-acq-provider-search-form>
 
 <ng-template #contactTmpl let-provider="row">
   <ul>
index 413f62b..b981b7f 100644 (file)
@@ -1,4 +1,4 @@
-import {Component, OnInit, Input, Output, EventEmitter, ViewChild} from '@angular/core';
+import {Component, OnInit, AfterViewInit, Input, Output, EventEmitter, ViewChild} from '@angular/core';
 import {Observable} from 'rxjs';
 import {map} from 'rxjs/operators';
 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
@@ -20,6 +20,7 @@ export class ProviderResultsComponent implements OnInit {
 
     gridSource: GridDataSource;
     @ViewChild('acqSearchProviderGrid', { static: true }) providerResultsGrid: GridComponent;
+    @ViewChild('providerSearchForm', { static: true }) providerSearchForm: AcqProviderSearchFormComponent;
 
     cellTextGenerator: GridCellTextGenerator;
     @Output() previewRow: (row: any) => void;
@@ -46,6 +47,10 @@ export class ProviderResultsComponent implements OnInit {
         }
     }
 
+    ngAfterViewInit() {
+        setTimeout(x => this.providerSearchForm.submitSearch());
+    }
+
     doSearch(search: AcqProviderSearch) {
         setTimeout(() => {
             this.providerSearch.setSearch(search);