LP 1857351: set basic admin interface field order using route
authorJane Sandberg <sandbej@linnbenton.edu>
Thu, 25 Jun 2020 22:55:26 +0000 (22:55 +0000)
committerJane Sandberg <sandbej@linnbenton.edu>
Thu, 28 Jan 2021 18:34:21 +0000 (10:34 -0800)
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Signed-off-by: Ruth Frasur <rfrasur@library.in.gov>
Signed-off-by: Michele Morgan <mmorgan@noblenet.org>
Open-ILS/src/eg2/src/app/staff/admin/acq/routing.module.ts
Open-ILS/src/eg2/src/app/staff/admin/basic-admin-page.component.ts
Open-ILS/src/eg2/src/app/staff/admin/local/routing.module.ts
Open-ILS/src/eg2/src/app/staff/admin/server/routing.module.ts
Open-ILS/src/eg2/src/app/staff/cat/vandelay/merge-profiles.component.ts
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.html
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts

index c07dd5d..013fb82 100644 (file)
@@ -7,6 +7,15 @@ const routes: Routes = [{
     path: 'splash',
     component: AdminAcqSplashComponent
 }, {
+    path: 'edi_account',
+    component: BasicAdminPageComponent,
+    data: [{
+        schema: 'acq',
+        table: 'edi_account',
+        fieldOrder: 'id,label,provider,owner,account,vendacct,vendcode,last_activity,host,username,password,path,in_dir,use_attrs,attr_set',
+        readonlyFields: 'last_activity'
+    }]
+}, {
     path: ':table',
     component: BasicAdminPageComponent,
     // All ACQ admin pages cover data in the acq.* schema.  No need to
index a983a72..91b2040 100644 (file)
@@ -17,6 +17,7 @@ import {tap, switchMap} from 'rxjs/operators';
       </eg-staff-banner>
       <eg-admin-page persistKeyPfx="{{persistKeyPfx}}" idlClass="{{idlClass}}"
         configLinkBasePath="{{configLinkBasePath}}"
+        fieldOrder="{{fieldOrder}}"
         readonlyFields="{{readonlyFields}}"
         [disableOrgFilter]="disableOrgFilter"></eg-admin-page>
       </ng-container>
@@ -28,6 +29,7 @@ export class BasicAdminPageComponent implements OnInit {
     idlClass: string;
     classLabel: string;
     persistKeyPfx: string;
+    fieldOrder = '';
     readonlyFields = '';
     configLinkBasePath = '/staff/admin';
 
@@ -68,6 +70,7 @@ export class BasicAdminPageComponent implements OnInit {
                         this.table = data['table'];
                     }
                 this.disableOrgFilter = data['disableOrgFilter'];
+                this.fieldOrder = data['fieldOrder'];
                 this.readonlyFields = data['readonlyFields'];
                 }
 
index 8ce6dce..8f47779 100644 (file)
@@ -18,6 +18,13 @@ const routes: Routes = [{
     path: 'actor/address_alert',
     component: AddressAlertComponent
 }, {
+    path: 'asset/copy_location',
+    component: BasicAdminPageComponent,
+    data: [{
+        schema: 'asset',
+        table: 'copy_location',
+        fieldOrder: 'owning_lib,name,opac_visible,circulate,holdable,hold_verify,checkin_alert,deleted,label_prefix,label_suffix,url,id'}]
+}, {
     path: 'container/carousel',
     component: AdminCarouselComponent
 }, {
index 194a979..9644354 100644 (file)
@@ -17,9 +17,25 @@ const routes: Routes = [{
     loadChildren: () =>
       import('./floating-group/floating-group.module').then(m => m.FloatingGroupModule)
 }, {
+    path: 'config/hard_due_date',
+    component: BasicAdminPageComponent,
+    data: [{
+        schema: 'config',
+        table: 'hard_due_date',
+        fieldOrder: 'name,owner,ceiling_date,forceto'
+    }]
+}, {
     path: 'config/print_template',
     component: PrintTemplateComponent
 }, {
+    path: 'config/z3950_source',
+    component: BasicAdminPageComponent,
+    data: [{
+        schema: 'config',
+        table: 'z3950_source',
+        fieldOrder: 'name,label,host,port,db,record_format,transmission_format,auth,use_perm'
+    }]
+}, {
     path: 'permission/grp_tree',
     component: PermGroupTreeComponent
 }, {
index 2059b61..a1cc384 100644 (file)
@@ -1,7 +1,9 @@
 import {Component} from '@angular/core';
 
 @Component({
-    template: `<eg-admin-page idlClass="vmp"></eg-admin-page>`
+    template: `<eg-admin-page idlClass="vmp"
+      fieldOrder="name,owner,add_spec,replace_spec,strip_spec,preserve_spec,lwm_ratio,update_bib_source,id">
+    </eg-admin-page>`
 })
 export class MergeProfilesComponent {
     constructor() {}
index dbc350d..a7d7123 100644 (file)
 </eg-grid>
 
 <eg-fm-record-editor #editDialog idlClass="{{idlClass}}" 
-    [fieldOptions]="fieldOptions" [defaultNewRecord]="defaultNewRecord"
-    [preloadLinkedValues]="true" readonlyFields="{{readonlyFields}}">
+    [fieldOptions]="fieldOptions"
+    [fieldOrder]="fieldOrder"
+    [defaultNewRecord]="defaultNewRecord"
+    [preloadLinkedValues]="true"
+    [readonlyFields]="readonlyFields">
 </eg-fm-record-editor>
 
 
index dfcd549..3438b47 100644 (file)
@@ -44,6 +44,10 @@ export class AdminPageComponent implements OnInit {
     // Size of create/edito dialog.  Uses large by default.
     @Input() dialogSize: 'sm' | 'lg' = 'lg';
 
+    // Optional comma-separated list of field names defining the order in which
+    // fields should be rendered in the fm-editor and grid.
+    @Input() fieldOrder: string;
+
     // comma-separated list of fields to hide.
     // This does not imply all other fields should be visible, only that
     // the selected fields will be hidden.