LP#1929749: tweaks to LI note/alert interface
authorGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 17:57:45 +0000 (12:57 -0500)
committerGalen Charlton <gmc@equinoxOLI.org>
Sat, 5 Feb 2022 17:57:45 +0000 (12:57 -0500)
- Change the label from "Notes" to "Notes and Alerts" in the LI summary
- Visually split the notes and alerts form and add a separate field for
  alert comments. This makes no particular different to functionality, as
  LI notes and alerts feed into the same database table, but may make it
  easier for users to work with the interface.

Signed-off-by: Galen Charlton <gmc@equinoxOLI.org>
Open-ILS/src/eg2/src/app/staff/acq/lineitem/lineitem-list.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/notes.component.html
Open-ILS/src/eg2/src/app/staff/acq/lineitem/notes.component.ts

index 418dd3a..588b839 100644 (file)
               </ng-container>
             </a>
             <span class="ml-1 mr-1" i18n> | </span>
-            <a class="label-with-material-icon" title="Notes" i18n-title
+            <a class="label-with-material-icon" title="Notes and Alerts" i18n-title
               href="javascript:;" (click)="toggleShowNotes(li.id())">
               <span class="material-icons small mr-1">event_note</span>
-              <span i18n>Notes ({{li.lineitem_notes().length}})</span>
+              <span i18n>Notes and Alerts ({{li.lineitem_notes().length}})</span>
               <span *ngIf="liHasAlerts(li)" class="text-danger material-icons"
                 title="Has Alerts" i18n-title>flag</span>
             </a>
index 25f393c..c4b32c2 100644 (file)
       </label>
     </div>
     <button class="btn btn-sm btn-success ml-2" [disabled]="!noteText" 
-      (click)="newNote()" i18n>New Note</button>
+      (click)="newNote()" i18n>Create Note</button>
+    <div class="ml-3 mr-3">|</div>
+    <input type="text" class="form-control form-control-sm" id="note-text-input"
+      [(ngModel)]="alertComments" placeholder="Alert Comments" i18n-placeholder/>
     <span class="ml-2">
       <eg-combobox idlClass="acqliat" [(ngModel)]="alertEntry" 
         [asyncSupportsEmptyTermClick]="true">
       </eg-combobox>
     </span>
-    <button class="btn btn-sm btn-info ml-2" [disabled]="!alertEntry"
-      (click)="newNote(true)" i18n>New Alert</button>
+    <button class="btn btn-sm btn-success ml-2" [disabled]="!alertEntry" 
+      (click)="newNote(true)" i18n>Create Alert</button>
     <a class="ml-auto" href="javascript:;" (click)="close()" title="Close" i18n-title>
       <span class="material-icons text-danger">close</span>
     </a>
index 963470d..14f82e6 100644 (file)
@@ -14,6 +14,7 @@ export class LineitemNotesComponent implements OnInit, AfterViewInit {
 
     @Input() lineitem: IdlObject;
     noteText: string;
+    alertComments: string;
     vendorPublic = false;
     alertEntry: ComboboxEntry;
 
@@ -46,10 +47,11 @@ export class LineitemNotesComponent implements OnInit, AfterViewInit {
         const note = this.idl.create('acqlin');
         note.isnew(true);
         note.lineitem(this.lineitem.id());
-        note.value(this.noteText || '');
         if (isAlert) {
+            note.value(this.alertComments || '');
             note.alert_text(this.alertEntry.id);
         } else {
+            note.value(this.noteText || '');
             note.vendor_public(this.vendorPublic ? 't' : 'f');
         }