LP#1708291: tweak to subscription selector
authorGalen Charlton <gmc@equinoxinitiative.org>
Tue, 29 Aug 2017 20:11:13 +0000 (16:11 -0400)
committerDan Wells <dbw2@calvin.edu>
Fri, 1 Sep 2017 16:47:54 +0000 (12:47 -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>
Signed-off-by: Dan Wells <dbw2@calvin.edu>
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;
+            }
         });
     }
 }]