From: Bill Erickson Date: Fri, 8 Mar 2019 17:30:26 +0000 (-0500) Subject: LP1819179 IDL2js includes 'map' attribute data X-Git-Url: http://git.equinoxoli.org/?p=evergreen-equinox.git;a=commitdiff_plain;h=d26ece239b3e0b703b44bc0f6b23711d4daf9fb4 LP1819179 IDL2js includes 'map' attribute data Patch from Mike Rylander to teach the IDL2js generator to include 'map' attributes, which allow JS clients to step through mapped, linked fields, particuarly useful for auto-fleshing these fields. Signed-off-by: Bill Erickson Signed-off-by: Dan Wells --- diff --git a/Open-ILS/src/eg2/src/app/core/pcrud.service.ts b/Open-ILS/src/eg2/src/app/core/pcrud.service.ts index f023b6d..b3d4288 100644 --- a/Open-ILS/src/eg2/src/app/core/pcrud.service.ts +++ b/Open-ILS/src/eg2/src/app/core/pcrud.service.ts @@ -104,8 +104,11 @@ export class PcrudContext { } this.idl.classes[fmClass].fields - .filter(f => f.datatype === 'link' && !f.virtual) - .forEach(field => { + .filter(f => + f.datatype === 'link' && ( + f.reltype === 'has_a' || f.reltype === 'might_have' + ) + ).forEach(field => { const selector = this.idl.getLinkSelector(fmClass, field.name); if (!selector) { return; } diff --git a/Open-ILS/xsl/fm_IDL2js.xsl b/Open-ILS/xsl/fm_IDL2js.xsl index 6c7709f..aeb4573 100644 --- a/Open-ILS/xsl/fm_IDL2js.xsl +++ b/Open-ILS/xsl/fm_IDL2js.xsl @@ -58,7 +58,7 @@ for (var c in _preload_fieldmapper_IDL) { type:"link",, -key:"","class":"",reltype:"" +map:"",key:"","class":"",reltype:""