LP#1847800 / LP#1834687: secondary admin pages: config_field attribute in IDL
authorJeff Davis <jeff.davis@bc.libraries.coop>
Wed, 18 Dec 2019 00:06:19 +0000 (16:06 -0800)
committerChris Sharp <csharp@georgialibraries.org>
Tue, 12 May 2020 15:25:58 +0000 (11:25 -0400)
Signed-off-by: Jeff Davis <jeff.davis@bc.libraries.coop>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Signed-off-by: Chris Sharp <csharp@georgialibraries.org>
Open-ILS/examples/fm_IDL.xml
Open-ILS/examples/fm_IDL.xsd
Open-ILS/src/eg2/src/app/staff/share/admin-page/admin-page.component.ts
Open-ILS/xsl/fm_IDL2js.xsl

index 4dbbcbb..c414118 100644 (file)
@@ -1232,7 +1232,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
             <field reporter:label="Record Format" name="record_format"  reporter:datatype="text"/>
             <field reporter:label="Transmission Format" name="transmission_format"  reporter:datatype="text"/>
             <field reporter:label="Auth" name="auth"  reporter:datatype="bool"/>
-            <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link"/>
+            <field reporter:label="Attrs" name="attrs" oils_persist:virtual="true"  reporter:datatype="link" config_field="true"/>
             <field reporter:label="Use Permission" name="use_perm"  reporter:datatype="link"/>
         </fields>
         <links>
index 7ebbd51..82cf1ec 100644 (file)
@@ -61,6 +61,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
   <xs:attribute ref="reporter:label"/>
   <xs:attribute ref="reporter:datatype"/>
   <xs:attribute ref="reporter:selector"/>
+  <xs:attribute ref="config_field"/>
  </xs:complexType>
 </xs:element>
 
index cb52da7..6dd7632 100644 (file)
@@ -96,6 +96,7 @@ export class AdminPageComponent implements OnInit {
 
     idlClassDef: any;
     pkeyField: string;
+    configFields: string[];
 
     // True if any columns on the object support translations
     translateRowIdx: number;
@@ -122,6 +123,7 @@ export class AdminPageComponent implements OnInit {
         public toast: ToastService
     ) {
         this.translatableFields = [];
+        this.configFields = [];
     }
 
     applyOrgValues(orgId?: number) {
@@ -163,6 +165,9 @@ export class AdminPageComponent implements OnInit {
                 this.idlClassDef.table;
         }
 
+        this.configFields =
+            this.idlClassDef.fields.filter(f => f.config_field);
+
         // gridFilters are a JSON encoded string
         const filters = this.route.snapshot.queryParamMap.get('gridFilters');
         if (filters) {
index aeb4573..cf7b745 100644 (file)
@@ -47,7 +47,7 @@ for (var c in _preload_fieldmapper_IDL) {
  
 <!-- to simplify the logic, the first and last field are assumed to
      have values (and practically always will) -->
-<xsl:template name='printField'>{name:"<xsl:value-of select="@name"/>",<xsl:if test="@reporter:label != ''">label:"<xsl:value-of select="@reporter:label"/>",</xsl:if><xsl:if test="@oils_persist:primitive = 'true'">primitive:true,</xsl:if><xsl:if test="@reporter:selector != ''">selector:"<xsl:value-of select="@reporter:selector"/>",</xsl:if><xsl:if test="@oils_persist:virtual = 'true'">virtual:true,</xsl:if><xsl:if test="@oils_obj:required = 'true'">required:true,</xsl:if><xsl:if test="@oils_persist:i18n = 'true'">i18n:true,</xsl:if><xsl:call-template name='fieldOrLink'><xsl:with-param name='f' select="."/></xsl:call-template>datatype:"<xsl:call-template name='defaultValue'><xsl:with-param name='v' select="@reporter:datatype"/><xsl:with-param name='d' select="string('text')"/></xsl:call-template>"}</xsl:template>
+<xsl:template name='printField'>{name:"<xsl:value-of select="@name"/>",<xsl:if test="@reporter:label != ''">label:"<xsl:value-of select="@reporter:label"/>",</xsl:if><xsl:if test="@oils_persist:primitive = 'true'">primitive:true,</xsl:if><xsl:if test="@reporter:selector != ''">selector:"<xsl:value-of select="@reporter:selector"/>",</xsl:if><xsl:if test="@oils_persist:virtual = 'true'">virtual:true,</xsl:if><xsl:if test="@oils_obj:required = 'true'">required:true,</xsl:if><xsl:if test="@oils_persist:i18n = 'true'">i18n:true,</xsl:if><xsl:if test="@config_field = 'true'">config_field:true,</xsl:if><xsl:call-template name='fieldOrLink'><xsl:with-param name='f' select="."/></xsl:call-template>datatype:"<xsl:call-template name='defaultValue'><xsl:with-param name='v' select="@reporter:datatype"/><xsl:with-param name='d' select="string('text')"/></xsl:call-template>"}</xsl:template>
  
 <xsl:template name="pcrudPerms">
     <xsl:if test="@permission">perms:[<xsl:for-each select="str:split(@permission,' ')">'<xsl:value-of select="./text()"/>'<xsl:if test="not(position() = last())">,</xsl:if></xsl:for-each>]</xsl:if>