mirror of
https://github.com/ansible/awx.git
synced 2026-03-27 05:45:02 -02:30
Merge pull request #5232 from ryanpetrello/fix-5194
only loop over project OPTIONS response if the response is valid
This commit is contained in:
@@ -51,24 +51,26 @@ export function ProjectsList($scope, $rootScope, $location, $log, $stateParams,
|
|||||||
// 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(){
|
||||||
$scope[list.name].forEach(function(item, item_idx) {
|
if ($scope[list.name] !== undefined) {
|
||||||
var itm = $scope[list.name][item_idx];
|
$scope[list.name].forEach(function(item, item_idx) {
|
||||||
|
var itm = $scope[list.name][item_idx];
|
||||||
|
|
||||||
// Set the item type label
|
// Set the item type label
|
||||||
if (list.fields.scm_type && $scope.options &&
|
if (list.fields.scm_type && $scope.options &&
|
||||||
$scope.options.hasOwnProperty('scm_type')) {
|
$scope.options.hasOwnProperty('scm_type')) {
|
||||||
$scope.options.scm_type.choices.every(function(choice) {
|
$scope.options.scm_type.choices.every(function(choice) {
|
||||||
if (choice[0] === item.scm_type) {
|
if (choice[0] === item.scm_type) {
|
||||||
itm.type_label = choice[1];
|
itm.type_label = choice[1];
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
buildTooltips(itm);
|
buildTooltips(itm);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function buildTooltips(project) {
|
function buildTooltips(project) {
|
||||||
|
|||||||
Reference in New Issue
Block a user