From: Jane Sandberg Date: Wed, 19 Dec 2018 23:51:25 +0000 (-0800) Subject: LP1809183: Allow passing template to eg-confirm-dialog X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=b9c3bc3b3febd02f2ba1af36dcbb0219e52fff0c;p=contrib%2FConifer.git LP1809183: Allow passing template to eg-confirm-dialog Adds an input called dialogBodyTemplate to . This can be useful when you want to pass ICU messages to (e.g. "Are you sure you want to cancel these 3 holds?" vs. "Are you sure you want to cancel this hold?"). If both dialogBody and dialogBodyTemplate are defined, it will show the dialogBodyTemplate message. Also adds a sandbox example. Signed-off-by: Jane Sandberg Signed-off-by: Bill Erickson --- diff --git a/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.html b/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.html index 3db73cc8e0..05cf562123 100644 --- a/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.html +++ b/Open-ILS/src/eg2/src/app/share/dialog/confirm.component.html @@ -6,7 +6,14 @@ - + + + + + + + + + + Are you sure you want to confirm {numThings, plural, =1 {this thing} other {these {{numThings}} things}}? + diff --git a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts index 52931a04e4..d2d4ead1d9 100644 --- a/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts +++ b/Open-ILS/src/eg2/src/app/staff/sandbox/sandbox.component.ts @@ -16,6 +16,7 @@ import {ComboboxEntry} from '@eg/share/combobox/combobox.component'; import {FormatService} from '@eg/core/format.service'; import {FmRecordEditorComponent} from '@eg/share/fm-editor/fm-editor.component'; import {FormGroup, FormControl} from '@angular/forms'; +import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component'; @Component({ templateUrl: 'sandbox.component.html' @@ -34,6 +35,11 @@ export class SandboxComponent implements OnInit { @ViewChild('fmRecordEditor') private fmRecordEditor: FmRecordEditorComponent; + @ViewChild('numConfirmDialog') + private numConfirmDialog: ConfirmDialogComponent; + + public numThings = 0; + // @ViewChild('helloStr') private helloStr: StringComponent; gridDataSource: GridDataSource = new GridDataSource(); @@ -265,6 +271,13 @@ export class SandboxComponent implements OnInit { .then(txt => this.toast.success(txt)); }, 4000); } + + confirmNumber(num: number): void { + this.numThings = num; + console.log(this.numThings); + this.numConfirmDialog.open(); + } + }