From 109c9d8832aa7d4decc7faee61dfd355f71265f8 Mon Sep 17 00:00:00 2001 From: Joe Fiorini Date: Wed, 4 Feb 2015 17:10:42 -0500 Subject: [PATCH] Do not try to render home template on login/logout --- awx/ui/static/js/app.js | 4 ++-- .../static/js/directives/auto-size-module.js | 20 +------------------ .../js/services/host-count-graph-data.js | 2 +- .../js/services/job-status-graph-data.js | 2 +- awx/ui/static/partials/home.html | 2 +- 5 files changed, 6 insertions(+), 24 deletions(-) diff --git a/awx/ui/static/js/app.js b/awx/ui/static/js/app.js index eaa5c10bdd..965ca96f6f 100644 --- a/awx/ui/static/js/app.js +++ b/awx/ui/static/js/app.js @@ -387,12 +387,12 @@ angular.module('Tower', [ }). when('/login', { - templateUrl: urlPrefix + 'partials/home.html', + templateUrl: urlPrefix + 'partials/blank.html', controller: 'Authenticate' }). when('/logout', { - templateUrl: urlPrefix + 'partials/home.html', + templateUrl: urlPrefix + 'partials/blank.html', controller: 'Authenticate' }). diff --git a/awx/ui/static/js/directives/auto-size-module.js b/awx/ui/static/js/directives/auto-size-module.js index 2df92c53fd..e1851de160 100644 --- a/awx/ui/static/js/directives/auto-size-module.js +++ b/awx/ui/static/js/directives/auto-size-module.js @@ -1,5 +1,5 @@ angular.module('DashboardGraphs') -.directive('autoSizeModule', ['$window', '$timeout', function($window, $timeout) { +.directive('autoSizeModule', ['$window', function($window) { // Adjusts the size of the module so that all modules // fit into a single a page; assumes there are 2 rows @@ -7,19 +7,8 @@ angular.module('DashboardGraphs') // by the navbar & the count summaries module return function(scope, element) { - // We need to trigger a resize on the first call - // to this when the view things load; but we don't want - // to trigger a global window resize for everything that - // has an auto resize, since they'll all pick it up with - // a single call - var triggerResize = - _.throttle(function() { - $($window).resize(); - }, 1000); - function adjustSizeInitially() { adjustSize(); - triggerResize(); } function adjustSize() { @@ -34,17 +23,10 @@ angular.module('DashboardGraphs') $($window).off('resize', adjustSize); }); - // Wait a second or until dashboardReady triggers, - // whichever comes first. The timeout handles cases - // where dashboardReady never fires. - - var dashboardReadyTimeout = $timeout(adjustSizeInitially, 500); - // This makes sure count-container div is loaded // by controllers/Home.js before we use it // to determine the available window height scope.$on('dashboardReady', function() { - $timeout.cancel(dashboardReadyTimeout); adjustSizeInitially(); }); diff --git a/awx/ui/static/js/services/host-count-graph-data.js b/awx/ui/static/js/services/host-count-graph-data.js index 4bc1f817c3..e44525a735 100644 --- a/awx/ui/static/js/services/host-count-graph-data.js +++ b/awx/ui/static/js/services/host-count-graph-data.js @@ -40,7 +40,7 @@ function HostCountGraphData(Rest, getBasePath, processErrors, $q) { processErrors(null, response.data, response.status, null, { hdr: 'Error!', msg: errorMessage }); - return response; + throw response; }); } }; diff --git a/awx/ui/static/js/services/job-status-graph-data.js b/awx/ui/static/js/services/job-status-graph-data.js index 242368fc0f..e590bb7682 100644 --- a/awx/ui/static/js/services/job-status-graph-data.js +++ b/awx/ui/static/js/services/job-status-graph-data.js @@ -28,7 +28,7 @@ function JobStatusGraphData(Rest, getBasePath, processErrors, $rootScope) { hdr: 'Error!', msg: errorMessage }); - return response; + throw response; }); return pluck('data', result); diff --git a/awx/ui/static/partials/home.html b/awx/ui/static/partials/home.html index 095222dff4..dc70714683 100644 --- a/awx/ui/static/partials/home.html +++ b/awx/ui/static/partials/home.html @@ -1,5 +1,5 @@ -
+