Refactored job submission module, breaking the process of prompting for credentials and passwords into small, isolated units of work. Code can now be shared across each job type and unit tests are feasible.

This commit is contained in:
Chris Houseknecht
2014-03-27 14:21:47 -04:00
parent 62e860afc1
commit 29a8b46e2f
5 changed files with 271 additions and 321 deletions

View File

@@ -12,7 +12,7 @@
function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobTemplateList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors,
GetBasePath, PromptPasswords, JobTemplateForm, CredentialList, LookUpInit, SubmitJob, Wait, Stream) {
GetBasePath, JobTemplateForm, CredentialList, LookUpInit, PlaybookRun, Wait, Stream) {
ClearScope();
@@ -96,14 +96,14 @@ function JobTemplatesList($scope, $rootScope, $location, $log, $routeParams, Res
};
$scope.submitJob = function (id) {
SubmitJob({ scope: $scope, id: id });
PlaybookRun({ scope: $scope, id: id });
};
}
JobTemplatesList.$inject = ['$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobTemplateList',
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
'ProcessErrors', 'GetBasePath', 'PromptPasswords', 'JobTemplateForm', 'CredentialList', 'LookUpInit',
'SubmitJob', 'Wait', 'Stream'
'ProcessErrors', 'GetBasePath', 'JobTemplateForm', 'CredentialList', 'LookUpInit',
'PlaybookRun', 'Wait', 'Stream'
];
function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routeParams, JobTemplateForm,