From f9fd5df8f4f83e043792c7934c249fbc4ef0d0a0 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Wed, 11 Dec 2019 14:48:40 -0500 Subject: [PATCH] LP1852782 MARC editor subfield stacking support Signed-off-by: Bill Erickson Signed-off-by: Jane Sandberg --- .../share/marc-edit/editable-content.component.ts | 5 + .../share/marc-edit/rich-editor.component.html | 101 +++++++++++++-------- .../staff/share/marc-edit/rich-editor.component.ts | 14 +++ 3 files changed, 83 insertions(+), 37 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 f1afe30922..03acd76b18 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 @@ -177,6 +177,11 @@ export class EditableContentComponent this.watchForFocusRequests(); this.watchForUndoRedoRequests(); break; + + default: + if (this.fieldText) { + this.maxLength = this.fieldText.length; + } } } 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 16d164933d..506fc56a4d 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 @@ -7,6 +7,32 @@ + + + + + + + + + + + + + + + + + + +
@@ -33,7 +59,7 @@
-
+
@@ -85,7 +111,7 @@
-
-
- - - - - - - - - - - - + - - +
- - + + - + + [context]="context" [field]="field" fieldType="ind1" + ariaLabel="Data Field Indicator 1" i18n-ariaLabel moreClasses="p-1"> - + + [context]="context" [field]="field" fieldType="ind2" + ariaLabel="Data Field Indicator 2" i18n-ariaLabel moreClasses="p-1"> + + + + + + + + +
+ + + +
+ + + + +
-
+ +
diff --git a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts index 337756a79f..6b79fe2415 100644 --- a/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/share/marc-edit/rich-editor.component.ts @@ -3,6 +3,7 @@ import {Component, Input, Output, OnInit, AfterViewInit, EventEmitter, import {filter} from 'rxjs/operators'; import {IdlService} from '@eg/core/idl.service'; import {OrgService} from '@eg/core/org.service'; +import {ServerStoreService} from '@eg/core/server-store.service'; import {TagTableService} from './tagtable.service'; import {MarcRecord, MarcField} from './marcrecord'; import {MarcEditContext} from './editor-context'; @@ -31,10 +32,15 @@ export class MarcRichEditorComponent implements OnInit { constructor( private idl: IdlService, private org: OrgService, + private store: ServerStoreService, private tagTable: TagTableService ) {} ngOnInit() { + + this.store.getItem('cat.marcedit.stack_subfields') + .then(stack => this.stackSubfields = stack); + this.init().then(_ => this.context.recordChange.subscribe(__ => this.init())); @@ -62,6 +68,14 @@ export class MarcRichEditorComponent implements OnInit { ); } + stackSubfieldsChange() { + if (this.stackSubfields) { + this.store.setItem('cat.marcedit.stack_subfields', true); + } else { + this.store.removeItem('cat.marcedit.stack_subfields'); + } + } + undoCount(): number { return this.context.undoStack.length; } -- 2.11.0