LP#1676608: add some sorting to copy alert dialogs
authorGalen Charlton <gmc@equinoxinitiative.org>
Wed, 7 Feb 2018 21:41:55 +0000 (16:41 -0500)
committerMike Rylander <mrylander@gmail.com>
Wed, 28 Feb 2018 15:26:42 +0000 (10:26 -0500)
Copy alert types in drop-downs are now sorted by name
and copy alerts themselves are now consistently sorted
by ID (which will have the affected of putting the most
recent alert at the bottom in the copy alert manager dialog).

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/src/templates/staff/admin/local/autoGridEditor/acas.tt2
Open-ILS/src/templates/staff/cat/volcopy/t_copy_alerts.tt2
Open-ILS/src/templates/staff/share/t_add_copy_alert_dialog.tt2
Open-ILS/src/templates/staff/share/t_copy_alert_editor_dialog.tt2

index eab1609..7733249 100644 (file)
@@ -13,7 +13,7 @@
         <label for="copy-alert-type-selector">[% l('Alert Type') %]</label>
         <select id="copy-alert-type-selector" class="form-control"
           ng-model="record.alert_type"
-          ng-options="at.id() as at.name() for at in ccat">
+          ng-options="at.id() as at.name() for at in ccat | orderBy:'name()'">
         </select>
       </div>
       <div class="form-group">
index b86fef3..3095d51 100644 (file)
@@ -10,7 +10,7 @@
           <label for="copy-alert-type-selector"> [% l('Type') %]</label>
           <select id="copy-alert-type-selector" class="form-control"
             ng-model="copy_alert.alert_type"
-            ng-options="at.id() as at.name() for at in alert_types">
+            ng-options="at.id() as at.name() for at in alert_types | orderBy:'name()'">
           </select>
         </div>
         <div class="col-md-3">
@@ -51,7 +51,7 @@
         </div>
       </div>
 
-      <div class="row" ng-repeat="a in copy_alert_list" ng-init="temp = (a.temp() == 't'); note = a.note(); acked = (a.ack_time() !== null); alert_type = a.alert_type().id()">
+      <div class="row" ng-repeat="a in copy_alert_list | orderBy:'id()'" ng-init="temp = (a.temp() == 't'); note = a.note(); acked = (a.ack_time() !== null); alert_type = a.alert_type().id()">
         <div class="col-md-12">
           <div class="row">
             <div class="col-md-6 form-inline">
@@ -59,7 +59,7 @@
               <select id="copy-alert-type-select-{{a.id()}}" class="form-control"
                       ng-model="alert_type"
                       ng-change="a.alert_type(alert_type) && a.ischanged(1)"
-                      ng-options="at.id() as at.name() for at in alert_types">
+                      ng-options="at.id() as at.name() for at in alert_types | orderBy:'name()'">
               </select>
             </div>
             <div class="col-md-3">
index 0b97a3f..48b556d 100644 (file)
@@ -10,7 +10,7 @@
           <label for="copy-alert-type-selector"> [% l('Type') %]</label>
           <select id="copy-alert-type-selector" class="form-control"
             ng-model="copy_alert.alert_type"
-            ng-options="at.id() as at.name() for at in alert_types">
+            ng-options="at.id() as at.name() for at in alert_types | orderBy:'name()'">
           </select>
         </div>
         <div class="col-md-3">
index aad1a6b..9e12317 100644 (file)
@@ -5,7 +5,7 @@
       <h4 class="modal-title">[% l('Manage Copy Alerts') %]</h4>
     </div>
     <div class="modal-body">
-      <div class="row" ng-repeat="a in copy_alert_list" ng-init="temp = (a.temp() == 't'); note = a.note(); acked = (a.ack_time() !== null); alert_type = a.alert_type().id()">
+      <div class="row" ng-repeat="a in copy_alert_list | orderBy:'id()'" ng-init="temp = (a.temp() == 't'); note = a.note(); acked = (a.ack_time() !== null); alert_type = a.alert_type().id()">
         <div class="col-md-12">
           <div class="row">
             <div class="col-md-6 form-inline">
@@ -13,7 +13,7 @@
               <select id="copy-alert-type-select-{{a.id()}}" class="form-control"
                       ng-model="alert_type"
                       ng-change="a.alert_type(alert_type) && a.ischanged(1)"
-                      ng-options="at.id() as at.name() for at in alert_types">
+                      ng-options="at.id() as at.name() for at in alert_types | orderBy:'name()'">
               </select>
             </div>
             <div class="col-md-3">