From f2641e8936ed2e3f2312e3a70423a3e5b8c7c8f8 Mon Sep 17 00:00:00 2001 From: Abe Massry Date: Wed, 19 Oct 2016 08:42:14 -0400 Subject: [PATCH 1/2] adding webengage for test --- index.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/index.html b/index.html index 965a1993cd5..f8149c6e347 100644 --- a/index.html +++ b/index.html @@ -11,4 +11,9 @@ + From d6de4099bced9d6441cb5a49a873bdaf3ac47371 Mon Sep 17 00:00:00 2001 From: Abe Massry Date: Wed, 19 Oct 2016 14:43:16 -0400 Subject: [PATCH 2/2] adding webengage for feedback --- index.html | 8 +++----- karma.conf.js | 3 ++- src/constants.js | 1 + src/index.js | 13 +++++++++++-- webpack.config.dev.js | 3 ++- webpack.config.prod.js | 3 ++- 6 files changed, 21 insertions(+), 10 deletions(-) diff --git a/index.html b/index.html index f8149c6e347..0d1e84fc4a2 100644 --- a/index.html +++ b/index.html @@ -8,12 +8,10 @@
+ - diff --git a/karma.conf.js b/karma.conf.js index bb5a9fdf485..6e0835b76ae 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -59,7 +59,8 @@ module.exports = function(config) { ENV_API_ROOT: null, ENV_LOGIN_ROOT: null, ENV_APP_ROOT: null, - ENV_GA_ID: null + ENV_GA_ID: null, + ENV_WEBENGAGE_ID: null }), new CircularDependencyPlugin({ failOnError: true, diff --git a/src/constants.js b/src/constants.js index 4c05bff1be1..9dbc40ab5d3 100644 --- a/src/constants.js +++ b/src/constants.js @@ -2,6 +2,7 @@ export const API_ROOT = ENV_API_ROOT || 'https://api.alpha.linode.com/v4'; // es export const LOGIN_ROOT = ENV_LOGIN_ROOT || 'https://login.alpha.linode.com'; // eslint-disable-line no-undef export const APP_ROOT = ENV_APP_ROOT || 'http://localhost:3000'; // eslint-disable-line no-undef export const GA_ID = ENV_GA_ID || '000000'; // eslint-disable-line no-undef +export const WEBENGAGE_ID = ENV_WEBENGAGE_ID || ''; // eslint-disable-line no-undef export const LinodeStates = { pending: [ diff --git a/src/index.js b/src/index.js index 3146d259b5b..8dabbf1bf27 100644 --- a/src/index.js +++ b/src/index.js @@ -7,7 +7,8 @@ import { Router, Route, IndexRedirect, browserHistory } from 'react-router'; import DevTools from './components/DevTools'; import { syncHistoryWithStore } from 'react-router-redux'; import ReactGA from 'react-ga'; -import { GA_ID } from './constants'; +import { GA_ID, WEBENGAGE_ID } from './constants'; +import { getStorage } from './storage'; import checkLogin, { initializeAuthentication } from './session'; @@ -67,5 +68,13 @@ const init = () => { document.getElementById('root') ); }; - +if (window.webengage) { // eslint-disable-line no-undef + webengage.init(WEBENGAGE_ID); // eslint-disable-line no-undef + webengage.feedback.options('formData', [ // eslint-disable-line no-undef + { + name: 'email', + value: getStorage('authentication/email'), + }, + ]); +} window.init = init; diff --git a/webpack.config.dev.js b/webpack.config.dev.js index 97c83342e1c..c9891206d69 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -22,7 +22,8 @@ module.exports = { 'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT), 'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT), 'ENV_APP_ROOT': JSON.stringify(process.env.APP_ROOT), - 'ENV_GA_ID': JSON.stringify(process.env.GA_ID) + 'ENV_GA_ID': JSON.stringify(process.env.GA_ID), + 'ENV_WEBENGAGE_ID': JSON.stringify(process.env.WEBENGAGE_ID) }) ], module: { diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 38d3fdae564..fc0154c9cc0 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -13,7 +13,8 @@ _.plugins = [ 'ENV_APP_ROOT': JSON.stringify(process.env.APP_ROOT), 'ENV_API_ROOT': JSON.stringify(process.env.API_ROOT), 'ENV_LOGIN_ROOT': JSON.stringify(process.env.LOGIN_ROOT), - 'ENV_GA_ID': JSON.stringify(process.env.GA_ID) + 'ENV_GA_ID': JSON.stringify(process.env.GA_ID), + 'ENV_WEBENGAGE_ID': JSON.stringify(process.env.WEBENGAGE_ID) }), new webpack.optimize.UglifyJsPlugin({ compressor: {