--- /dev/null
+<eg-staff-banner bannerText="Providers" i18n-bannerText>
+</eg-staff-banner>
+
+<div class="row" id="acq-provider-page">
+ <div class="col-lg-12">
+ <ngb-tabset #acqProviderTabs [activeId]="activeTab" (tabChange)="onTabChange($event)">
+ <ngb-tab title="Search" i18n-title id="search">
+ <ng-template ngbTabContent>PROVIDER SEARCH FORM</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Provider" i18n-title id="details" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER DETAILS TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Addresses" i18n-title id="addresses" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER ADDRESSES TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Contacts" i18n-title id="contacts" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER CONTACTS TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Attribute Definitions" i18n-title id="attributes" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER ATTRIBUTES TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Holdings Definitions" i18n-title id="holdings" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER HOLDINGS TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="EDI" i18n-title id="edi_accounts" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER EDI TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="Invoices" i18n-title id="invoices" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER INVOICES TAB</ng-template>
+ </ngb-tab>
+ <ngb-tab title="POs" i18n-title id="purchase_orders" [disabled]="!id">
+ <ng-template ngbTabContent>PROVIDER PURCHASE ORDERS TAB</ng-template>
+ </ngb-tab>
+ </ngb-tabset>
+ </div>
+</div>
--- /dev/null
+import {Component, OnInit, AfterViewInit} from '@angular/core';
+import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {Router, ActivatedRoute, ParamMap, RouterEvent, NavigationEnd} from '@angular/router';
+import {StaffCommonModule} from '@eg/staff/common.module';
+import {IdlService, IdlObject} from '@eg/core/idl.service';
+import {PcrudService} from '@eg/core/pcrud.service';
+
+@Component({
+ templateUrl: './acq-provider.component.html'
+})
+
+export class AcqProviderComponent implements OnInit, AfterViewInit {
+
+ activeTab = '';
+ id = null;
+ validTabTypes = ['search', 'details', 'addresses', 'contacts', 'attributes', 'holdings', 'edi_accounts', 'purchase_orders', 'invoices'];
+ defaultTabType = 'details';
+
+ onTabChange: ($event: NgbTabChangeEvent) => void;
+
+ constructor(
+ private router: Router,
+ private route: ActivatedRoute,
+ private pcrud: PcrudService,
+ private idl: IdlService,
+ ) {
+ }
+
+ ngOnInit() {
+ const self = this;
+
+ const tabTypeParam = this.route.snapshot.paramMap.get('tab');
+ const idParam = this.route.snapshot.paramMap.get('id');
+
+ if (idParam) {
+ this.id = idParam;
+ if (!tabTypeParam) {
+ this.activeTab = this.defaultTabType;
+ this.router.navigate(['/staff', 'acq', 'provider', this.id, this.activeTab]);
+ }
+ }
+
+ if (tabTypeParam) {
+ if (this.validTabTypes.includes(tabTypeParam)) {
+ this.activeTab = tabTypeParam;
+ } else {
+ this.activeTab = this.defaultTabType;
+ this.router.navigate(['/staff', 'acq', 'provider', this.id, this.activeTab]);
+ }
+ } else {
+ this.activeTab = 'search';
+ }
+
+ this.onTabChange = ($event) => {
+ if (this.validTabTypes.includes($event.nextId)) {
+ this.activeTab = $event.nextId;
+ const id = this.route.snapshot.paramMap.get('id');
+ this.router.navigate(['/staff', 'acq', 'provider', this.id, $event.nextId]);
+ }
+ };
+ }
+
+ ngAfterViewInit() {}
+
+}
--- /dev/null
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {AcqProviderComponent} from './acq-provider.component';
+
+const routes: Routes = [
+ { path: '',
+ component: AcqProviderComponent,
+ runGuardsAndResolvers: 'always'
+ },
+ { path: ':id',
+ component: AcqProviderComponent,
+ runGuardsAndResolvers: 'always'
+ },
+ { path: ':id/:tab',
+ component: AcqProviderComponent,
+ runGuardsAndResolvers: 'always'
+ }
+];
+
+@NgModule({
+ imports: [RouterModule.forChild(routes)],
+ exports: [RouterModule],
+ providers: []
+})
+
+export class AcqProviderRoutingModule {}