From fa4dd9a335788ed212d9d963da02ee1bfbdb09a9 Mon Sep 17 00:00:00 2001 From: Jared Tabor Date: Thu, 8 Oct 2015 11:14:24 -0400 Subject: [PATCH] load pa.min.js for pendo on demand courtesy of our friends at Pendo --- awx/ui/client/src/app.js | 3 +++ .../client/src/login/authenticationServices/pendo.service.js | 4 ++++ awx/ui/templates/ui/index.html | 3 ++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/awx/ui/client/src/app.js b/awx/ui/client/src/app.js index 36f416a268..cfdfa540d1 100644 --- a/awx/ui/client/src/app.js +++ b/awx/ui/client/src/app.js @@ -187,6 +187,9 @@ var tower = angular.module('Tower', [ .constant('AngularScheduler.useTimezone', true) .constant('AngularScheduler.showUTCField', true) .constant('$timezones.definitions.location', urlPrefix + 'lib/angular-tz-extensions/tz/data') + .config(function($pendolyticsProvider) { + $pendolyticsProvider.doNotAutoStart(); + }) .config(['$routeProvider', function ($routeProvider) { $routeProvider. diff --git a/awx/ui/client/src/login/authenticationServices/pendo.service.js b/awx/ui/client/src/login/authenticationServices/pendo.service.js index e20002f6a7..a6a5917799 100644 --- a/awx/ui/client/src/login/authenticationServices/pendo.service.js +++ b/awx/ui/client/src/login/authenticationServices/pendo.service.js @@ -100,6 +100,7 @@ export default config = response.license_info; config.analytics_status = response.analytics_status; if(config.analytics_status !== 'off'){ + $pendolytics.bootstrap(); deferred.resolve(config); } else { @@ -115,6 +116,7 @@ export default }); } else if(config.analytics_status !== 'off'){ + $pendolytics.bootstrap(); deferred.resolve(config); } else { @@ -128,6 +130,8 @@ export default this.getConfig().then(function(config){ var options = that.setPendoOptions(config); that.setRole(options).then(function(options){ + $log.debug('Pendo status is '+ config.analytics_status + '. Object below:'); + $log.debug(options); $pendolytics.identify(options); }, function(reason){ // reject function for setRole diff --git a/awx/ui/templates/ui/index.html b/awx/ui/templates/ui/index.html index c796f29527..78ea04bdb4 100644 --- a/awx/ui/templates/ui/index.html +++ b/awx/ui/templates/ui/index.html @@ -26,7 +26,8 @@ - + +