diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index c2f5da7214..4bdbbfe7bd 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -50,15 +50,11 @@ import adhoc from './adhoc/main'; import login from './login/main'; import activityStream from './activity-stream/main'; import standardOut from './standard-out/main'; -import lookUpHelper from './lookup/main'; import JobTemplates from './job-templates/main'; import search from './search/main'; -import {ScheduleEditController} from './controllers/Schedules'; import {ProjectsList, ProjectsAdd, ProjectsEdit} from './controllers/Projects'; import OrganizationsList from './organizations/list/organizations-list.controller'; import OrganizationsAdd from './organizations/add/organizations-add.controller'; -import OrganizationsEdit from './organizations/edit/organizations-edit.controller'; -import {InventoriesAdd, InventoriesEdit, InventoriesList, InventoriesManage} from './inventories/main'; import {AdminsList} from './controllers/Admins'; import {UsersList, UsersAdd, UsersEdit} from './controllers/Users'; import {TeamsList, TeamsAdd, TeamsEdit} from './controllers/Teams'; @@ -199,7 +195,7 @@ var tower = angular.module('Tower', [ 'pendolytics', 'ui.router', 'ncy-angular-breadcrumb', - 'scheduler', + scheduler.name, 'ApiModelHelper', 'ActivityStreamHelper', 'dndLists' @@ -917,7 +913,7 @@ var tower = angular.module('Tower', [ activateTab(); }); - $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState, fromParams) { + $rootScope.$on('$stateChangeSuccess', function(event, toState, toParams, fromState) { // catch license expiration notifications immediately after user logs in, redirect if (fromState.name === 'signIn'){ CheckLicense.notify(); diff --git a/awx/ui/client/src/job-detail/host-event/host-event.route.js b/awx/ui/client/src/job-detail/host-event/host-event.route.js index 8b0a8e635e..d435b00f90 100644 --- a/awx/ui/client/src/job-detail/host-event/host-event.route.js +++ b/awx/ui/client/src/job-detail/host-event/host-event.route.js @@ -15,17 +15,14 @@ var hostEventModal = { features: ['FeaturesService', function(FeaturesService){ return FeaturesService.get(); }], - event: ['JobDetailService','$stateParams', 'moment', function(JobDetailService, $stateParams, moment) { - return JobDetailService.getRelatedJobEvents($stateParams.id, { - id: $stateParams.eventId, - }).then(function(res){ - res.data.results[0].created = moment(res.data.results[0].created).format('MMMM Do YYYY, h:mm:ss a'); - return res.data.results[0]; - }); + event: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) { + return JobDetailService.getRelatedJobEvents($stateParams.id, { + id: $stateParams.eventId + }).success(function(res){ return res.results[0];}); }] }, - onExit: function($state){ - // close the modal + onExit: function(){ + // close the modal // using an onExit event to handle cases where the user navs away using the url bar / back and not modal "X" $('#HostEvent').modal('hide'); // hacky way to handle user browsing away via URL bar @@ -55,4 +52,4 @@ var hostEventModal = { templateUrl: templateUrl('job-detail/host-event/host-event-stdout') }; - export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal} \ No newline at end of file + export {hostEventDetails, hostEventJson, hostEventStdout, hostEventModal}; diff --git a/awx/ui/client/src/job-detail/host-events/host-events.controller.js b/awx/ui/client/src/job-detail/host-events/host-events.controller.js index 8869248a04..0ef46ac46e 100644 --- a/awx/ui/client/src/job-detail/host-events/host-events.controller.js +++ b/awx/ui/client/src/job-detail/host-events/host-events.controller.js @@ -4,7 +4,7 @@ * All Rights Reserved *************************************************/ - export default + export default ['$stateParams', '$scope', '$rootScope', '$state', 'Wait', 'JobDetailService', 'CreateSelect2', 'hosts', function($stateParams, $scope, $rootScope, $state, Wait, @@ -18,8 +18,8 @@ $scope.search = function(){ Wait('start'); - if ($scope.searchStr == undefined){ - return + if ($scope.searchStr === undefined){ + return; } //http://docs.ansible.com/ansible-tower/latest/html/towerapi/intro.html#filtering // SELECT WHERE host_name LIKE str OR WHERE play LIKE str OR WHERE task LIKE str AND host_name NOT "" @@ -32,7 +32,7 @@ page_size: $scope.pageSize}) .success(function(res){ $scope.results = res.results; - Wait('stop') + Wait('stop'); }); }; @@ -41,7 +41,7 @@ var filter = function(filter){ Wait('start'); - if (filter == 'all'){ + if (filter === 'all'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName, page_size: $scope.pageSize}) @@ -51,25 +51,25 @@ }); } // handle runner cases - if (filter == 'skipped'){ + if (filter === 'skipped'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { - host_name: $stateParams.hostName, + host_name: $stateParams.hostName, event: 'runner_on_skipped'}) .success(function(res){ $scope.results = res.results; Wait('stop'); }); } - if (filter == 'unreachable'){ + if (filter === 'unreachable'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { - host_name: $stateParams.hostName, + host_name: $stateParams.hostName, event: 'runner_on_unreachable'}) .success(function(res){ $scope.results = res.results; Wait('stop'); }); } - if (filter == 'ok'){ + if (filter === 'ok'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName, or__field__event: 'runner_on_ok', @@ -79,31 +79,31 @@ .success(function(res){ $scope.results = res.results; Wait('stop'); - }); + }); } // handle convience properties .changed .failed - if (filter == 'changed'){ + if (filter === 'changed'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { - host_name: $stateParams.hostName, + host_name: $stateParams.hostName, changed: true}) .success(function(res){ $scope.results = res.results; Wait('stop'); - }); + }); } - if (filter == 'failed'){ + if (filter === 'failed'){ return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName, failed: true}) .success(function(res){ $scope.results = res.results; Wait('stop'); - }); - } + }); + } }; // watch select2 for changes - $('.HostEvents-select').on("select2:select", function (e) { + $('.HostEvents-select').on("select2:select", function () { filter($('.HostEvents-select').val()); }); @@ -121,15 +121,15 @@ $scope.results = res.results; Wait('stop'); $('#HostEvents').modal('show'); - });; + }); } else{ $scope.results = hosts.data.results; $('#HostEvents').modal('show'); - } + } }; init(); - }]; \ No newline at end of file + }]; diff --git a/awx/ui/client/src/job-detail/host-events/host-events.route.js b/awx/ui/client/src/job-detail/host-events/host-events.route.js index 4e2c6d4e93..a42e5c5d5d 100644 --- a/awx/ui/client/src/job-detail/host-events/host-events.route.js +++ b/awx/ui/client/src/job-detail/host-events/host-events.route.js @@ -29,7 +29,7 @@ export default { hosts: ['JobDetailService','$stateParams', function(JobDetailService, $stateParams) { return JobDetailService.getRelatedJobEvents($stateParams.id, { host_name: $stateParams.hostName - }).success(function(res){ return res.results[0]}) + }).success(function(res){ return res.results[0];}); }] } }; diff --git a/awx/ui/client/src/job-detail/host-events/main.js b/awx/ui/client/src/job-detail/host-events/main.js index 8a9487aec4..766dd92ca4 100644 --- a/awx/ui/client/src/job-detail/host-events/main.js +++ b/awx/ui/client/src/job-detail/host-events/main.js @@ -11,5 +11,5 @@ export default angular.module('jobDetail.hostEvents', []) .controller('HostEventsController', controller) .run(['$stateExtender', function($stateExtender){ - $stateExtender.addState(route) - }]); \ No newline at end of file + $stateExtender.addState(route); + }]); diff --git a/awx/ui/client/src/job-detail/job-detail.controller.js b/awx/ui/client/src/job-detail/job-detail.controller.js index 80f4c9d50c..6f37fc6851 100644 --- a/awx/ui/client/src/job-detail/job-detail.controller.js +++ b/awx/ui/client/src/job-detail/job-detail.controller.js @@ -42,7 +42,7 @@ export default scope.parseType = 'yaml'; scope.previousTaskFailed = false; $scope.stdoutFullScreen = false; - + scope.$watch('job_status', function(job_status) { if (job_status && job_status.explanation && job_status.explanation.split(":")[0] === "Previous Task Failed") { scope.previousTaskFailed = true; @@ -248,14 +248,14 @@ export default }) .error(function(data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + '. GET returned: ' + status }); + msg: 'Call failed. GET returned: ' + status }); }); $log.debug('Job completed!'); $log.debug(scope.jobData); } else { api_complete = true; //trigger events to start processing - UpdateDOM({ scope: scope}) + UpdateDOM({ scope: scope}); } }); @@ -274,10 +274,11 @@ export default var params = { parent: task.id, event__startswith: 'runner', + page_size: scope.hostResultsMaxRows }; JobDetailService.getRelatedJobEvents(scope.job.id, params) .success(function(data) { - var event, status, status_text, item, msg; + var event, status, item, msg; if (data.results.length > 0) { lastEventId = data.results[0].id; } @@ -305,7 +306,7 @@ export default event_id: play.id, page_size: scope.tasksMaxRows, order: 'id' - } + }; JobDetailService.getJobTasks(scope.job.id, params) .success(function(data) { scope.next_tasks = data.next; @@ -395,7 +396,7 @@ export default }) .error(function(data) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', - msg: 'Call to ' + url + '. GET returned: ' + status }); + msg: 'Call failed. GET returned: ' + status }); }); } else { scope.$emit('InitialLoadComplete'); @@ -413,7 +414,7 @@ export default var params = { order_by: 'id' }; - if (scope.job.summary_fields.unified_job_template.unified_job_type == 'job'){ + if (scope.job.summary_fields.unified_job_template.unified_job_type === 'job'){ JobDetailService.getJobPlays(scope.job.id, params) .success( function(data) { scope.next_plays = data.next; @@ -839,12 +840,12 @@ export default page_size: scope.hostResultsMaxRows, order: 'host_name,counter', host_name__icontains: scope.search_host_name - } + }; if (scope.search_host_status === 'failed'){ params.failed = true; } JobDetailService.getRelatedJobEvents(scope.job.id, params).success(function(res){ - scope.hostResults = JobDetailService.processHostEvents(res.results) + scope.hostResults = JobDetailService.processHostEvents(res.results); scope.hostResultsLoading = false; }); } @@ -1093,7 +1094,7 @@ export default // Click binding for the expand/collapse button on the standard out log $scope.toggleStdoutFullscreen = function() { $scope.stdoutFullScreen = !$scope.stdoutFullScreen; - } + }; scope.editSchedule = function() { // We need to get the schedule's ID out of the related links diff --git a/awx/ui/client/src/job-detail/job-detail.service.js b/awx/ui/client/src/job-detail/job-detail.service.js index b50d14630b..35142b409e 100644 --- a/awx/ui/client/src/job-detail/job-detail.service.js +++ b/awx/ui/client/src/job-detail/job-detail.service.js @@ -1,7 +1,6 @@ export default ['$rootScope', 'Rest', 'GetBasePath', 'ProcessErrors', function($rootScope, Rest, GetBasePath, ProcessErrors){ return { - stringifyParams: function(params){ return _.reduce(params, (result, value, key) => { return result + key + '=' + value + '&'}, ''); @@ -14,15 +13,15 @@ export default var result = $.extend(true, {}, data); // configure fields to ignore var ignored = [ - 'event_data', - 'related', - 'summary_fields', - 'url', + 'event_data', + 'related', + 'summary_fields', + 'url', 'ansible_facts', ]; // remove ignored properties - Object.keys(result).forEach(function(key, index){ + Object.keys(result).forEach(function(key){ if (ignored.indexOf(key) > -1) { delete result[key]; } @@ -31,7 +30,7 @@ export default // flatten Ansible's passed-through response try{ result.event_data = {}; - Object.keys(data.event_data.res).forEach(function(key, index){ + Object.keys(data.event_data.res).forEach(function(key){ if (ignored.indexOf(key) > -1) { return; } diff --git a/awx/ui/client/src/job-templates/copy/job-templates-copy.controller.js b/awx/ui/client/src/job-templates/copy/job-templates-copy.controller.js index 808e5df8e1..a0ddfda760 100644 --- a/awx/ui/client/src/job-templates/copy/job-templates-copy.controller.js +++ b/awx/ui/client/src/job-templates/copy/job-templates-copy.controller.js @@ -6,9 +6,9 @@ export default [ 'Wait', '$state', '$scope', 'jobTemplateCopyService', - 'ProcessErrors', 'GetBasePath', + 'ProcessErrors', '$rootScope', function(Wait, $state, $scope, jobTemplateCopyService, - ProcessErrors, GetBasePath){ + ProcessErrors, $rootScope){ // GETs the job_template to copy // POSTs a new job_template // routes to JobTemplates.edit when finished @@ -24,9 +24,9 @@ }) .error(function(res, status){ ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', - msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status}); + msg: 'Call failed. Return status: '+ status}); }); }; init(); - } - ]; \ No newline at end of file + } + ]; diff --git a/awx/ui/client/src/job-templates/copy/job-templates-copy.route.js b/awx/ui/client/src/job-templates/copy/job-templates-copy.route.js index dd9d5ac5af..5ba0807879 100644 --- a/awx/ui/client/src/job-templates/copy/job-templates-copy.route.js +++ b/awx/ui/client/src/job-templates/copy/job-templates-copy.route.js @@ -4,10 +4,9 @@ * All Rights Reserved *************************************************/ -import {templateUrl} from '../../shared/template-url/template-url.factory'; export default { name: 'jobTemplates.copy', route: '/:id/copy', controller: 'jobTemplateCopyController' -} \ No newline at end of file +}; diff --git a/awx/ui/client/src/job-templates/copy/job-templates-copy.service.js b/awx/ui/client/src/job-templates/copy/job-templates-copy.service.js index f949d142ad..53e86a78bb 100644 --- a/awx/ui/client/src/job-templates/copy/job-templates-copy.service.js +++ b/awx/ui/client/src/job-templates/copy/job-templates-copy.service.js @@ -13,7 +13,7 @@ Rest.setUrl(defaultUrl); return Rest.get() .success(function(res){ - return res + return res; }) .error(function(res, status){ ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', @@ -23,21 +23,21 @@ set: function(data){ var defaultUrl = GetBasePath('job_templates'); Rest.setUrl(defaultUrl); - var name = this.buildName(data.results[0].name) + var name = this.buildName(data.results[0].name); data.results[0].name = name + ' @ ' + moment().format('h:mm:ss a'); // 2:49:11 pm return Rest.post(data.results[0]) .success(function(res){ - return res + return res; }) - .error(function(res, status){ + .error(function(res, status){ ProcessErrors($rootScope, res, status, null, {hdr: 'Error!', msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status}); }); }, buildName: function(name){ var result = name.split('@')[0]; - return result + return result; } - } + }; } - ]; \ No newline at end of file + ]; diff --git a/awx/ui/client/src/job-templates/copy/main.js b/awx/ui/client/src/job-templates/copy/main.js index e0c8dc1c33..fbccc713e4 100644 --- a/awx/ui/client/src/job-templates/copy/main.js +++ b/awx/ui/client/src/job-templates/copy/main.js @@ -13,5 +13,5 @@ export default .service('jobTemplateCopyService', service) .controller('jobTemplateCopyController', controller) .run(['$stateExtender', function($stateExtender) { - $stateExtender.addState(route) + $stateExtender.addState(route); }]); diff --git a/awx/ui/client/src/job-templates/delete-job-template.service.js b/awx/ui/client/src/job-templates/delete-job-template.service.js index b8e275e62a..6bac6c3acb 100644 --- a/awx/ui/client/src/job-templates/delete-job-template.service.js +++ b/awx/ui/client/src/job-templates/delete-job-template.service.js @@ -14,5 +14,5 @@ export default ['Rest', 'GetBasePath', function(Rest, GetBasePath){ Rest.setUrl(url); return Rest.destroy(); } - } -}] \ No newline at end of file + }; +}]; diff --git a/awx/ui/client/src/job-templates/survey-maker/questions/edit.factory.js b/awx/ui/client/src/job-templates/survey-maker/questions/edit.factory.js index 25e25c3b2e..37a899f5d4 100644 --- a/awx/ui/client/src/job-templates/survey-maker/questions/edit.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/questions/edit.factory.js @@ -4,7 +4,6 @@ export default var scope = params.scope, index = params.index, - element, tmpVar, i, question = params.question, @@ -12,7 +11,7 @@ export default // Update the index so that we know which question is being edited. scope.editQuestionIndex = index; - + scope.text_min = null; scope.text_max = null; scope.int_min = null; diff --git a/awx/ui/client/src/job-templates/survey-maker/render/survey-question.directive.js b/awx/ui/client/src/job-templates/survey-maker/render/survey-question.directive.js index 4af8a3ca31..843d0b08f2 100644 --- a/awx/ui/client/src/job-templates/survey-maker/render/survey-question.directive.js +++ b/awx/ui/client/src/job-templates/survey-maker/render/survey-question.directive.js @@ -31,7 +31,9 @@ function link($sce, $filter, Empty, scope, element, attrs) { function sanitizeDefault() { - var defaultValue = ""; + var defaultValue = "", + min, + max; if(scope.question.type === 'text'|| scope.question.type === "password" ){ defaultValue = (scope.question.default) ? scope.question.default : ""; @@ -61,14 +63,14 @@ function link($sce, $filter, Empty, scope, element, attrs) { } if(scope.question.type === 'integer'){ - var min = (!Empty(scope.question.min)) ? scope.question.min : ""; - var max = (!Empty(scope.question.max)) ? scope.question.max : "" ; + min = (!Empty(scope.question.min)) ? scope.question.min : ""; + max = (!Empty(scope.question.max)) ? scope.question.max : "" ; defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_int)) ? scope.question.default_int : "" ; } if(scope.question.type === "float"){ - var min = (!Empty(scope.question.min)) ? scope.question.min : ""; - var max = (!Empty(scope.question.max)) ? scope.question.max : "" ; + min = (!Empty(scope.question.min)) ? scope.question.min : ""; + max = (!Empty(scope.question.max)) ? scope.question.max : "" ; defaultValue = (!Empty(scope.question.default)) ? scope.question.default : (!Empty(scope.question.default_float)) ? scope.question.default_float : "" ; } diff --git a/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js b/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js index 7ac32857ea..395e72f049 100644 --- a/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/surveys/edit.factory.js @@ -3,7 +3,7 @@ export default return function(params) { var scope = params.scope, id = params.id, - url = GetBasePath('job_templates') + id + '/survey_spec/', i; + url = GetBasePath('job_templates') + id + '/survey_spec/'; if (scope.removeDialogReady) { scope.removeDialogReady(); diff --git a/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js b/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js index 50af68ae68..dfd820637c 100644 --- a/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js +++ b/awx/ui/client/src/job-templates/survey-maker/surveys/init.factory.js @@ -4,8 +4,6 @@ export default return function(params) { var scope = params.scope, id = params.id, - i, url, html, element, - questions = [], form = SurveyQuestionForm, sce = params.sce; scope.sce = sce; @@ -73,7 +71,7 @@ export default scope.survey_questions = []; } $('#' + id).dialog('destroy'); - } + }; // Gets called when a user actually hits the save button. Functionality differs // based on the mode. scope.mode="add" cleans up scope.survey_questions and @@ -83,8 +81,8 @@ export default Wait('start'); if(scope.mode ==="add"){ // Loop across the survey questions and remove any new_question flags - angular.forEach(scope.survey_questions, function(question, key) { - delete question['new_question']; + angular.forEach(scope.survey_questions, function(question) { + delete question.new_question; }); $('#survey-modal-dialog').dialog('destroy'); @@ -100,28 +98,28 @@ export default var updateSurveyQuestions = function() { Rest.setUrl(GetBasePath('job_templates') + id + '/survey_spec/'); return Rest.post({name: scope.survey_name, description: scope.survey_description, spec: scope.survey_questions }) - .success(function (data) { + .success(function () { }) .error(function (data, status) { ProcessErrors(scope, data, status, null, { hdr: 'Error!', msg: 'Failed to add new survey. POST returned status: ' + status }); }); - } + }; var updateSurveyEnabled = function() { Rest.setUrl(GetBasePath('job_templates') + id+ '/'); return Rest.patch({"survey_enabled": scope.survey_enabled}) - .success(function (data) { + .success(function () { }) .error(function (data, status) { ProcessErrors(scope, data, status, form, { hdr: 'Error!', - msg: 'Failed to retrieve save survey_enabled: ' + $routeParams.template_id + '. GET status: ' + status + msg: 'Failed to save survey_enabled: GET status: ' + status }); }); - } + }; updateSurveyQuestions() .then(function() { @@ -130,7 +128,7 @@ export default .then(function() { scope.closeSurvey('survey-modal-dialog'); scope.$emit('SurveySaved'); - }) + }); } }; @@ -173,7 +171,7 @@ export default scope.questionToBeDeleted = deleteIndex; // Show the delete overlay with mode='question' scope.showDeleteOverlay('question'); - } + }; // Called after a user confirms question deletion (hitting the DELETE button on the delete question overlay). scope.deleteQuestion = function(index){ @@ -181,7 +179,7 @@ export default // one being edited in the array. This makes sure that our pointer to the question // currently being edited gets updated independently from a deleted question. if(GenerateForm.mode === 'edit' && !isNaN(scope.editQuestionIndex)){ - if(scope.editQuestionIndex == index) { + if(scope.editQuestionIndex === index) { // The user is deleting the question being edited - need to roll back to Add Question mode scope.editQuestionIndex = null; scope.generateAddQuestionForm(); @@ -238,7 +236,7 @@ export default // Set the whole form to pristine scope.survey_question_form.$setPristine(); - } + }; // Gets called when the "type" dropdown value changes. In that case, we want to clear out // all the "type" specific fields/errors and start fresh. @@ -258,12 +256,11 @@ export default // Function that gets called when a user hits ADD/UPDATE on the survey question form. This // function handles some validation as well as eventually adding the question to the // scope.survey_questions array. - scope.submitQuestion = function(event){ + scope.submitQuestion = function(){ var data = {}, fld, i, choiceArray, - answerArray, - key, elementID; + answerArray; scope.invalidChoice = false; scope.duplicate = false; scope.minTextError = false; @@ -333,7 +330,7 @@ export default if(GenerateForm.mode === 'edit'){ // Loop across the survey questions and see if a different question already has // the same variable name - for(var i=0; i 15){ - return false + return false; } - return true + return true; }, notify: function(){ - self = this; + var self = this; this.get() .then(function(res){ - self.valid(res.data.license_info) ? null : $state.go('license'); + if(self.valid(res.data.license_info) === false) { + $state.go('license'); + } }); } - } + }; } - ]; \ No newline at end of file + ]; diff --git a/awx/ui/client/src/license/fileOnChange.directive.js b/awx/ui/client/src/license/fileOnChange.directive.js index eac1f5ffe2..2e04441308 100644 --- a/awx/ui/client/src/license/fileOnChange.directive.js +++ b/awx/ui/client/src/license/fileOnChange.directive.js @@ -12,5 +12,5 @@ export default var onChange = scope.$eval(attrs.fileOnChange); el.bind('change', onChange); } - } - }]; \ No newline at end of file + }; + }]; diff --git a/awx/ui/client/src/license/license.controller.js b/awx/ui/client/src/license/license.controller.js index 187fa8883c..d81b44b85d 100644 --- a/awx/ui/client/src/license/license.controller.js +++ b/awx/ui/client/src/license/license.controller.js @@ -22,7 +22,7 @@ export default catch(err) { ProcessErrors($rootScope, null, null, null, {msg: 'Invalid file format. Please upload valid JSON.'}); } - } + }; try { raw.readAsText(event.target.files[0]); } @@ -34,12 +34,12 @@ export default // So we hide the default input, show our own, and simulate clicks to the hidden input $scope.fakeClick = function(){ $('#License-file').click(); - } + }; $scope.newLicense = {}; - $scope.submit = function(event){ + $scope.submit = function(){ Wait('start'); CheckLicense.post($scope.newLicense.file, $scope.newLicense.eula) - .success(function(res){ + .success(function(){ reset(); init(); $scope.success = true; @@ -53,15 +53,15 @@ export default var calcDaysRemaining = function(ms){ // calculate the number of days remaining on the license var duration = moment.duration(ms); - return duration.days() + return duration.days(); }; var calcExpiresOn = function(days){ // calculate the expiration date of the license - return moment().add(days, 'days').calendar() + return moment().add(days, 'days').calendar(); }; var init = function(){ - $scope.fileName = "Please choose a file..." + $scope.fileName = "Please choose a file..."; Wait('start'); CheckLicense.get() .then(function(res){ @@ -70,13 +70,13 @@ export default $scope.time = {}; $scope.time.remaining = calcDaysRemaining($scope.license.license_info.time_remaining); $scope.time.expiresOn = calcExpiresOn($scope.time.remaining); - $scope.valid = CheckLicense.valid($scope.license.license_info); + $scope.valid = CheckLicense.valid($scope.license.license_info); Wait('stop'); }); }; var reset = function(){ - document.getElementById('License-form').reset() + document.getElementById('License-form').reset(); }; - init(); + init(); } - ]; \ No newline at end of file + ]; diff --git a/awx/ui/client/src/license/license.route.js b/awx/ui/client/src/license/license.route.js index b32f6299ea..190ec6a5c7 100644 --- a/awx/ui/client/src/license/license.route.js +++ b/awx/ui/client/src/license/license.route.js @@ -16,4 +16,4 @@ export default { parent: 'setup', label: 'LICENSE' } -} \ No newline at end of file +}; diff --git a/awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js b/awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js index 138930b047..e6f5f08b64 100644 --- a/awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js +++ b/awx/ui/client/src/login/loginModal/thirdPartySignOn/main.js @@ -10,4 +10,4 @@ import thirdPartySignOnService from './thirdPartySignOn.service'; export default angular.module('thirdPartySignOn', []) .directive('thirdPartySignOn', thirdPartySignOnDirective) - .factory('thirdPartySignOnService', thirdPartySignOnService) + .factory('thirdPartySignOnService', thirdPartySignOnService); diff --git a/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.controller.js b/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.controller.js index ada4a2e203..878968acda 100644 --- a/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.controller.js +++ b/awx/ui/client/src/login/loginModal/thirdPartySignOn/thirdPartySignOn.controller.js @@ -26,7 +26,7 @@ export default ['$window', '$scope', 'thirdPartySignOnService', if (data && data.error) { $scope.$parent.thirdPartyAttemptFailed = data.error; } - }) + }); $scope.goTo = function(link) { // this is used because $location only lets you navigate inside diff --git a/awx/ui/client/src/main-menu/main-menu.directive.js b/awx/ui/client/src/main-menu/main-menu.directive.js index 50b4404648..a8056e233f 100644 --- a/awx/ui/client/src/main-menu/main-menu.directive.js +++ b/awx/ui/client/src/main-menu/main-menu.directive.js @@ -8,7 +8,7 @@ export default link: function(scope, element, attrs) { scope.isCurrentState = function(name){ - return $state.current.name == name + return $state.current.name === name; }; // set up the user tooltip diff --git a/awx/ui/client/src/management-jobs/card/card.controller.js b/awx/ui/client/src/management-jobs/card/card.controller.js index 04e1261151..c47afcb7e9 100644 --- a/awx/ui/client/src/management-jobs/card/card.controller.js +++ b/awx/ui/client/src/management-jobs/card/card.controller.js @@ -34,8 +34,7 @@ export default }; getManagementJobs(); var scope = $rootScope.$new(), - parent_scope = scope, - list = managementJobsListObject; + parent_scope = scope; scope.cleanupJob = true; diff --git a/awx/ui/client/src/organizations/add/main.js b/awx/ui/client/src/organizations/add/main.js index 27b8406e0b..88d478b902 100644 --- a/awx/ui/client/src/organizations/add/main.js +++ b/awx/ui/client/src/organizations/add/main.js @@ -5,7 +5,6 @@ *************************************************/ import route from './organizations-add.route'; -import controller from './organizations-add.controller'; export default angular.module('organizationsAdd', []) diff --git a/awx/ui/client/src/organizations/add/organizations-add.controller.js b/awx/ui/client/src/organizations/add/organizations-add.controller.js index 3dfdffbe2d..ce71664a41 100644 --- a/awx/ui/client/src/organizations/add/organizations-add.controller.js +++ b/awx/ui/client/src/organizations/add/organizations-add.controller.js @@ -63,4 +63,4 @@ export default ['$scope', '$rootScope', '$compile', '$location', $state.transitionTo('organizations'); }; } -] +]; diff --git a/awx/ui/client/src/organizations/list/main.js b/awx/ui/client/src/organizations/list/main.js index 0250a5f5f8..d8edac601c 100644 --- a/awx/ui/client/src/organizations/list/main.js +++ b/awx/ui/client/src/organizations/list/main.js @@ -5,7 +5,6 @@ *************************************************/ import route from './organizations-list.route'; -import controller from './organizations-list.controller'; export default angular.module('organizationsList', []) diff --git a/awx/ui/client/src/organizations/list/organizations-list.controller.js b/awx/ui/client/src/organizations/list/organizations-list.controller.js index 0b5145efec..cd6f85a6f7 100644 --- a/awx/ui/client/src/organizations/list/organizations-list.controller.js +++ b/awx/ui/client/src/organizations/list/organizations-list.controller.js @@ -44,7 +44,7 @@ export default ['$stateParams', '$scope', '$rootScope', '$location', var paginationContainer = $('#pagination-container'); paginationContainer.html($scope.PaginateWidget); - $compile(paginationContainer.contents())($scope) + $compile(paginationContainer.contents())($scope); var parseCardData = function(cards) { return cards.map(function(card) { @@ -187,4 +187,4 @@ export default ['$stateParams', '$scope', '$rootScope', '$location', }); }; } -] +]; diff --git a/awx/ui/client/src/portal-mode/portal-mode-job-templates.controller.js b/awx/ui/client/src/portal-mode/portal-mode-job-templates.controller.js index 0bbdbcd980..86e2f51644 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-job-templates.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-job-templates.controller.js @@ -7,8 +7,7 @@ export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePath, GenerateList, PortalJobTemplateList, SearchInit, PaginateInit, PlaybookRun){ - var jobs_scope, - list = PortalJobTemplateList, + var list = PortalJobTemplateList, view= GenerateList, defaultUrl = GetBasePath('job_templates'), pageSize = 12; @@ -40,7 +39,7 @@ export function PortalModeJobTemplatesController($scope, $rootScope, GetBasePat $scope.search(list.iterator); }; - init() + init(); } PortalModeJobTemplatesController.$inject = ['$scope', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobTemplateList', 'SearchInit', 'PaginateInit', 'PlaybookRun' diff --git a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js index 165699ce05..ccb911975f 100644 --- a/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js +++ b/awx/ui/client/src/portal-mode/portal-mode-jobs.controller.js @@ -21,6 +21,7 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath id: 'portal-jobs', mode: 'edit', scope: $scope, + searchSize: 'col-md-10 col-xs-12' }); SearchInit({ @@ -56,4 +57,4 @@ export function PortalModeJobsController($scope, $state, $rootScope, GetBasePath } PortalModeJobsController.$inject = ['$scope', '$state', '$rootScope', 'GetBasePath', 'generateList', 'PortalJobsList', 'SearchInit', - 'PaginateInit'] \ No newline at end of file + 'PaginateInit']; diff --git a/awx/ui/client/src/scheduler/scheduler.controller.js b/awx/ui/client/src/scheduler/scheduler.controller.js index d1209b91da..495628d16c 100644 --- a/awx/ui/client/src/scheduler/scheduler.controller.js +++ b/awx/ui/client/src/scheduler/scheduler.controller.js @@ -20,9 +20,9 @@ export default [ ClearScope(); - var base, e, id, url, parentObject; + var base, id, url, parentObject; base = $location.path().replace(/^\//, '').split('/')[0]; - if (base == 'management_jobs') { + if (base === 'management_jobs') { $scope.base = base = 'system_job_templates'; } if ($stateParams.job_type){ diff --git a/awx/ui/client/src/scheduler/schedulerEdit.controller.js b/awx/ui/client/src/scheduler/schedulerEdit.controller.js index f75b47a51f..fae21615c5 100644 --- a/awx/ui/client/src/scheduler/schedulerEdit.controller.js +++ b/awx/ui/client/src/scheduler/schedulerEdit.controller.js @@ -46,7 +46,7 @@ export default ['$compile', '$state', '$stateParams', 'EditSchedule', 'Wait', '$ $scope.formCancel = function() { $state.go("^"); - } + }; // extra_data field is not manifested in the UI when scheduling a Management Job if ($state.current.name !== ('managementJobSchedules.add' || 'managementJobSchedules.edit')){ diff --git a/awx/ui/client/src/shared/features/features.service.js b/awx/ui/client/src/shared/features/features.service.js index f620edd7ee..6bb7a8a54d 100644 --- a/awx/ui/client/src/shared/features/features.service.js +++ b/awx/ui/client/src/shared/features/features.service.js @@ -33,7 +33,7 @@ function ($rootScope, Rest, GetBasePath, ProcessErrors, $http, $q) { } }, featureEnabled: function(feature) { - if($rootScope.features && $rootScope.features[feature] && $rootScope.features[feature] == true) { + if($rootScope.features && $rootScope.features[feature] && $rootScope.features[feature] === true) { return true; } else { diff --git a/awx/ui/client/src/shared/multi-select-list/select-list-item.directive.js b/awx/ui/client/src/shared/multi-select-list/select-list-item.directive.js index fb90d045b8..4bd0a8b57a 100644 --- a/awx/ui/client/src/shared/multi-select-list/select-list-item.directive.js +++ b/awx/ui/client/src/shared/multi-select-list/select-list-item.directive.js @@ -54,7 +54,7 @@ export default scope.userInteractionSelect = function() { scope.$emit("selectedOrDeselected", scope.decoratedItem); - } + }; } }; diff --git a/awx/ui/client/src/standard-out/inventory-sync/standard-out-inventory-sync.route.js b/awx/ui/client/src/standard-out/inventory-sync/standard-out-inventory-sync.route.js index 3fa874fbda..468826bc5b 100644 --- a/awx/ui/client/src/standard-out/inventory-sync/standard-out-inventory-sync.route.js +++ b/awx/ui/client/src/standard-out/inventory-sync/standard-out-inventory-sync.route.js @@ -24,7 +24,7 @@ export default { features: ['FeaturesService', function(FeaturesService) { return FeaturesService.get(); }], - inventorySyncSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + inventorySyncSocket: [function() { // TODO: determine whether or not we have socket support for inventory sync standard out return true; }] diff --git a/awx/ui/client/src/standard-out/log/standard-out-log.controller.js b/awx/ui/client/src/standard-out/log/standard-out-log.controller.js index ca3bff7947..9a8c600fdb 100644 --- a/awx/ui/client/src/standard-out/log/standard-out-log.controller.js +++ b/awx/ui/client/src/standard-out/log/standard-out-log.controller.js @@ -21,7 +21,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce // Open up a socket for events depending on the type of job function openSockets() { - if ($state.current.name == 'jobDetail') { + if ($state.current.name === 'jobDetail') { $log.debug("socket watching on job_events-" + job_id); $rootScope.event_socket.on("job_events-" + job_id, function() { $log.debug("socket fired on job_events-" + job_id); @@ -30,7 +30,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce } }); } - if ($state.current.name == 'adHocJobStdout') { + if ($state.current.name === 'adHocJobStdout') { $log.debug("socket watching on ad_hoc_command_events-" + job_id); $rootScope.adhoc_event_socket.on("ad_hoc_command_events-" + job_id, function() { $log.debug("socket fired on ad_hoc_command_events-" + job_id); @@ -50,7 +50,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce } $scope.removeLoadStdout = $scope.$on('LoadStdout', function() { if (loaded_sections.length === 0) { - loadStdout() + loadStdout(); } else if (live_event_processing) { getNextSection(); @@ -80,7 +80,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce // This watcher fires off loadStdout() when the endpoint becomes // available. $scope.$watch('stdoutEndpoint', function(newVal, oldVal) { - if(newVal && newVal != oldVal) { + if(newVal && newVal !== oldVal) { // Fire off the server call loadStdout(); } @@ -112,7 +112,7 @@ export default ['$log', '$rootScope', '$scope', '$state', '$stateParams', 'Proce ProcessErrors($scope, data, status, null, { hdr: 'Error!', msg: 'Failed to retrieve stdout for job: ' + job_id + '. GET returned: ' + status }); }); - }; + } function getNextSection() { // get the next range of data from the API diff --git a/awx/ui/client/src/standard-out/management-jobs/standard-out-management-jobs.route.js b/awx/ui/client/src/standard-out/management-jobs/standard-out-management-jobs.route.js index 3f3bf8a8dd..8ff410f549 100644 --- a/awx/ui/client/src/standard-out/management-jobs/standard-out-management-jobs.route.js +++ b/awx/ui/client/src/standard-out/management-jobs/standard-out-management-jobs.route.js @@ -22,7 +22,7 @@ export default { features: ['FeaturesService', function(FeaturesService) { return FeaturesService.get(); }], - managementJobSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + managementJobSocket: [function() { // TODO: determine whether or not we have socket support for management job standard out return true; }] diff --git a/awx/ui/client/src/standard-out/scm-update/standard-out-scm-update.route.js b/awx/ui/client/src/standard-out/scm-update/standard-out-scm-update.route.js index 15cddbb5b4..dae4654cc8 100644 --- a/awx/ui/client/src/standard-out/scm-update/standard-out-scm-update.route.js +++ b/awx/ui/client/src/standard-out/scm-update/standard-out-scm-update.route.js @@ -24,7 +24,7 @@ export default { features: ['FeaturesService', function(FeaturesService) { return FeaturesService.get(); }], - scmUpdateSocket: ['Socket', '$rootScope', function(Socket, $rootScope) { + scmUpdateSocket: [function() { // TODO: determine whether or not we have socket support for scm update standard out return true; }] diff --git a/awx/ui/client/src/standard-out/standard-out.controller.js b/awx/ui/client/src/standard-out/standard-out.controller.js index 585efe9962..018afda688 100644 --- a/awx/ui/client/src/standard-out/standard-out.controller.js +++ b/awx/ui/client/src/standard-out/standard-out.controller.js @@ -11,7 +11,7 @@ */ -export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName, ParseTypeChange, ParseVariableString) { +export function JobStdoutController ($rootScope, $scope, $state, $stateParams, ClearScope, GetBasePath, Rest, ProcessErrors, Empty, GetChoices, LookUpName) { ClearScope(); @@ -164,10 +164,10 @@ export function JobStdoutController ($rootScope, $scope, $state, $stateParams, C // Click binding for the expand/collapse button on the standard out log $scope.toggleStdoutFullscreen = function() { $scope.stdoutFullScreen = !$scope.stdoutFullScreen; - } + }; getJobDetails(); } -JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName', 'ParseTypeChange', 'ParseVariableString']; +JobStdoutController.$inject = [ '$rootScope', '$scope', '$state', '$stateParams', 'ClearScope', 'GetBasePath', 'Rest', 'ProcessErrors', 'Empty', 'GetChoices', 'LookUpName']; diff --git a/awx/ui/client/src/widgets/Stream.js b/awx/ui/client/src/widgets/Stream.js index 23757dbae1..8656604389 100644 --- a/awx/ui/client/src/widgets/Stream.js +++ b/awx/ui/client/src/widgets/Stream.js @@ -263,26 +263,21 @@ angular.module('StreamWidget', ['RestServices', 'Utilities', 'StreamListDefiniti } ]) -.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath', 'ProcessErrors', 'Wait', 'StreamList', 'SearchInit', - 'PaginateInit', 'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl', - 'ShowDetail', 'setStreamHeight', 'Find', 'Store', - function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors, Wait, StreamList, SearchInit, PaginateInit, GenerateList, - FormatDate, BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight, - Find, Store) { +.factory('Stream', ['$rootScope', '$location', '$state', 'Rest', 'GetBasePath', + 'ProcessErrors', 'Wait', 'StreamList', 'SearchInit', 'PaginateInit', + 'generateList', 'FormatDate', 'BuildDescription', 'FixUrl', 'BuildUrl', + 'ShowDetail', 'setStreamHeight', + function ($rootScope, $location, $state, Rest, GetBasePath, ProcessErrors, + Wait, StreamList, SearchInit, PaginateInit, GenerateList, FormatDate, + BuildDescription, FixUrl, BuildUrl, ShowDetail, setStreamHeight) { return function (params) { var list = StreamList, defaultUrl = GetBasePath('activity_stream'), view = GenerateList, - base = $location.path().replace(/^\//, '').split('/')[0], parent_scope = params.scope, scope = parent_scope.$new(), - search_iterator = params.search_iterator, // use to get correct current_search_params from local store - PreviousSearchParams = (search_iterator) ? Store(search_iterator + '_current_search_params') : Store('CurrentSearchParams'), - inventory_name = (params && params.inventory_name) ? params.inventory_name : null, - onClose = params.onClose, // optional callback to $emit after AS closes - url = (params && params.url) ? params.url : null, - type, paths, itm; + url = (params && params.url) ? params.url : null; $rootScope.flashMessage = null;