From c11d22ac706d5402ffb06b77807976f484adb9fd Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Thu, 18 Apr 2019 17:37:09 -0400 Subject: [PATCH] server template : angular admin ui Signed-off-by: Bill Erickson --- .../staff/admin/server/print-template.component.html | 18 +++++++++++------- .../app/staff/admin/server/print-template.component.ts | 11 +++++++++++ 2 files changed, 22 insertions(+), 7 deletions(-) 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 c061cc7346..32cba625a0 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 @@ -3,6 +3,11 @@ + + + +
@@ -40,16 +45,15 @@
- - - -
-
- +
diff --git a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.ts b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.ts index c692f6e7e0..13b89964a2 100644 --- a/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/admin/server/print-template.component.ts @@ -9,6 +9,7 @@ import {ComboboxComponent, ComboboxEntry import {PrintService} from '@eg/share/print/print.service'; import {LocaleService} from '@eg/core/locale.service'; import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap'; +import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; const SAMPLE_JSON_DATA: any = { patron: { @@ -52,6 +53,7 @@ export class PrintTemplateComponent implements OnInit { @ViewChild('templateSelector') templateSelector: ComboboxComponent; @ViewChild('tabs') tabs: NgbTabset; + @ViewChild('editDialog') editDialog: FmRecordEditorComponent; // Define some sample data that can be used for various templates @@ -128,6 +130,7 @@ export class PrintTemplateComponent implements OnInit { const data = SAMPLE_TEMPLATE_DATA[t.name()]; if (data) { this.sampleJson = JSON.stringify(data, null, 2); + this.refreshPreview(); } }); } @@ -166,6 +169,14 @@ export class PrintTemplateComponent implements OnInit { this.pcrud.update(this.template).toPromise() .then(() =>this.refreshPreview()); } + + openEditDialog() { + // TODO: PENDING EXTERNAL FIXES + //this.editDialog.record = this.template; + this.editDialog.recordId = this.template.id(); + this.editDialog.mode = 'update'; + this.editDialog.open({size: 'lg'}); + } } -- 2.11.0