LPXXX org unit admin UI WIP
authorBill Erickson <berickxx@gmail.com>
Mon, 12 Aug 2019 21:30:29 +0000 (17:30 -0400)
committerBill Erickson <berickxx@gmail.com>
Mon, 12 Aug 2019 21:30:29 +0000 (17:30 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.html
Open-ILS/src/eg2/src/app/staff/admin/server/org-unit.component.ts

index 2efa59a..a1ef44a 100644 (file)
@@ -13,7 +13,7 @@
 <eg-confirm-dialog #delConfirm 
   i18n-dialogTitle i18n-dialogBody
   dialogTitle="Confirm Delete"
-  dialogBody="Delete Org Unit {{selected ? selected.label : ''}}?">
+  dialogBody="Delete Org Unit {{selected.label}}?">
 </eg-confirm-dialog>
 
 <div class="row">
     <eg-tree [tree]="tree" (nodeClicked)="nodeClicked($event)"></eg-tree>
   </div>
   <div class="col-lg-8">
-    <h3 i18n class="mb-3">Selected Org Unit</h3>
-    <ng-container *ngIf="!selected">
-      <div class="alert alert-info font-italic" i18n>
-        Select an org unit type from the tree on the left.
-      </div>
-    </ng-container>
-      <eg-fm-record-editor #editDialog idlClass="aou" [displayMode]="inline" 
-        readonlyFields="parent,ou_type,parent_ou" 
-        fieldOrder="parent_ou,ou_type,name,shortname,phone,email,opac_visible,fiscal_calendar"
-        hiddenFields="id,billing_address,mailing_address,holds_address,ill_address">
-      </eg-fm-record-editor>
+    <ngb-tabset #rootTabs [activeId]="main">
+      <ngb-tab title="Main Settings" i18n-title id="main">
+        <ng-template ngbTabContent>
+          <eg-fm-record-editor #editDialog idlClass="aou" [displayMode]="inline" 
+            [mode]="selected ? 'update' : 'create'"
+            readonlyFields="parent,ou_type,parent_ou" [recordId]="selected ? selected.id : null" 
+            fieldOrder="parent_ou,ou_type,name,shortname,phone,email,opac_visible,fiscal_calendar"
+            hiddenFields="id,billing_address,mailing_address,holds_address,ill_address">
+          </eg-fm-record-editor>
+        </ng-template>
+      </ngb-tab>
+    </ngb-tabset>
   </div>
 </div>
index 2dde40c..65b21d0 100644 (file)
@@ -37,7 +37,6 @@ export class OrgUnitComponent implements OnInit {
         // select the root node.
         this.ingestAouTree(this.org.tree());
         this.selected = this.tree.rootNode;
-        this.editDialog.setRecord(this.selected.callerData.orgUnit);
     }
 
     loadAouTree() {
@@ -73,7 +72,6 @@ export class OrgUnitComponent implements OnInit {
 
     nodeClicked($event: any) {
         this.selected = $event;
-        this.editDialog.setRecord(this.selected.callerData.orgUnit);
     }
 
     postUpdate(message: StringComponent) {
@@ -105,8 +103,6 @@ export class OrgUnitComponent implements OnInit {
                     // otherwise the root org.
                     const orgId = org.parent_ou() ? org.parent_ou() : this.org.root().id();
                     this.selected = this.tree.findNode(orgId);
-                    this.editDialog.setRecord(this.selected.callerData.orgUnit);
-
                     this.postUpdate(this.editString);
                 }
             );
@@ -120,9 +116,6 @@ export class OrgUnitComponent implements OnInit {
         const newOrg = this.idl.create('aou');
         newOrg.parent(parentOrg.id());
 
-        this.editDialog.setRecord(newOrg);
-        this.editDialog.mode = 'create';
-
         // TODO UNSUBSCRIBE
         this.editDialog.onSave$.subscribe(result => { // aou object