LP#1779158 Display attrs page
authorBill Erickson <berickxx@gmail.com>
Thu, 12 Jul 2018 16:10:26 +0000 (12:10 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 11 Oct 2018 18:56:30 +0000 (14:56 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.ts [new file with mode: 0644]

diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.html b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.html
new file mode 100644 (file)
index 0000000..78a86ed
--- /dev/null
@@ -0,0 +1,17 @@
+
+<ngb-tabset #tabs [activeId]="attrType" (tabChange)="onTabChange($event)">
+       <ngb-tab title="Bibliographic Attributes" i18n-title id="bib">
+               <ng-template ngbTabContent>
+      <div class="mt-3">
+        <eg-admin-page idlClass="vqbrad"></eg-admin-page>
+      </div>
+               </ng-template>
+       </ngb-tab>
+       <ngb-tab title="Authority Attributes" i18n-title id="authority">
+               <ng-template ngbTabContent>
+      <div class="mt-3">
+        <eg-admin-page idlClass="vqarad"></eg-admin-page>
+      </div>
+               </ng-template>
+       </ngb-tab>
+</ngb-tabset>
diff --git a/Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.ts b/Open-ILS/src/eg2/src/app/staff/cat/vandelay/display-attrs.component.ts
new file mode 100644 (file)
index 0000000..6cb13af
--- /dev/null
@@ -0,0 +1,35 @@
+import {Component, OnInit, ViewChild} from '@angular/core';
+import {Router, ActivatedRoute, ParamMap} from '@angular/router';              
+import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+
+@Component({
+  templateUrl: 'display-attrs.component.html'
+})
+export class DisplayAttrsComponent {
+
+    attrType: string;
+
+    constructor(
+        private router: Router,
+        private route: ActivatedRoute) {
+
+        this.route.paramMap.subscribe((params: ParamMap) => {                  
+            this.attrType = params.get('atype');
+        });
+    }
+
+    // Changing a tab in the UI means changing the route.
+    // Changing the route ultimately results in changing the tab.
+    onTabChange(evt: NgbTabChangeEvent) {
+        this.attrType = evt.nextId;
+
+        // prevent tab changing until after route navigation
+        evt.preventDefault();
+
+        const url = 
+          `/staff/cat/vandelay/display_attrs/${this.attrType}`;
+
+        this.router.navigate([url]);
+    }
+}
+