From 67b9a3023f7aee6a8640d7c253fe2bf5670cec7e Mon Sep 17 00:00:00 2001 From: Bill Erickson Date: Fri, 12 Jul 2019 14:51:39 -0400 Subject: [PATCH] LP1825851 server print additions WIP Signed-off-by: Bill Erickson --- .../src/app/staff/admin/server/print-template.component.html | 5 +++++ .../src/app/staff/admin/server/print-template.component.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 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 da685c9dbe..585a7afab4 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 @@ -7,6 +7,11 @@ [preloadLinkedValues]="true" hiddenFields="template"> + +
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 77630225a4..f5f793660c 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 @@ -14,6 +14,7 @@ import {NgbTabset, NgbTabChangeEvent} from '@ng-bootstrap/ng-bootstrap'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; import {SampleDataService} from '@eg/share/util/sample-data.service'; import {OrgFamily} from '@eg/share/org-family-select/org-family-select.component'; +import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; /** * Print Template Admin Page @@ -39,6 +40,7 @@ export class PrintTemplateComponent implements OnInit { @ViewChild('templateSelector') templateSelector: ComboboxComponent; @ViewChild('tabs') tabs: NgbTabset; @ViewChild('editDialog') editDialog: FmRecordEditorComponent; + @ViewChild('confirmDelete') confirmDelete: ConfirmDialogComponent; // Define some sample data that can be used for various templates // Data will be filled out via the sample data service. @@ -249,9 +251,12 @@ export class PrintTemplateComponent implements OnInit { } deleteTemplate() { - this.pcrud.remove(this.template).toPromise().then(_ => { - this.setTemplateInfo().toPromise() - .then(_ => this.selectTemplate(null)); + this.confirmDelete.open().subscribe(confirmed => { + if (!confirmed) { return; } + this.pcrud.remove(this.template).toPromise().then(_ => { + this.setTemplateInfo().toPromise() + .then(_ => this.selectTemplate(null)); + }); }); } } -- 2.11.0