// Globally available components
import {PrintComponent} from '@eg/share/print/print.component';
import {DialogComponent} from '@eg/share/dialog/dialog.component';
+import {AlertDialogComponent} from '@eg/share/dialog/alert.component';
import {ConfirmDialogComponent} from '@eg/share/dialog/confirm.component';
import {PromptDialogComponent} from '@eg/share/dialog/prompt.component';
import {ProgressInlineComponent} from '@eg/share/dialog/progress-inline.component';
declarations: [
PrintComponent,
DialogComponent,
+ AlertDialogComponent,
ConfirmDialogComponent,
PromptDialogComponent,
ProgressInlineComponent,
FormsModule,
PrintComponent,
DialogComponent,
+ AlertDialogComponent,
ConfirmDialogComponent,
PromptDialogComponent,
ProgressInlineComponent,
--- /dev/null
+<ng-template #dialogContent>
+ <div class="modal-body">
+ <div class="alert alert-danger">{{dialogBody}}</div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" class="btn btn-success"
+ (click)="close()" i18n>OK</button>
+ </div>
+</ng-template>
--- /dev/null
+import {Component, Input, ViewChild, TemplateRef} from '@angular/core';
+import {DialogComponent} from '@eg/share/dialog/dialog.component';
+
+@Component({
+ selector: 'eg-alert-dialog',
+ templateUrl: './alert.component.html'
+})
+
+/**
+ * Alertation dialog that requests user input.
+ */
+export class AlertDialogComponent extends DialogComponent {
+
+ // What are we warning the user with?
+ @Input() public dialogBody: string;
+}
+
+
// Extract selected queue ID or create a new queue when requested.
resolveQueue(): Promise<number> {
+ if (this.selectedQueue.freetext) {
+ /*
if (this.selectedQueue && this.selectedQueue.freetext) {
+ */
// Free text queue selector means create a new entry.
// TODO: first check for name dupes
);
} else {
+ return Promise.resolve(this.selectedQueue.id);
+ /*
var queue_id = this.startQueueId;
if (this.selectedQueue) queue_id = this.selectedQueue.id;
return Promise.resolve(queue_id);
+ */
}
}