From: Bill Erickson Date: Mon, 12 Aug 2019 20:44:14 +0000 (-0400) Subject: LP1840050 FM Editor refresh display for inline mode + more X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=bcd53f50f676cd14a6a5628f757e21b26ee0a7d9;p=working%2FEvergreen.git LP1840050 FM Editor refresh display for inline mode + more Force the editor to re-render its record in real time when using inline mode, since the call to open() will never occur for inline mode. Pass the org unit ID to org selects as they change, instead of only at startup time, since the org select component may be rendered (in inline mode) before the org ID is available to apply as a startOrgId value. Migrate toward set/get functions for updating records and recordIds and deprecate the redundant setRecord() function. Adds a new hideBanner @Input() which prevents the modal header from displaying, typically used for 'inline' mode. Improve @Output() names and update refs. IDL services gets a pkeyMatches method for testing IDLObject equality. Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/core/idl.service.ts b/Open-ILS/src/eg2/src/app/core/idl.service.ts index 56b8b90e1f..0537f05983 100644 --- a/Open-ILS/src/eg2/src/app/core/idl.service.ts +++ b/Open-ILS/src/eg2/src/app/core/idl.service.ts @@ -156,5 +156,14 @@ export class IdlService { } return null; } + + // Returns true if both objects have the same IDL class and pkey value. + pkeyMatches(obj1: IdlObject, obj2: IdlObject) { + if (!obj1 || !obj2) { return false; } + const idlClass = obj1.classname; + if (idlClass !== obj2.classname) { return false; } + const pkeyField = this.classes[idlClass].pkey || 'id'; + return obj1[pkeyField]() === obj2[pkeyField](); + } } diff --git a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html index fc11eee6c2..2621b3e948 100644 --- a/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html +++ b/Open-ILS/src/eg2/src/app/share/fm-editor/fm-editor.component.html @@ -5,7 +5,7 @@ -