1 <eg-string #successMsg text="Successfully Modified Item Alerts" i18n-text></eg-string>
2 <eg-string #errorMsg text="Failed To Modify Item Alerts" i18n-text></eg-string>
4 <ng-template #dialogContent>
5 <div class="modal-header">
6 <h4 class="modal-title">
7 <ng-container *ngIf="mode === 'create'">
8 <span i18n>Adding alerts for {{copyIds.length}} item(s).</span>
10 <ng-container *ngIf="mode === 'manage'">
11 <span *ngIf="!inBatch()" i18n>Managing alerts for item {{copies.length ? copies[0].barcode() : ''}}</span>
12 <span *ngIf="inBatch()" i18n>Managing alerts in common for {{copyIds.length}} item(s).</span>
16 <button type="button" class="btn-close btn-close-white"
17 i18n-aria-label aria-label="Close" (click)="close()"></button>
19 <div class="modal-body p-4 form-validated">
20 <div class="row mt-2 p-2 rounded border border-success">
21 <div class="col-lg-4">
22 <eg-combobox [entries]="alertTypes"
23 i18n-placeholder placeholder="Select Alert Type..."
24 domId="item-alert-type"
25 [selectedId]="newAlert.alert_type() || defaultAlertType"
27 (onChange)="newAlert.alert_type($event ? $event.id : null)">
30 <div class="col-lg-5">
31 <textarea class="form-control" rows="2"
32 i18n-placeholder placeholder="New Alert Note..."
33 (ngModelChange)="newAlert.note($event)" [ngModel]="newAlert.note()">
36 <div class="col-lg-3">
37 <div class="d-flex flex-column">
38 <div class="form-check">
39 <input class="form-check-input" type="checkbox"
40 [ngModel]="newAlert.temp() === 't'"
41 (ngModelChange)="newAlert.temp($event ? 't' : 'f')"
42 id="new-alert-temporary">
43 <label class="form-label form-check-label" for="new-alert-temporary" i18n>
48 <button type="button" class="btn btn-success" (click)="addNew()" i18n>
55 <h4 class="mt-2" i18n *ngIf="newAlerts.length > 0">Pending New Alerts</h4>
56 <div class="row mt-2" *ngFor="let alert of newAlerts">
57 <div class="col-lg-4">{{getAlertTypeLabel(alert)}}</div>
58 <div class="col-lg-5">{{alert.note()}}</div>
59 <div class="col-lg-3">
60 <button type="button" class="btn btn-outline-danger" (click)="removeAlert(alert)" i18n>
66 <ng-container *ngIf="mode === 'manage'">
67 <!-- eventually we'll always be in 'manage' mode -->
68 <!-- if not in batch, list all the pertinent alerts linked to the copy -->
69 <!-- if in batch, use the alertsInCommon variable instead for some proxy alerts -->
71 *ngFor="let alert of inBatch() ? alertsInCommon : (copies.length ? copies[0].copy_alerts() : [])">
72 <div class="col-lg-12 pb-2"><hr/></div>
73 <div class="col-lg-4">
74 <eg-combobox [entries]="alertTypes" [selectedId]="alert.alert_type()"
75 i18n-placeholder placeholder="Alert Type..."
77 (onChange)="alert.alert_type($event ? $event.id : null); alert.ischanged(true)">
79 <div *ngIf="!inBatch()" class="ps-2 pt-2" i18n>
80 Added: {{alert.create_time() | date:'shortDate'}}
83 <div class="col-lg-5">
84 <textarea class="form-control" rows="2"
85 i18n-placeholder placeholder="Alert Note..."
86 (ngModelChange)="alert.note($event); alert.ischanged(true)"
87 [ngModel]="alert.note()">
90 <div class="col-lg-3">
91 <div class="d-flex flex-column">
92 <div class="form-check">
93 <input class="form-check-input" type="checkbox"
94 [ngModel]="alert.temp() === 't'"
95 (ngModelChange)="alert.temp($event ? 't' : 'f'); alert.ischanged(true)"
96 id="alert-temporary-{{alert.id()}}">
97 <label class="form-label form-check-label" for="alert-temporary-{{alert.id()}}" i18n>
101 <div class="form-check pt-2">
102 <input class="form-check-input" type="checkbox"
103 [ngModel]="alert.ack_time() !== null"
104 (ngModelChange)="alert.ack_time($event ? 'now' : null); alert.ischanged(true)"
105 id="alert-temporary-{{alert.id()}}">
106 <label class="form-label form-check-label" for="alert-temporary-{{alert.id()}}" i18n>
115 <div class="modal-footer">
116 <button type="button" class="btn btn-secondary"
117 (click)="close()" i18n>Close</button>
118 <button type="button" class="btn btn-success me-2"
119 (click)="applyChanges()" i18n>Apply Changes</button>