From fd8908f7dc7246c88ce0e2f9d444295a76c85263 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 6 Nov 2014 14:28:18 -0500 Subject: [PATCH] Job Submission cleanup removed some commented code from the fix for the job submission from yesterday --- awx/ui/static/js/controllers/Portal.js | 34 ++--------------------- awx/ui/static/js/helpers/JobSubmission.js | 1 - awx/ui/static/js/widgets/PortalJobs.js | 14 ---------- awx/ui/static/lib/ansible/AuthService.js | 1 - 4 files changed, 2 insertions(+), 48 deletions(-) diff --git a/awx/ui/static/js/controllers/Portal.js b/awx/ui/static/js/controllers/Portal.js index 0956cb09ed..d12f9e1c8f 100644 --- a/awx/ui/static/js/controllers/Portal.js +++ b/awx/ui/static/js/controllers/Portal.js @@ -119,41 +119,11 @@ function PortalController($scope, $compile, $routeParams, $rootScope, $location, $('.list-well:eq(1)').css('margin-top' , '0px'); }); - function processEvent(event) { - switch(event.status) { - case 'running': - jobs_scope.search('portal_job'); - // queued_scope.search('queued_job'); - break; - case 'new': - case 'pending': - jobs_scope.search('portal_job'); - break; - case 'waiting': - jobs_scope.search('portal_job'); - // completed_scope.search('completed_job'); - break; - case 'successful': - // // console.log('successful'); - // running_scope.search('running_job'); - // completed_scope.search('completed_job'); - // break; - case 'failed': - case 'error': - case 'canceled': - jobs_scope.search('portal_job'); - // running_scope.search('running_job'); - // queued_scope.search('queued_job'); - } - } - if ($rootScope.removeJobStatusChange) { $rootScope.removeJobStatusChange(); } - $rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange', function(e, event) { - // jobs_scope.search('portal_job'); - processEvent(event); - + $rootScope.removeJobStatusChange = $rootScope.$on('JobStatusChange', function() { + jobs_scope.search('portal_job'); //processEvent(event); }); $scope.submitJob = function (id) { diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index feb860a0b9..f2817a833e 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -53,7 +53,6 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential $('#password-modal').dialog('close'); } scope.$emit(callback, data); - // scope.$destroy(); }) .error(function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', diff --git a/awx/ui/static/js/widgets/PortalJobs.js b/awx/ui/static/js/widgets/PortalJobs.js index b70455b489..bc2c72e9f3 100644 --- a/awx/ui/static/js/widgets/PortalJobs.js +++ b/awx/ui/static/js/widgets/PortalJobs.js @@ -19,23 +19,11 @@ angular.module('PortalJobsWidget', ['RestServices', 'Utilities']) choicesCount = 0, listCount = 0, jobs_scope = scope.$new(true), - // completed_scope = scope.$new(true), - // running_scope = scope.$new(true), - // queued_scope = scope.$new(true), - // scheduled_scope = scope.$new(true), max_rows, html, e; html = ''; html += "
\n"; - // html+= "Job Templates "; - // html += "\n"; - // html += "
\n"; html += "
\n"; html += "\n"; //list html += "
\n"; //active-jobs-tab - // html += "
\n"; - // html += "
\n"; // jobs-list-container html += "
\n"; e = angular.element(document.getElementById(target)); diff --git a/awx/ui/static/lib/ansible/AuthService.js b/awx/ui/static/lib/ansible/AuthService.js index 2094df56fd..6da3ec3297 100644 --- a/awx/ui/static/lib/ansible/AuthService.js +++ b/awx/ui/static/lib/ansible/AuthService.js @@ -84,7 +84,6 @@ angular.module('AuthService', ['ngCookies', 'Utilities']) $rootScope.sessionExpired = false; $rootScope.token = null; $rootScope.token_expires = null; - $rootScope.login_username = null; $rootScope.login_password = null; },