LP1809288: Port Booking Admin to Angular
authorJane Sandberg <sandbej@linnbenton.edu>
Thu, 20 Dec 2018 17:39:03 +0000 (11:39 -0600)
committerBill Erickson <berickxx@gmail.com>
Fri, 25 Jan 2019 17:08:16 +0000 (12:08 -0500)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/examples/fm_IDL.xml
Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/booking/routing.module.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/admin/routing.module.ts
Open-ILS/src/eg2/src/app/staff/nav.component.html
Open-ILS/src/templates/staff/navbar.tt2

index 1be2c88..d541e5f 100644 (file)
@@ -4932,11 +4932,11 @@ SELECT  usr,
        <class id="brt" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_type" oils_persist:tablename="booking.resource_type" reporter:label="Resource Type">
                <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_type_id_seq">
                        <field reporter:label="Resource Type ID" name="id" reporter:datatype="id" reporter:selector="name"/>
-                       <field reporter:label="Resource Type Name" name="name" reporter:datatype="text"/>
+                       <field reporter:label="Resource Type Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
                        <field reporter:label="Fine Interval" name="fine_interval" reporter:datatype="interval"/>
                        <field reporter:label="Fine Amount" name="fine_amount" reporter:datatype="money"/>
                        <field reporter:label="Max Fine Amount" name="max_fine" reporter:datatype="money"/>
-                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
+                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
                        <field reporter:label="Catalog Item" name="catalog_item" reporter:datatype="bool"/>
                        <field reporter:label="Bibliographic Record" name="record" reporter:datatype="link"/>
                        <field reporter:label="Transferable" name="transferable" reporter:datatype="bool"/>
@@ -4965,10 +4965,10 @@ SELECT  usr,
        <class id="brsrc" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource" oils_persist:tablename="booking.resource" reporter:label="Resource">
                <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_id_seq">
                        <field reporter:label="Resource ID" name="id" reporter:datatype="id" reporter:selector="barcode" />
-                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
-                       <field reporter:label="Resource Type" name="type" reporter:datatype="link"/>
+                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
+                       <field reporter:label="Resource Type" name="type" reporter:datatype="link" oils_obj:required="true"/>
                        <field reporter:label="Overbook" name="overbook" reporter:datatype="bool"/>
-                       <field reporter:label="Barcode" name="barcode" reporter:datatype="text"/>
+                       <field reporter:label="Barcode" name="barcode" reporter:datatype="text" oils_obj:required="true"/>
                        <field reporter:label="Is Deposit Required" name="deposit" reporter:datatype="bool"/>
                        <field reporter:label="Deposit Amount" name="deposit_amount" reporter:datatype="money"/>
                        <field reporter:label="User Fee" name="user_fee" reporter:datatype="money"/>
@@ -4997,8 +4997,8 @@ SELECT  usr,
        <class id="bra" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr" oils_persist:tablename="booking.resource_attr" reporter:label="Resource Attribute">
                <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_id_seq">
                        <field reporter:label="Resource Attribute ID" name="id" reporter:datatype="id" reporter:selector="name" />
-                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
-                       <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text"/>
+                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
+                       <field reporter:label="Resource Attribute Name" name="name" reporter:datatype="text" oils_obj:required="true"/>
                        <field reporter:label="Resource Type" name="resource_type" reporter:datatype="link"/>
                        <field reporter:label="Is Required" name="required" reporter:datatype="bool"/>
                        <field reporter:label="Valid Values" name="valid_values" oils_persist:virtual="true" reporter:datatype="link"/>
@@ -5023,9 +5023,9 @@ SELECT  usr,
        <class id="brav" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_value" oils_persist:tablename="booking.resource_attr_value" reporter:label="Resource Attribute Value">
                <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_value_id_seq">
                        <field reporter:label="Resource Attribute Value ID" name="id" reporter:datatype="id" reporter:selector="valid_value" />
-                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit"/>
-                       <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link"/>
-                       <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text"/>
+                       <field reporter:label="Owning Library" name="owner" reporter:datatype="org_unit" oils_obj:required="true"/>
+                       <field reporter:label="Resource Attribute" name="attr" reporter:datatype="link" oils_obj:required="true"/>
+                       <field reporter:label="Valid Value" name="valid_value" reporter:datatype="text" oils_obj:required="true"/>
                        <field reporter:label="Resource Attribute Maps" name="attr_maps" oils_persist:virtual="true" reporter:datatype="link"/>
                        <field reporter:label="Resource Attribute Value Maps" name="attr_val_maps" oils_persist:virtual="true" reporter:datatype="link"/>
                </fields>
@@ -5048,9 +5048,9 @@ SELECT  usr,
        <class id="bram" controller="open-ils.cstore open-ils.pcrud" oils_obj:fieldmapper="booking::resource_attr_map" oils_persist:tablename="booking.resource_attr_map" reporter:label="Resource Attribute Map">
                <fields oils_persist:primary="id" oils_persist:sequence="booking.resource_attr_map_id_seq">
                        <field reporter:label="Resource Attribute Map ID" name="id" reporter:datatype="id"/>
-                       <field reporter:label="Resource" name="resource" reporter:datatype="link"/>
-                       <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link"/>
-                       <field reporter:label="Attribute Value" name="value" reporter:datatype="link"/>
+                       <field reporter:label="Resource" name="resource" reporter:datatype="link" oils_obj:required="true"/>
+                       <field reporter:label="Resource Attribute" name="resource_attr" reporter:datatype="link" oils_obj:required="true"/>
+                       <field reporter:label="Attribute Value" name="value" reporter:datatype="link" oils_obj:required="true"/>
                </fields>
                <links>
                        <link field="resource" reltype="has_a" key="id" map="" class="brsrc"/>
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.html b/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.html
new file mode 100644 (file)
index 0000000..e33da8e
--- /dev/null
@@ -0,0 +1,18 @@
+<eg-staff-banner bannerText="Booking Administration" i18n-bannerText>
+</eg-staff-banner>
+
+<div class="container">
+  <eg-link-table columnCount="3">
+    <eg-link-table-link i18n-label label="Resources"
+      routerLink="/staff/admin/booking/resource"></eg-link-table-link>
+    <eg-link-table-link i18n-label label="Resource Attributes"
+      routerLink="/staff/admin/booking/resource_attr"></eg-link-table-link>
+    <eg-link-table-link i18n-label label="Resource Attribute Maps"
+      routerLink="/staff/admin/booking/resource_attr_map"></eg-link-table-link>
+    <eg-link-table-link i18n-label label="Resource Attribute Values"
+      routerLink="/staff/admin/booking/resource_attr_value"></eg-link-table-link>
+    <eg-link-table-link i18n-label label="Resource Types"
+      routerLink="/staff/admin/booking/resource_type"></eg-link-table-link>
+  </eg-link-table>
+</div>
+
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking-splash.component.ts
new file mode 100644 (file)
index 0000000..e6be070
--- /dev/null
@@ -0,0 +1,11 @@
+import {Component, Input, ViewChildren,
+    AfterViewInit, QueryList} from '@angular/core';
+
+@Component({
+    templateUrl: './admin-booking-splash.component.html'
+})
+
+export class AdminBookingSplashComponent {
+}
+
+
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/booking/admin-booking.module.ts
new file mode 100644 (file)
index 0000000..b6ea6e1
--- /dev/null
@@ -0,0 +1,24 @@
+import {NgModule} from '@angular/core';
+import {StaffCommonModule} from '@eg/staff/common.module';
+import {AdminBookingRoutingModule} from './routing.module';
+import {AdminCommonModule} from '@eg/staff/admin/common.module';
+import {AdminBookingSplashComponent} from './admin-booking-splash.component';
+
+@NgModule({
+  declarations: [
+      AdminBookingSplashComponent
+  ],
+  imports: [
+    AdminCommonModule,
+    AdminBookingRoutingModule
+  ],
+  exports: [
+  ],
+  providers: [
+  ]
+})
+
+export class AdminBookingModule {
+}
+
+
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/booking/routing.module.ts b/Open-ILS/src/eg2/src/app/staff/admin/booking/routing.module.ts
new file mode 100644 (file)
index 0000000..1cbf480
--- /dev/null
@@ -0,0 +1,22 @@
+import {NgModule} from '@angular/core';
+import {RouterModule, Routes} from '@angular/router';
+import {AdminBookingSplashComponent} from './admin-booking-splash.component';
+import {BasicAdminPageComponent} from '@eg/staff/admin/basic-admin-page.component';
+
+const routes: Routes = [{
+    path: 'splash',
+    component: AdminBookingSplashComponent
+}, {
+    path: ':table',
+    component: BasicAdminPageComponent,
+    // All booking admin pages cover data in the booking.* schema.  No need to
+    // duplicate it within the URL path.  Pass it manually instead.
+    data: [{schema: 'booking'}]
+}];
+
+@NgModule({
+  imports: [RouterModule.forChild(routes)],
+  exports: [RouterModule]
+})
+
+export class AdminBookingRoutingModule {}
index a93f9ee..29df72c 100644 (file)
@@ -12,6 +12,9 @@ const routes: Routes = [{
   }, {
     path: 'acq',
     loadChildren: '@eg/staff/admin/acq/admin-acq.module#AdminAcqModule'
+  }, {
+    path: 'booking',
+    loadChildren: '@eg/staff/admin/booking/admin-booking.module#AdminBookingModule'
   }]
 }];
 
index feed30b..7c30c00 100644 (file)
             <span class="material-icons">layers</span>
             <span i18n>Serials Administration</span>
           </a>
-          <a class="dropdown-item" href="/eg/staff/admin/booking/index">
+          <a class="dropdown-item"
+              routerLink="/staff/admin/booking/splash">
             <span class="material-icons">business_center</span>
             <span i18n>Booking Administration</span>
           </a>
index d82ca1f..1ca59d5 100644 (file)
             </a>
           </li>
           <li>
-            <a href="./admin/booking/index" target="_self">
+            <a href="/eg2/staff/admin/booking/splash" target="_self">
               <span class="glyphicon glyphicon-calendar"></span>
               [% l('Booking Administration') %]
             </a>