diff --git a/awx/ui/client/src/about/about.controller.js b/awx/ui/client/src/about/about.controller.js index 678b3ba1ff..90824532db 100644 --- a/awx/ui/client/src/about/about.controller.js +++ b/awx/ui/client/src/about/about.controller.js @@ -1,5 +1,5 @@ export default - ['$scope', '$state', 'CheckLicense', function($scope, $state, CheckLicense){ + ['$scope', '$state', 'ConfigService', function($scope, $state, ConfigService){ var processVersion = function(version){ // prettify version & calculate padding // e,g 3.0.0-0.git201602191743/ -> 3.0.0 @@ -16,10 +16,10 @@ export default return paddedStr; }; var init = function(){ - CheckLicense.get() - .then(function(res){ - $scope.subscription = res.data.license_info.subscription_name; - $scope.version = processVersion(res.data.version); + ConfigService.getConfig() + .then(function(config){ + $scope.subscription = config.license_info.subscription_name; + $scope.version = processVersion(config.version); $('#about-modal').modal('show'); }); }; diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index c98714b353..40d9b1e419 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -872,6 +872,7 @@ var tower = angular.module('Tower', [ // User not authenticated, redirect to login page $rootScope.sessionExpired = false; $cookieStore.put('sessionExpired', false); + $rootScope.configReady = true; $location.path('/login'); } else { // If browser refresh, set the user_is_superuser value diff --git a/awx/ui/client/src/forms/JobTemplates.js b/awx/ui/client/src/forms/JobTemplates.js index 0636888ee6..2751a50f13 100644 --- a/awx/ui/client/src/forms/JobTemplates.js +++ b/awx/ui/client/src/forms/JobTemplates.js @@ -323,6 +323,7 @@ export default }, edit_survey: { ngClick: 'editSurvey()', + awFeature: 'surveys', ngShow: 'job_type.value !== "scan" && survey_exists' }, cancel: { diff --git a/awx/ui/client/src/login/loginModal/loginModal.controller.js b/awx/ui/client/src/login/loginModal/loginModal.controller.js index 48d377ae15..7fac933e9c 100644 --- a/awx/ui/client/src/login/loginModal/loginModal.controller.js +++ b/awx/ui/client/src/login/loginModal/loginModal.controller.js @@ -64,6 +64,7 @@ export default ['$log', '$cookieStore', '$compile', '$window', '$rootScope', var lastPath, lastUser, sessionExpired, loginAgain; + $rootScope.configReady = true; loginAgain = function() { setTimeout(function() { $location.path('/logout'); diff --git a/awx/ui/client/src/shared/config/config.service.js b/awx/ui/client/src/shared/config/config.service.js index 95d1a0f86a..edf476cc35 100644 --- a/awx/ui/client/src/shared/config/config.service.js +++ b/awx/ui/client/src/shared/config/config.service.js @@ -6,8 +6,8 @@ export default - ['GetBasePath', 'ProcessErrors', '$q', 'Rest', '$rootScope', - function (GetBasePath, ProcessErrors, $q, Rest, $rootScope) { + ['GetBasePath', 'ProcessErrors', '$q', 'Rest', '$rootScope', 'Wait', + function (GetBasePath, ProcessErrors, $q, Rest, $rootScope, Wait) { return { get: function(){ return this.config; @@ -28,9 +28,12 @@ export default if(_.isEmpty(config)){ var url = GetBasePath('config'); Rest.setUrl(url); + Wait('start'); var promise = Rest.get(); promise.then(function (response) { var config = response.data; + $rootScope.configReady = true; + Wait('stop'); that.set(config); deferred.resolve(response.data); }); diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index 98f4110cd2..1af1ff9479 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -46,7 +46,7 @@