LP1852782 FF context menu repairs; Angular fixes
authorBill Erickson <berickxx@gmail.com>
Thu, 12 Dec 2019 15:35:06 +0000 (10:35 -0500)
committerBill Erickson <berickxx@gmail.com>
Fri, 21 Feb 2020 16:44:38 +0000 (11:44 -0500)
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>
Open-ILS/src/eg2/src/app/staff/share/marc-edit/editable-content.component.ts
Open-ILS/src/eg2/src/app/staff/share/marc-edit/editor.component.ts
Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.html

index 312f7b1..2eeadf1 100644 (file)
@@ -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'}
index 02c9b45..841ca07 100644 (file)
@@ -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,
index 506fc56..a7ca33f 100644 (file)
     <!-- 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