LP1864371 ngbTabset to ngbNav for marc editor
authorBill Erickson <berickxx@gmail.com>
Fri, 26 Jun 2020 17:57:50 +0000 (13:57 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 6 Aug 2020 16:34:31 +0000 (12:34 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.html
Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts

index 95baa07..2134810 100644 (file)
 
 <div *ngIf="!dataSaving" class="row">
   <div class="col-lg-12">
 
 <div *ngIf="!dataSaving" class="row">
   <div class="col-lg-12">
-    <ngb-tabset [activeId]="editorTab" (tabChange)="tabChange($event)">
-      <ngb-tab title="Enhanced MARC Editor" i18n-title id="rich">
-        <ng-template ngbTabContent>
+    <ul ngbNav #editorNav="ngbNav" class="nav-tabs"
+      [activeId]="editorTab" (navChange)="tabChange($event)">
+      <li [ngbNavItem]="'rich'">
+        <a ngbNavLink i18n>Enhanced MARC Editor</a>
+        <ng-template ngbNavContent>
           <ng-container *ngIf="context && context.record">
             <eg-marc-rich-editor [context]="context"></eg-marc-rich-editor>
           </ng-container>
         </ng-template>
           <ng-container *ngIf="context && context.record">
             <eg-marc-rich-editor [context]="context"></eg-marc-rich-editor>
           </ng-container>
         </ng-template>
-      </ngb-tab>
-      <ngb-tab title="Flat Text Editor" i18n-title id="flat">
-        <ng-template ngbTabContent>
+      </li>
+      <li ngbNavItem="flat">
+        <a ngbNavLink i18n>Flat Text Editor</a>
+        <ng-template ngbNavContent>
           <ng-container *ngIf="context && context.record">
             <eg-marc-flat-editor [context]="context"></eg-marc-flat-editor>
           </ng-container>
         </ng-template>
           <ng-container *ngIf="context && context.record">
             <eg-marc-flat-editor [context]="context"></eg-marc-flat-editor>
           </ng-container>
         </ng-template>
-      </ngb-tab>
-    </ngb-tabset>
+      </li>
+    </ul>
+    <div [ngbNavOutlet]="editorNav"></div>
   </div>
 </div>
 
   </div>
 </div>
 
index 241379f..cbcf5ed 100644 (file)
@@ -13,7 +13,7 @@ import {ComboboxEntry, ComboboxComponent
   } from '@eg/share/combobox/combobox.component';
 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
 import {MarcEditContext} from './editor-context';
   } from '@eg/share/combobox/combobox.component';
 import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
 import {MarcEditContext} from './editor-context';
-import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap';
+import {NgbNav, NgbNavChangeEvent} from '@ng-bootstrap/ng-bootstrap';
 import {HoldingsService} from '@eg/staff/share/holdings/holdings.service';
 
 export interface MarcSavedEvent {
 import {HoldingsService} from '@eg/staff/share/holdings/holdings.service';
 
 export interface MarcSavedEvent {
@@ -155,7 +155,7 @@ export class MarcEditorComponent implements OnInit {
     }
 
     // Remember the last used tab as the preferred tab.
     }
 
     // Remember the last used tab as the preferred tab.
-    tabChange(evt: NgbTabChangeEvent) {
+    tabChange(evt: NgbNavChangeEvent) {
 
         // Avoid undo persistence across tabs since that could result
         // in changes getting lost.
 
         // Avoid undo persistence across tabs since that could result
         // in changes getting lost.