LP#1626157 Prompt dialog
authorBill Erickson <berickxx@gmail.com>
Fri, 6 Apr 2018 21:04:36 +0000 (21:04 +0000)
committerBill Erickson <berickxx@gmail.com>
Fri, 6 Apr 2018 21:04:36 +0000 (21:04 +0000)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
Open-ILS/src/eg2/src/app/share/dialog/prompt.component.html [new file with mode: 0644]
Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts [new file with mode: 0644]
Open-ILS/src/eg2/src/app/staff/common.module.ts

diff --git a/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.html b/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.html
new file mode 100644 (file)
index 0000000..1d7936b
--- /dev/null
@@ -0,0 +1,22 @@
+<ng-template #dialogContent>
+  <div class="modal-header bg-info">
+    <h4 class="modal-title">{{dialogTitle}}</h4>
+    <button type="button" class="close" 
+      i18n-aria-label aria-label="Close" 
+      (click)="dismiss('cross_click')">
+      <span aria-hidden="true">&times;</span>
+    </button>
+  </div>
+  <div class="modal-body">
+    <p>{{dialogBody}}</p>
+    <div class="text-center">
+        <input class="form-control" [(ngModel)]="promptValue"/>
+    </div>
+  </div>
+  <div class="modal-footer">
+    <button type="button" class="btn btn-success" 
+      (click)="close(promptValue)" i18n>Confirm</button>
+    <button type="button" class="btn btn-warning" 
+      (click)="dismiss('canceled')" i18n>Cancel</button>
+  </div>
+</ng-template>
diff --git a/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts b/Open-ILS/src/eg2/src/app/share/dialog/prompt.component.ts
new file mode 100644 (file)
index 0000000..abf96ec
--- /dev/null
@@ -0,0 +1,19 @@
+import {Component, Input, ViewChild, TemplateRef} from '@angular/core';
+import {EgDialogComponent} from '@eg/share/dialog/dialog.component';
+
+@Component({
+  selector: 'eg-prompt-dialog',
+  templateUrl: './prompt.component.html'
+})
+
+/**
+ * Promptation dialog that asks a yes/no question.
+ */
+export class EgPromptDialogComponent extends EgDialogComponent {
+    // What question are we asking?
+    @Input() public dialogBody: string;
+    // Value to return to the caller
+    @Input() public promptValue: string;
+}
+
+
index e49e710..f44f97d 100644 (file)
@@ -4,6 +4,7 @@ import {EgStaffBannerComponent} from './share/staff-banner.component';
 import {EgOrgSelectComponent} from '@eg/share/org-select.component';
 import {EgDialogComponent} from '@eg/share/dialog/dialog.component';
 import {EgConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
+import {EgPromptDialogComponent} from '@eg/share/dialog/prompt.component';
 
 /**
  * Imports the EG common modules and adds modules common to all staff UI's.
@@ -14,7 +15,8 @@ import {EgConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
     EgStaffBannerComponent,
     EgOrgSelectComponent,
     EgDialogComponent,
-    EgConfirmDialogComponent
+    EgConfirmDialogComponent,
+    EgPromptDialogComponent
   ],
   imports: [
     EgCommonModule
@@ -24,7 +26,8 @@ import {EgConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
     EgStaffBannerComponent,
     EgOrgSelectComponent,
     EgDialogComponent,
-    EgConfirmDialogComponent
+    EgConfirmDialogComponent,
+    EgPromptDialogComponent
   ]
 })