1 import {Component, OnInit, ViewChild} from '@angular/core';
2 import {Router, ActivatedRoute, ParamMap} from '@angular/router';
3 import {Observable, empty} from 'rxjs';
4 import {map, switchMap} from 'rxjs/operators';
5 import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
6 import {IdlObject} from '@eg/core/idl.service';
7 import {Pager} from '@eg/share/util/pager';
8 import {NetService} from '@eg/core/net.service';
9 import {PcrudService} from '@eg/core/pcrud.service';
10 import {OrgService} from '@eg/core/org.service';
11 import {ComboboxEntry} from '@eg/share/combobox/combobox.component';
13 /* Find, merge, and edit authority records */
16 templateUrl: 'manage.component.html'
18 export class ManageAuthorityComponent implements OnInit {
25 private router: Router,
26 private route: ActivatedRoute,
27 private net: NetService,
28 private org: OrgService,
29 private pcrud: PcrudService
34 this.route.paramMap.subscribe((params: ParamMap) => {
35 this.authTab = params.get('tab') || 'bibs';
36 const id = +params.get('id');
38 if (id !== this.authId) {
43 'open-ils.search.authority.main_entry', this.authId
44 ).subscribe(meta => this.authMeta = meta);
49 // Changing a tab in the UI means changing the route.
50 // Changing the route ultimately results in changing the tab.
51 beforeTabChange(evt: NgbTabChangeEvent) {
53 // prevent tab changing until after route navigation
56 this.authTab = evt.nextId;
62 `/staff/cat/authority/manage/${this.authId}/${this.authTab}`;
63 this.router.navigate([url]);