mirror of
https://github.com/ansible/awx.git
synced 2026-02-25 15:06:02 -03:30
Fixed bug preventing users from selecting non-default inventory on job launch
This commit is contained in:
@@ -23,6 +23,7 @@ function ListTemplatesController(
|
|||||||
resolvedModels,
|
resolvedModels,
|
||||||
strings,
|
strings,
|
||||||
Wait,
|
Wait,
|
||||||
|
Empty
|
||||||
) {
|
) {
|
||||||
const vm = this || {};
|
const vm = this || {};
|
||||||
const [jobTemplate, workflowTemplate] = resolvedModels;
|
const [jobTemplate, workflowTemplate] = resolvedModels;
|
||||||
@@ -34,8 +35,8 @@ function ListTemplatesController(
|
|||||||
vm.templateTypes = mapChoices(choices);
|
vm.templateTypes = mapChoices(choices);
|
||||||
vm.activeId = parseInt($state.params.job_template_id || $state.params.workflow_template_id);
|
vm.activeId = parseInt($state.params.job_template_id || $state.params.workflow_template_id);
|
||||||
|
|
||||||
$scope.canAddJobTemplate = jobTemplate.options('actions.POST')
|
$scope.canAddJobTemplate = jobTemplate.options('actions.POST');
|
||||||
$scope.canAddWorkflowJobTemplate = workflowTemplate.options('actions.POST')
|
$scope.canAddWorkflowJobTemplate = workflowTemplate.options('actions.POST');
|
||||||
$scope.canAdd = ($scope.canAddJobTemplate || $scope.canAddWorkflowJobTemplate);
|
$scope.canAdd = ($scope.canAddJobTemplate || $scope.canAddWorkflowJobTemplate);
|
||||||
|
|
||||||
// smart-search
|
// smart-search
|
||||||
@@ -169,7 +170,7 @@ function ListTemplatesController(
|
|||||||
})
|
})
|
||||||
.catch(createErrorHandler('copy job template', 'POST'))
|
.catch(createErrorHandler('copy job template', 'POST'))
|
||||||
.finally(() => Wait('stop'));
|
.finally(() => Wait('stop'));
|
||||||
};
|
}
|
||||||
|
|
||||||
function copyWorkflowTemplate(template) {
|
function copyWorkflowTemplate(template) {
|
||||||
Wait('start');
|
Wait('start');
|
||||||
@@ -251,7 +252,7 @@ function ListTemplatesController(
|
|||||||
.request('delete', template.id)
|
.request('delete', template.id)
|
||||||
.then(() => handleSuccessfulDelete(template))
|
.then(() => handleSuccessfulDelete(template))
|
||||||
.catch(createErrorHandler('delete template', 'DELETE'))
|
.catch(createErrorHandler('delete template', 'DELETE'))
|
||||||
.finally(() => Wait('stop'))
|
.finally(() => Wait('stop'));
|
||||||
},
|
},
|
||||||
hdr: strings.get('DELETE'),
|
hdr: strings.get('DELETE'),
|
||||||
resourceName: $filter('sanitize')(template.name),
|
resourceName: $filter('sanitize')(template.name),
|
||||||
@@ -321,7 +322,7 @@ function ListTemplatesController(
|
|||||||
return selectedJobTemplate
|
return selectedJobTemplate
|
||||||
.postLaunch({ id: template.id })
|
.postLaunch({ id: template.id })
|
||||||
.then(({ data }) => {
|
.then(({ data }) => {
|
||||||
$state.go('jobResult', { id: data.job }, { reload: true })
|
$state.go('jobResult', { id: data.job }, { reload: true });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -378,7 +379,7 @@ function ListTemplatesController(
|
|||||||
jobLaunchData.verbosity = $scope.promptData.prompts.verbosity.value.value;
|
jobLaunchData.verbosity = $scope.promptData.prompts.verbosity.value.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($scope.promptData.launchConf.ask_inventory_on_launch && !_.isEmpty($scope.promptData.prompts.inventory.value.id)){
|
if ($scope.promptData.launchConf.ask_inventory_on_launch && !Empty($scope.promptData.prompts.inventory.value.id)){
|
||||||
jobLaunchData.inventory_id = $scope.promptData.prompts.inventory.value.id;
|
jobLaunchData.inventory_id = $scope.promptData.prompts.inventory.value.id;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -422,7 +423,7 @@ function ListTemplatesController(
|
|||||||
.then((launchRes) => {
|
.then((launchRes) => {
|
||||||
$state.go('jobResult', { id: launchRes.data.job }, { reload: true });
|
$state.go('jobResult', { id: launchRes.data.job }, { reload: true });
|
||||||
})
|
})
|
||||||
.catch(createErrorHandler('launch job template', 'POST'))
|
.catch(createErrorHandler('launch job template', 'POST'));
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -439,6 +440,7 @@ ListTemplatesController.$inject = [
|
|||||||
'resolvedModels',
|
'resolvedModels',
|
||||||
'TemplatesStrings',
|
'TemplatesStrings',
|
||||||
'Wait',
|
'Wait',
|
||||||
|
'Empty'
|
||||||
];
|
];
|
||||||
|
|
||||||
export default ListTemplatesController;
|
export default ListTemplatesController;
|
||||||
|
|||||||
Reference in New Issue
Block a user