mirror of
https://github.com/ansible/awx.git
synced 2026-03-02 09:18:48 -03:30
don't be looping if there ain't nothing to loop on
This commit is contained in:
@@ -38,16 +38,18 @@ export function CredentialsList($scope, $rootScope, $location, $log,
|
|||||||
|
|
||||||
$scope.$on(`${list.iterator}_options`, function(event, data){
|
$scope.$on(`${list.iterator}_options`, function(event, data){
|
||||||
$scope.options = data.data.actions.GET;
|
$scope.options = data.data.actions.GET;
|
||||||
|
console.log($scope.options);
|
||||||
optionsRequestDataProcessing();
|
optionsRequestDataProcessing();
|
||||||
});
|
});
|
||||||
|
|
||||||
$scope.$watchCollection(`${$scope.list.name}`, function() {
|
$scope.$watchCollection(`${$scope.list.name}`, function() {
|
||||||
optionsRequestDataProcessing();
|
optionsRequestDataProcessing();
|
||||||
}
|
});
|
||||||
);
|
|
||||||
// iterate over the list and add fields like type label, after the
|
// iterate over the list and add fields like type label, after the
|
||||||
// OPTIONS request returns, or the list is sorted/paginated/searched
|
// OPTIONS request returns, or the list is sorted/paginated/searched
|
||||||
function optionsRequestDataProcessing(){
|
function optionsRequestDataProcessing(){
|
||||||
|
if ($scope[list.name] !== undefined) {
|
||||||
$scope[list.name].forEach(function(item, item_idx) {
|
$scope[list.name].forEach(function(item, item_idx) {
|
||||||
var itm = $scope[list.name][item_idx];
|
var itm = $scope[list.name][item_idx];
|
||||||
|
|
||||||
@@ -64,6 +66,7 @@ export function CredentialsList($scope, $rootScope, $location, $log,
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$scope.addCredential = function() {
|
$scope.addCredential = function() {
|
||||||
$state.go('credentials.add');
|
$state.go('credentials.add');
|
||||||
|
|||||||
Reference in New Issue
Block a user