mirror of
https://github.com/ansible/awx.git
synced 2026-01-13 11:00:03 -03:30
fix undefined function
This commit is contained in:
parent
3c0c5b89b6
commit
1afeed3588
@ -342,22 +342,7 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
||||
parent_scope: $scope
|
||||
});
|
||||
|
||||
if ($routeParams.inventory_id) {
|
||||
// This means that the job template form was accessed via inventory prop's
|
||||
// This also means the job is a scan job.
|
||||
$scope.job_type.value = 'scan';
|
||||
$scope.jobTypeChange();
|
||||
$scope.inventory = $routeParams.inventory_id;
|
||||
Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/');
|
||||
Rest.get()
|
||||
.success(function (data) {
|
||||
$scope.inventory_name = data.name;
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to lookup inventory: ' + data.id + '. GET returned status: ' + status });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// Update playbook select whenever project value changes
|
||||
selectPlaybook = function (oldValue, newValue) {
|
||||
@ -415,6 +400,23 @@ export function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $
|
||||
}
|
||||
};
|
||||
|
||||
if ($routeParams.inventory_id) {
|
||||
// This means that the job template form was accessed via inventory prop's
|
||||
// This also means the job is a scan job.
|
||||
$scope.job_type.value = 'scan';
|
||||
$scope.jobTypeChange();
|
||||
$scope.inventory = $routeParams.inventory_id;
|
||||
Rest.setUrl(GetBasePath('inventory') + $routeParams.inventory_id + '/');
|
||||
Rest.get()
|
||||
.success(function (data) {
|
||||
$scope.inventory_name = data.name;
|
||||
})
|
||||
.error(function (data, status) {
|
||||
ProcessErrors($scope, data, status, form, { hdr: 'Error!',
|
||||
msg: 'Failed to lookup inventory: ' + data.id + '. GET returned status: ' + status });
|
||||
});
|
||||
}
|
||||
|
||||
// Detect and alert user to potential SCM status issues
|
||||
checkSCMStatus = function (oldValue, newValue) {
|
||||
if (oldValue !== newValue && !Empty($scope.project)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user