--- /dev/null
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+
+const routes: Routes = [
+ { path: 'search',
+ loadChildren: './search/acq-search.module#AcqSearchModule'
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule]
+})
+
+export class AcqRoutingModule {}
--- /dev/null
+<eg-staff-banner bannerText="Acquisitions Search" i18n-bannerText>
+</eg-staff-banner>
+
+<div class="row">
+ <div class="ml-auto mr-3"><a i18n href="/eg/staff/acq/legacy/search/unified">Legacy Search Interface</a></div>
+</div>
+<div class="row">
+ <div class="col-lg-12">
+ <ngb-tabset #acqSearchTabs [activeId]="searchType" (tabChange)="onTabChange($event)">
+ <ngb-tab title="Line Items Search" i18n-title id="lineitems">
+ </ngb-tab>
+ <ngb-tab title="Purchase Orders Search" i18n-title id="purchaseorders">
+ </ngb-tab>
+ <ngb-tab title="Invoices Search" i18n-title id="invoices">
+ </ngb-tab>
+ <ngb-tab title="Selection Lists Search" i18n-title id="selectionlists">
+ </ngb-tab>
+ </ngb-tabset>
+ </div>
+</div>
--- /dev/null
+import {Component, OnInit, AfterViewInit, ViewChild} from '@angular/core';
+import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {Router, ActivatedRoute} from '@angular/router';
+import {StaffCommonModule} from '@eg/staff/common.module';
+
+@Component({
+ templateUrl: './acq-search.component.html'
+})
+
+export class AcqSearchComponent implements OnInit, AfterViewInit {
+
+ searchType = '';
+ validSearchTypes = ['lineitems', 'purchaseorders', 'invoices', 'selectionlists'];
+ defaultSearchType = 'lineitems';
+
+ onTabChange: ($event: NgbTabChangeEvent) => void;
+ @ViewChild('acqSearchTabs', { static: true }) tabs: NgbTabset;
+
+ constructor(
+ private router: Router,
+ private route: ActivatedRoute,
+ ) {}
+
+ ngOnInit() {
+ let searchTypeParam = this.route.snapshot.paramMap.get('searchtype');
+
+ if (searchTypeParam) {
+ if (this.validSearchTypes.includes(searchTypeParam)) {
+ this.searchType = searchTypeParam;
+ } else {
+ this.searchType = this.defaultSearchType;
+ this.router.navigate(['/staff', 'acq', 'search', this.searchType]);
+ }
+ }
+
+ this.onTabChange = ($event) => {
+ if (this.validSearchTypes.includes($event.nextId)) {
+ this.router.navigate(['/staff', 'acq', 'search', $event.nextId]);
+ }
+ };
+ }
+
+ ngAfterViewInit() {}
+
+}
--- /dev/null
+import {NgModule} from '@angular/core';
+import {StaffCommonModule} from '@eg/staff/common.module';
+import {AcqSearchRoutingModule} from './routing.module'
+import {AcqSearchComponent} from './acq-search.component';
+
+@NgModule({
+ declarations: [
+ AcqSearchComponent
+ ],
+ imports: [
+ StaffCommonModule,
+ AcqSearchRoutingModule
+ ],
+})
+
+export class AcqSearchModule {
+}
--- /dev/null
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {AcqSearchComponent} from './acq-search.component';
+
+const routes: Routes = [
+ { path: '',
+ component: AcqSearchComponent
+ },
+ { path: ':searchtype',
+ component: AcqSearchComponent
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+ providers: []
+})
+
+export class AcqSearchRoutingModule {}
</a>
<div class="dropdown-menu" ngbDropdownMenu>
<a class="dropdown-item"
- href="/eg/staff/acq/legacy/search/unified">
+ routerLink="/staff/acq/search">
<span class="material-icons">search</span>
<span i18n>General Search</span>
</a>
redirectTo: 'splash',
pathMatch: 'full',
}, {
+ path: 'acq',
+ loadChildren : '@eg/staff/acq/routing.module#AcqRoutingModule'
+ }, {
path: 'booking',
loadChildren : '@eg/staff/booking/booking.module#BookingModule'
}, {
</a>
<ul uib-dropdown-menu>
<li>
- <a href="./acq/legacy/search/unified" target="_self">
+ <a href="/eg2/staff/acq/search" target="_self">
<span class="glyphicon glyphicon-search"></span>
[% l('General Search') %]
</a>