From 6343177c6f4dda71016976b17389e75ded7a2fcb Mon Sep 17 00:00:00 2001
From: Bill Erickson <berickxx@gmail.com>
Date: Thu, 12 Dec 2019 10:35:06 -0500
Subject: [PATCH] LP1852782 FF context menu repairs; Angular fixes

Fix regression in context menu generation for fixed fields.

Migrate some ViewChild's from static=true to static=false.

Signed-off-by: Bill Erickson <berickxx@gmail.com>

Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
---
 .../app/staff/share/marc-edit/editable-content.component.ts  |  3 ++-
 .../eg2/src/app/staff/share/marc-edit/editor.component.ts    | 12 ++++++------
 .../src/app/staff/share/marc-edit/rich-editor.component.html |  3 +--
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editable-content.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editable-content.component.ts
index 312f7b1b67..2eeadf16e4 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editable-content.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editable-content.component.ts
@@ -209,7 +209,7 @@ export class EditableContentComponent
     // These are served dynamically to handle cases where a tag or
     // subfield is modified in place.
     contextMenuEntries(): ContextMenuEntry[] {
-        if (!this.field) { return; }
+        if (this.isLeader) { return; }
 
         switch (this.fieldType) {
             case 'tag':
@@ -249,6 +249,7 @@ export class EditableContentComponent
         );
 
         if (!this.field.isCtrlField) {
+            // Only data field tags get these.
             this.tagMenuEntries.push(
                 {label: this.insertAfterStr.text,  value: '_insertAfter'},
                 {label: this.insertBeforeStr.text, value: '_insertBefore'}
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
index 02c9b459cd..841ca075fe 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
@@ -70,12 +70,12 @@ export class MarcEditorComponent implements OnInit {
     // the record is successfully saved.
     @Output() recordSaved: EventEmitter<MarcSavedEvent>;
 
-    @ViewChild('sourceSelector', { static: true }) sourceSelector: ComboboxComponent;
-    @ViewChild('confirmDelete', { static: true }) confirmDelete: ConfirmDialogComponent;
-    @ViewChild('confirmUndelete', { static: true }) confirmUndelete: ConfirmDialogComponent;
-    @ViewChild('cannotDelete', { static: true }) cannotDelete: ConfirmDialogComponent;
-    @ViewChild('successMsg', { static: true }) successMsg: StringComponent;
-    @ViewChild('failMsg', { static: true }) failMsg: StringComponent;
+    @ViewChild('sourceSelector', {static: false}) sourceSelector: ComboboxComponent;
+    @ViewChild('confirmDelete', {static: false}) confirmDelete: ConfirmDialogComponent;
+    @ViewChild('confirmUndelete', {static: false}) confirmUndelete: ConfirmDialogComponent;
+    @ViewChild('cannotDelete', {static: false}) cannotDelete: ConfirmDialogComponent;
+    @ViewChild('successMsg', {static: false}) successMsg: StringComponent;
+    @ViewChild('failMsg', {static: false}) failMsg: StringComponent;
 
     constructor(
         private evt: EventService,
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.html b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.html
index 506fc56a4d..a7ca33f082 100644
--- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.html
+++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.html
@@ -100,8 +100,7 @@
     <!-- LEADER -->
     <div class="row pt-0 pb-0 pl-3">
       <eg-marc-editable-content
-        [context]="context" fieldType="tag"
-        fieldText="LDR" i18n-fieldText moreClasses="p-1">
+        [context]="context" fieldText="LDR" i18n-fieldText moreClasses="p-1">
       </eg-marc-editable-content>
 
       <eg-marc-editable-content
-- 
2.11.0