From 4b49882c16fb12f0618b0cede1e630182c731526 Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 1 Aug 2019 16:36:31 -0400 Subject: [PATCH] LP1825851 Print template admin misc. repairs/improvements 1. When cloning a template, be sure the cloned template is available in the template selector regardless of whether it would have been given the current filters. 2. When cloning, set the 'active' flag explicitly to false so the user is forced to manually activate. This prevent unintentional activation on in-process templtes. 3. When cloning, clear the owner value so the user is forced to select an owner value. 4. Allow the template editor textaread to expand vertically as the template gets longer (i.e. adds more new lines). Signed-off-by: Bill Erickson --- .../src/app/share/combobox/combobox.component.ts | 6 ++- .../admin/server/print-template.component.html | 2 +- .../staff/admin/server/print-template.component.ts | 48 ++++++++++++++++++---- 3 files changed, 45 insertions(+), 11 deletions(-) diff --git a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts index 67d73e9cf5..2664112c78 100644 --- a/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts +++ b/Open-ILS/src/eg2/src/app/share/combobox/combobox.component.ts @@ -3,7 +3,7 @@ * * */ -import {Component, OnInit, Input, Output, ViewChild, +import {Component, OnInit, Input, Output, ViewChild, TemplateRef, EventEmitter, ElementRef, forwardRef} from '@angular/core'; import {ControlValueAccessor, NG_VALUE_ACCESSOR} from '@angular/forms'; import {Observable, of, Subject} from 'rxjs'; @@ -210,6 +210,10 @@ export class ComboboxComponent implements ControlValueAccessor, OnInit { } } + hasEntry(entryId: any): boolean { + return this.entrylist.filter(e => e.id === entryId)[0] !== undefined; + } + onBlur() { // When the selected value is a string it means we have either // no value (user cleared the input) or a free-text value. diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html index 585a7afab4..1293bc1597 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.html @@ -81,7 +81,7 @@ (Inactive) -