From 195e12e41fd69609a61dc5844869bf649c7cd279 Mon Sep 17 00:00:00 2001 From: chouseknecht Date: Thu, 17 Oct 2013 14:53:23 +0000 Subject: [PATCH] Inventory group refresh now includes group selector tree. Fixed 'conigured' type on home page. --- awx/ui/static/js/helpers/Groups.js | 11 ++++++----- awx/ui/static/js/helpers/JobSubmission.js | 2 +- awx/ui/static/js/helpers/search.js | 8 +++++--- awx/ui/static/js/widgets/SCMSyncStatus.js | 2 +- awx/ui/static/lib/ansible/license.js | 6 +++--- 5 files changed, 16 insertions(+), 13 deletions(-) diff --git a/awx/ui/static/js/helpers/Groups.js b/awx/ui/static/js/helpers/Groups.js index 5debd67972..1215707640 100644 --- a/awx/ui/static/js/helpers/Groups.js +++ b/awx/ui/static/js/helpers/Groups.js @@ -175,9 +175,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' .factory('InventoryStatus', [ '$rootScope', '$routeParams', 'Rest', 'Alert', 'ProcessErrors', 'GetBasePath', 'FormatDate', 'InventorySummary', 'GenerateList', 'ClearScope', 'SearchInit', 'PaginateInit', 'Refresh', 'InventoryUpdate', 'GroupsEdit', 'ShowUpdateStatus', 'HelpDialog', - 'ShowGroupHelp', 'InventorySummaryHelp', + 'ShowGroupHelp', 'InventorySummaryHelp', 'RefreshTree', function($rootScope, $routeParams, Rest, Alert, ProcessErrors, GetBasePath, FormatDate, InventorySummary, GenerateList, ClearScope, SearchInit, - PaginateInit, Refresh, InventoryUpdate, GroupsEdit, ShowUpdateStatus, HelpDialog, ShowGroupHelp, InventorySummaryHelp) { + PaginateInit, Refresh, InventoryUpdate, GroupsEdit, ShowUpdateStatus, HelpDialog, ShowGroupHelp, InventorySummaryHelp, RefreshTree) { return function(params) { //Build a summary of a given inventory @@ -305,7 +305,7 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' } } - scope.search(list.iterator); + scope.search(list.iterator, false, true); if (scope.removeShowHelp) { scope.removeShowHelp(); @@ -450,8 +450,9 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', ' // Respond to refresh button scope.refresh = function() { scope['groupSearchSpin'] = true; - scope['groupLoading'] = true; - Refresh({ scope: scope, set: 'groups', iterator: 'group', url: scope['current_url'] }); + scope['groupLoading'] = false; + RefreshTree({ scope: scope }); + //setTimeout( function () { Refresh({ scope: scope, set: 'groups', iterator: 'group', url: scope['current_url'] }); }, 500); } // Start the update process diff --git a/awx/ui/static/js/helpers/JobSubmission.js b/awx/ui/static/js/helpers/JobSubmission.js index 38c7d04e5a..a0dcde5ce4 100644 --- a/awx/ui/static/js/helpers/JobSubmission.js +++ b/awx/ui/static/js/helpers/JobSubmission.js @@ -408,7 +408,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential 'The screen will refresh every 10 seconds, or refresh manually by clicking the Refresh button.', 'alert-info'); var node = $('#inventory-node') var selected = $('#tree-view').jstree('get_selected'); - scope['inventorySummaryGroup'] = group_name; + scope['inventorySummaryGroup'] = null; selected.each(function(idx) { $('#tree-view').jstree('deselect_node', $(this)); }); diff --git a/awx/ui/static/js/helpers/search.js b/awx/ui/static/js/helpers/search.js index ecd693fd6c..6e42d74ae0 100644 --- a/awx/ui/static/js/helpers/search.js +++ b/awx/ui/static/js/helpers/search.js @@ -148,11 +148,13 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper']) scope.search(iterator); } - scope.search = function(iterator, page) { + scope.search = function(iterator, page, load, spin) { // Page is optional. Added to accomodate back function on Job Events detail. + // Spin optional -set to false if spin not desired. + // Load optional -set to false if loading message not desired - scope[iterator + 'SearchSpin'] = true; - scope[iterator + 'Loading'] = true; + scope[iterator + 'SearchSpin'] = (spin == undefined || spin == true) ? true : false; + scope[iterator + 'Loading'] = (load == undefined || load == true) ? true : false; scope[iterator + 'SearchParms'] = ''; var url = defaultUrl; diff --git a/awx/ui/static/js/widgets/SCMSyncStatus.js b/awx/ui/static/js/widgets/SCMSyncStatus.js index d814f4e41a..f9012ab0b3 100644 --- a/awx/ui/static/js/widgets/SCMSyncStatus.js +++ b/awx/ui/static/js/widgets/SCMSyncStatus.js @@ -70,7 +70,7 @@ angular.module('SCMSyncStatusWidget', ['RestServices', 'Utilities']) } } if (rowcount == 0) { - html += "No projects conigured for SCM sync\n"; + html += "No projects configured for SCM sync\n"; } html += "\n"; diff --git a/awx/ui/static/lib/ansible/license.js b/awx/ui/static/lib/ansible/license.js index 3051f83d58..bb12424be6 100644 --- a/awx/ui/static/lib/ansible/license.js +++ b/awx/ui/static/lib/ansible/license.js @@ -8,9 +8,9 @@ 'use strict'; angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'PromptDialog']) - .factory('ViewLicense', ['$location', 'GenerateForm', 'Rest', 'Alert', 'GetBasePath', 'ProcessErrors', + .factory('ViewLicense', ['$location', '$rootScope', 'GenerateForm', 'Rest', 'Alert', 'GetBasePath', 'ProcessErrors', 'FormatDate', 'Prompt', - function($location, GenerateForm, Rest, Alert, GetBasePath, ProcessErrors, FormatDate, Prompt) { + function($location, $rootScope, GenerateForm, Rest, Alert, GetBasePath, ProcessErrors, FormatDate, Prompt) { return function() { var defaultUrl=GetBasePath('config'); @@ -201,7 +201,7 @@ angular.module('License', ['RestServices', 'Utilities', 'FormGenerator', 'Prompt }) .error( function(data, status, headers, config) { - ProcessErrors(scope, data, status, form, + ProcessErrors($rootScope, data, status, form, { hdr: 'Error!', msg: 'Failed to retrieve license. GET status: ' + status }); }); }