LP#1708291: tweak to subscription selector user/kmlussier/lp1708291-webstaff-serials-signoff
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 29 Aug 2017 20:11:13 +0000 (16:11 -0400)
committerKathy Lussier <klussier@masslnc.org>
Wed, 30 Aug 2017 18:57:28 +0000 (14:57 -0400)
When entering the Manage Predictions or Manage Issues tab
and only one subscription is present in the current OU
scope, automatically select it rather than making the operator
have to select it manually.

Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Kathy Lussier <klussier@masslnc.org>
Open-ILS/web/js/ui/default/staff/serials/directives/sub_selector.js

index 7556046..2918e78 100644 (file)
@@ -24,6 +24,9 @@ function($scope , $q , egSerialsCoreSvc , egCore , egGridDataProvider ,
     function reload() {
         egSerialsCoreSvc.fetch($scope.bibId, $scope.selected_owning_ou).then(function() {
             $scope.subscriptions = egCore.idl.toTypedHash(egSerialsCoreSvc.subTree);
+            if ($scope.subscriptions.length == 1 && !$scope.ssubId) {
+                $scope.ssubId = $scope.subscriptions[0].id;
+            }
         });
     }
 }]