Merge pull request #467 from travis-ci/ps-pendo.io
Add pendo.io integration
This commit is contained in:
commit
20b72e5f10
|
@ -7,9 +7,11 @@ export default TravisRoute.extend(BuildFaviconMixin, {
|
||||||
|
|
||||||
beforeModel() {
|
beforeModel() {
|
||||||
this._super.apply(this, arguments);
|
this._super.apply(this, arguments);
|
||||||
return this.get('auth').refreshUserData().then((function() {}), (() => {
|
return this.get('auth').refreshUserData().then( () => {
|
||||||
|
this.setupPendo();
|
||||||
|
}, () => {
|
||||||
return this.get('auth').signOut();
|
return this.get('auth').signOut();
|
||||||
}));
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
renderTemplate: function() {
|
renderTemplate: function() {
|
||||||
|
@ -60,6 +62,24 @@ export default TravisRoute.extend(BuildFaviconMixin, {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
setupPendo() {
|
||||||
|
if(!window.pendo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let user = this.get('auth.currentUser');
|
||||||
|
|
||||||
|
var options = {
|
||||||
|
visitor: {
|
||||||
|
id: user.get('id'),
|
||||||
|
github_login: user.get('login'),
|
||||||
|
email: user.get('email')
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
window.pendo.identify(options);
|
||||||
|
},
|
||||||
|
|
||||||
actions: {
|
actions: {
|
||||||
redirectToGettingStarted() {
|
redirectToGettingStarted() {
|
||||||
// do nothing, we handle it only in index path
|
// do nothing, we handle it only in index path
|
||||||
|
@ -88,6 +108,7 @@ export default TravisRoute.extend(BuildFaviconMixin, {
|
||||||
|
|
||||||
afterSignIn() {
|
afterSignIn() {
|
||||||
var transition;
|
var transition;
|
||||||
|
this.setupPendo();
|
||||||
if (transition = this.auth.get('afterSignInTransition')) {
|
if (transition = this.auth.get('afterSignInTransition')) {
|
||||||
this.auth.set('afterSignInTransition', null);
|
this.auth.set('afterSignInTransition', null);
|
||||||
return transition.retry();
|
return transition.retry();
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
|
"ember-cli-htmlbars-inline-precompile": "^0.3.1",
|
||||||
"ember-cli-inject-live-reload": "^1.3.1",
|
"ember-cli-inject-live-reload": "^1.3.1",
|
||||||
"ember-cli-inline-images": "^0.0.4",
|
"ember-cli-inline-images": "^0.0.4",
|
||||||
|
"ember-cli-pendo": "drogus/ember-cli-pendo",
|
||||||
"ember-cli-pretender": "0.3.1",
|
"ember-cli-pretender": "0.3.1",
|
||||||
"ember-cli-qunit": "^1.2.1",
|
"ember-cli-qunit": "^1.2.1",
|
||||||
"ember-cli-release": "0.2.8",
|
"ember-cli-release": "0.2.8",
|
||||||
|
|
|
@ -73,5 +73,6 @@ run Travis::Web::App.build(
|
||||||
code_climate_url: ENV['CODE_CLIMATE_URL'],
|
code_climate_url: ENV['CODE_CLIMATE_URL'],
|
||||||
assets_host: ENV['ASSETS_HOST'],
|
assets_host: ENV['ASSETS_HOST'],
|
||||||
ajax_polling: ENV['AJAX_POLLING'],
|
ajax_polling: ENV['AJAX_POLLING'],
|
||||||
github_orgs_oauth_access_settings_url: ENV['GITHUB_ORGS_OAUTH_ACCESS_SETTINGS_URL']
|
github_orgs_oauth_access_settings_url: ENV['GITHUB_ORGS_OAUTH_ACCESS_SETTINGS_URL'],
|
||||||
|
pendo_key: ENV['PENDO_KEY']
|
||||||
)
|
)
|
||||||
|
|
|
@ -191,6 +191,8 @@ class Travis::Web::App
|
||||||
pusher['path'] = options[:pusher_path] if options[:pusher_path]
|
pusher['path'] = options[:pusher_path] if options[:pusher_path]
|
||||||
config['pusher'] = pusher
|
config['pusher'] = pusher
|
||||||
|
|
||||||
|
config['ember-cli-pendo'] = { apiKey: options[:pendo_key] }
|
||||||
|
|
||||||
config['gaCode'] = options[:ga_code] if options[:ga_code]
|
config['gaCode'] = options[:ga_code] if options[:ga_code]
|
||||||
config['pro'] = options[:pro] if options[:pro]
|
config['pro'] = options[:pro] if options[:pro]
|
||||||
config['enterprise'] = options[:enterprise] if options[:enterprise]
|
config['enterprise'] = options[:enterprise] if options[:enterprise]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user