LP#1775466 Improve handling org_unit / boolean types
authorBill Erickson <berickxx@gmail.com>
Tue, 17 Jul 2018 17:05:44 +0000 (13:05 -0400)
committerBill Erickson <berickxx@gmail.com>
Wed, 5 Sep 2018 14:05:23 +0000 (10:05 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/core/format.service.ts
Open-ILS/src/eg2/src/app/core/idl.service.ts

index e384f22..dfb04b2 100644 (file)
@@ -91,7 +91,8 @@ export class FormatService {
                 // Slightly better than a bare 't' or 'f'.
                 // Should probably add a global true/false string.
                 return Boolean(
-                    value === 't' || value === 1 || value === '1'
+                    value === 't' || value === 1 || 
+                    value === '1' || value === true
                 ).toString();
 
             default:
index 95a92a4..89f8411 100644 (file)
@@ -68,6 +68,11 @@ export class IdlService {
                     if (!field.label) {
                         field.label = field.name;
                     }
+
+                    // Coerce 'aou' links to datatype org_unit for consistency.
+                    if (field.datatype === 'link' && field.class === 'aou') {
+                        field.datatype = 'org_unit';
+                    }
                 });
 
                 return x;