From 584abcc05bee281a0483fcab268aba28262b61b7 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Mon, 6 Apr 2015 10:30:36 -0400 Subject: [PATCH] random syntax and style fixes to tower js may include some new dependencies needed for adhoc commands --- awx/ui/static/js/app.js | 2 +- awx/ui/static/js/controllers/Inventories.js | 59 ++++++++++++------- awx/ui/static/js/controllers/JobDetail.js | 1 + awx/ui/static/js/controllers/JobTemplates.js | 2 +- awx/ui/static/js/controllers/Permissions.js | 9 +-- awx/ui/static/js/helpers/Credentials.js | 1 - awx/ui/static/js/helpers/JobSubmission.js | 1 - awx/ui/static/js/helpers/inventory.js | 3 - awx/ui/static/js/lists/InventoryGroups.js | 6 +- .../list-generator/list-generator.factory.js | 3 +- 10 files changed, 51 insertions(+), 36 deletions(-) diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js index 12ee00cba3..235539f398 100644 --- a/awx/ui/static/js/app.js +++ b/awx/ui/static/js/app.js @@ -76,7 +76,7 @@ var tower = angular.module('Tower', [ 'UserFormDefinition', 'FormGenerator', 'OrganizationListDefinition', - 'jobTemplates', + 'jobTemplates', 'UserListDefinition', 'UserHelper', 'PromptDialog', diff --git a/awx/ui/static/js/controllers/Inventories.js b/awx/ui/static/js/controllers/Inventories.js index b109ff26f9..00af03e462 100644 --- a/awx/ui/static/js/controllers/Inventories.js +++ b/awx/ui/static/js/controllers/Inventories.js @@ -15,12 +15,12 @@ import 'tower/job-templates/main'; -export function InventoriesList($scope, $rootScope, $location, $log, $routeParams, $compile, $filter, Rest, Alert, InventoryList, generateList, - LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, ClearScope, ProcessErrors, GetBasePath, Wait, Stream, +export function InventoriesList($scope, $rootScope, $location, $log, + $routeParams, $compile, $filter, Rest, Alert, InventoryList, generateList, + LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller, + ClearScope, ProcessErrors, GetBasePath, Wait, Stream, EditInventoryProperties, Find, Empty, LogViewer) { - //ClearScope(); - var list = InventoryList, defaultUrl = GetBasePath('inventory'), view = generateList, @@ -51,7 +51,10 @@ export function InventoriesList($scope, $rootScope, $location, $log, $routeParam // close any lingering tool tipss $(this).hide(); }); - elem.attr({ "aw-pop-over": html, "data-popover-title": title, "data-placement": "right" }); + elem.attr({ + "aw-pop-over": html, + "data-popover-title": title, + "data-placement": "right" }); $compile(elem)($scope); elem.on('shown.bs.popover', function() { $('.popover').each(function() { @@ -837,12 +840,16 @@ InventoriesEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$lo -export function InventoriesManage ($log, $scope, $location, $routeParams, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert, LoadBreadCrumbs, GetBasePath, ProcessErrors, - Breadcrumbs, InventoryGroups, InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, GetHostsStatusMsg, GroupsEdit, InventoryUpdate, - GroupsCancelUpdate, ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary, - InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight, - GroupsCopy, HostsCopy, Socket) -{ +export function InventoriesManage ($log, $scope, $rootScope, $location, + $routeParams, $compile, generateList, ClearScope, Empty, Wait, Rest, Alert, + LoadBreadCrumbs, GetBasePath, ProcessErrors, Breadcrumbs, InventoryGroups, + InjectHosts, Find, HostsReload, SearchInit, PaginateInit, GetSyncStatusMsg, + GetHostsStatusMsg, GroupsEdit, InventoryUpdate, GroupsCancelUpdate, + ViewUpdateStatus, GroupsDelete, Store, HostsEdit, HostsDelete, + EditInventoryProperties, ToggleHostEnabled, Stream, ShowJobSummary, + InventoryGroupsHelp, HelpDialog, ViewJob, WatchInventoryWindowResize, + GetHostContainerRows, GetGroupContainerRows, GetGroupContainerHeight, + GroupsCopy, HostsCopy, Socket) { var PreviousSearchParams, url, @@ -1365,7 +1372,8 @@ export function InventoriesManage ($log, $scope, $location, $routeParams, $compi hostScope.show_failures = show_failures; $scope.groupSelect(group_id); hostScope.hosts = []; - $scope.show_failures = show_failures; // turn on failed hosts filter in hosts view + $scope.show_failures = show_failures; // turn on failed hosts + // filter in hosts view } else { Wait('stop'); } @@ -1374,15 +1382,24 @@ export function InventoriesManage ($log, $scope, $location, $routeParams, $compi if ($scope.removeGroupDeleteCompleted) { $scope.removeGroupDeleteCompleted(); } - $scope.removeGroupDeleteCompleted = $scope.$on('GroupDeleteCompleted', function() { - $scope.refreshGroups(); - }); + $scope.removeGroupDeleteCompleted = $scope.$on('GroupDeleteCompleted', + function() { + $scope.refreshGroups(); + } + ); } -InventoriesManage.$inject = ['$log', '$scope', '$location', '$routeParams', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait', 'Rest', 'Alert', 'LoadBreadCrumbs', - 'GetBasePath', 'ProcessErrors', 'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload', 'SearchInit', 'PaginateInit', 'GetSyncStatusMsg', - 'GetHostsStatusMsg', 'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus', 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete', - 'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary', 'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', 'WatchInventoryWindowResize', - 'GetHostContainerRows', 'GetGroupContainerRows', 'GetGroupContainerHeight', 'GroupsCopy', 'HostsCopy', 'Socket' - ]; +InventoriesManage.$inject = ['$log', '$scope', '$rootScope', '$location', + '$routeParams', '$compile', 'generateList', 'ClearScope', 'Empty', 'Wait', + 'Rest', 'Alert', 'LoadBreadCrumbs', 'GetBasePath', 'ProcessErrors', + 'Breadcrumbs', 'InventoryGroups', 'InjectHosts', 'Find', 'HostsReload', + 'SearchInit', 'PaginateInit', 'GetSyncStatusMsg', 'GetHostsStatusMsg', + 'GroupsEdit', 'InventoryUpdate', 'GroupsCancelUpdate', 'ViewUpdateStatus', + 'GroupsDelete', 'Store', 'HostsEdit', 'HostsDelete', + 'EditInventoryProperties', 'ToggleHostEnabled', 'Stream', 'ShowJobSummary', + 'InventoryGroupsHelp', 'HelpDialog', 'ViewJob', + 'WatchInventoryWindowResize', 'GetHostContainerRows', + 'GetGroupContainerRows', 'GetGroupContainerHeight', 'GroupsCopy', + 'HostsCopy', 'Socket' +]; diff --git a/awx/ui/static/js/controllers/JobDetail.js b/awx/ui/static/js/controllers/JobDetail.js index d4c3942a4f..3d8567cd37 100644 --- a/awx/ui/static/js/controllers/JobDetail.js +++ b/awx/ui/static/js/controllers/JobDetail.js @@ -1302,6 +1302,7 @@ export function JobDetailController ($location, $rootScope, $scope, $compile, $r status: status }); }; + scope.refresh = function(){ $scope.$emit('LoadJob'); }; diff --git a/awx/ui/static/js/controllers/JobTemplates.js b/awx/ui/static/js/controllers/JobTemplates.js index 8279d0f61e..95ebbbfb76 100644 --- a/awx/ui/static/js/controllers/JobTemplates.js +++ b/awx/ui/static/js/controllers/JobTemplates.js @@ -1145,11 +1145,11 @@ export function JobTemplatesEdit($scope, $rootScope, $compile, $location, $log, action: action }); }); - if($scope.survey_enabled === true && $scope.survey_exists!==true){ $scope.$emit("PromptForSurvey"); } else { + PlaybookRun({ scope: $scope, id: id diff --git a/awx/ui/static/js/controllers/Permissions.js b/awx/ui/static/js/controllers/Permissions.js index f0bb619c26..a0880dd980 100644 --- a/awx/ui/static/js/controllers/Permissions.js +++ b/awx/ui/static/js/controllers/Permissions.js @@ -332,7 +332,8 @@ export function PermissionsEdit($scope, $rootScope, $compile, $location, $log, $ } -PermissionsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', '$log', '$routeParams', 'PermissionsForm', - 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'Prompt', 'GetBasePath', - 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', 'Wait', 'PermissionCategoryChange' -]; \ No newline at end of file +PermissionsEdit.$inject = ['$scope', '$rootScope', '$compile', '$location', + '$log', '$routeParams', 'PermissionsForm', 'GenerateForm', 'Rest', 'Alert', + 'ProcessErrors', 'LoadBreadCrumbs', 'ReturnToCaller', 'ClearScope', 'Prompt', + 'GetBasePath', 'InventoryList', 'ProjectList', 'LookUpInit', 'CheckAccess', + 'Wait', 'PermissionCategoryChange']; diff --git a/awx/ui/static/js/helpers/Credentials.js b/awx/ui/static/js/helpers/Credentials.js index 9d4c6eaec7..36abc98ba8 100644 --- a/awx/ui/static/js/helpers/Credentials.js +++ b/awx/ui/static/js/helpers/Credentials.js @@ -17,7 +17,6 @@ angular.module('CredentialsHelper', ['Utilities']) .factory('KindChange', ['Empty', function (Empty) { return function (params) { - var scope = params.scope, reset = params.reset, collapse, id; diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 41626056ad..373814bbf8 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -299,7 +299,6 @@ function($compile, Rest, GetBasePath, TextareaResize,CreateDialog, GenerateForm, html += "
Launching this job requires the passwords listed below. Enter and confirm each password before continuing.
\n"; // html += "
\n"; - scope.passwords.forEach(function(password) { // Prompt for password field = form.fields[password]; diff --git a/awx/ui/static/js/helpers/inventory.js b/awx/ui/static/js/helpers/inventory.js index 3860c93929..18dd2b4afa 100644 --- a/awx/ui/static/js/helpers/inventory.js +++ b/awx/ui/static/js/helpers/inventory.js @@ -18,7 +18,6 @@ export default 'InventoryHelper', 'InventoryFormDefinition', 'ParseHelper', 'SearchHelper', 'VariablesHelper', ]) - .factory('GetGroupContainerHeight', [ function() { return function() { @@ -101,7 +100,6 @@ export default }; }]) - .factory('WatchInventoryWindowResize', ['ApplyEllipsis', 'SetContainerHeights', function (ApplyEllipsis, SetContainerHeights) { return function (params) { @@ -185,7 +183,6 @@ export default } ]) - .factory('EditInventoryProperties', ['InventoryForm', 'GenerateForm', 'Rest', 'Alert', 'ProcessErrors', 'LookUpInit', 'OrganizationList', 'GetBasePath', 'ParseTypeChange', 'SaveInventory', 'Wait', 'Store', 'SearchInit', 'ParseVariableString', 'CreateDialog', 'TextareaResize', function (InventoryForm, GenerateForm, Rest, Alert, ProcessErrors, LookUpInit, OrganizationList, GetBasePath, ParseTypeChange, SaveInventory, diff --git a/awx/ui/static/js/lists/InventoryGroups.js b/awx/ui/static/js/lists/InventoryGroups.js index ef88713e4d..c55c89b4db 100644 --- a/awx/ui/static/js/lists/InventoryGroups.js +++ b/awx/ui/static/js/lists/InventoryGroups.js @@ -134,7 +134,8 @@ export default ngClick: 'updateGroup(group.id)', awToolTip: "{{ group.launch_tooltip }}", dataTipWatch: "group.launch_tooltip", - ngShow: "group.status !== 'running' && group.status !== 'pending' && group.status !== 'updating'", + ngShow: "group.status !== 'running' && group.status " + + "!== 'pending' && group.status !== 'updating'", ngClass: "group.launch_class", dataPlacement: "top" }, @@ -144,7 +145,8 @@ export default ngClick: "cancelUpdate(group.id)", awToolTip: "Cancel sync process", 'class': 'red-txt', - ngShow: "group.status == 'running' || group.status == 'pending' || group.status == 'updating'", + ngShow: "group.status == 'running' || group.status == 'pending' " + + "|| group.status == 'updating'", dataPlacement: "top" }, edit: { diff --git a/awx/ui/static/js/shared/list-generator/list-generator.factory.js b/awx/ui/static/js/shared/list-generator/list-generator.factory.js index ed320a23ba..8dabd91a4e 100644 --- a/awx/ui/static/js/shared/list-generator/list-generator.factory.js +++ b/awx/ui/static/js/shared/list-generator/list-generator.factory.js @@ -229,7 +229,6 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate selection.deselectedItems.forEach(function(item) { item.isSelected = false; }); - }.bind(this)); this.scope.$on('$destroy', function() { @@ -396,7 +395,7 @@ export default ['$location', '$compile', '$rootScope', 'SearchWidget', 'Paginate }); } - html += "\n"; + html += "\n"; html += "\n"; } else {