Merge pull request #213 from ascribe/feature/privacy

Remove all the tracking
This commit is contained in:
Matthias Kretschmann 2018-05-24 11:53:22 +02:00 committed by GitHub
commit 07697ac1a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 10 additions and 443 deletions

View File

@ -33,7 +33,6 @@
"react/wrap-multilines": 1
},
"globals": {
"Intercom": true,
"fetch": true,
"require": true,
"File": true

View File

@ -23,29 +23,10 @@
<% DEBUG && print('window.CREDENTIALS = \'' + CREDENTIALS + '\''); %>
</script>
<!-- Typekit gibson font -->
<script src="https://use.typekit.net/gma2yhj.js"></script>
<script>
try {Typekit.load({ async: true });}
catch(e){}
</script>
<link rel="stylesheet" href="https://use.typekit.net/gma2yhj.css">
</head>
<body>
<div id="main"></div>
<!-- Google Analytics tracking code -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
</script>
<!-- Intercom library -->
<script>
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;
s.src='https://widget.intercom.io/widget/{app_id}';
var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()
</script>
<!-- actual app -->
<script src="<%= BASE_URL %>static/js/app.js"></script>

View File

@ -1,14 +0,0 @@
'use strict';
import { altThirdParty } from '../alt';
class FacebookActions {
constructor() {
this.generateActions(
'sdkReady'
);
}
}
export default altThirdParty.createActions(FacebookActions);

View File

@ -24,12 +24,7 @@ import EventActions from './actions/event_actions';
// You can comment out the modules you don't need
// import DebugHandler from './third_party/debug_handler';
import FacebookHandler from './third_party/facebook_handler';
import GoogleAnalyticsHandler from './third_party/ga_handler';
import IntercomHandler from './third_party/intercom_handler';
import NotificationsHandler from './third_party/notifications_handler';
import RavenHandler from './third_party/raven_handler';
const AppGateway = {
start() {

View File

@ -230,13 +230,6 @@ let CoaDetails = React.createClass({
coaError: React.PropTypes.object
},
contactOnIntercom() {
const { coaError, editionId } = this.props;
window.Intercom('showNewMessage', getLangText("Hi, I'm having problems generating a Certificate of Authenticity for Edition: %s", editionId));
console.logGlobal(new Error(`Coa couldn't be created for edition: ${editionId}`), coaError);
},
render() {
const { coa, coaError } = this.props;
let coaDetailElement;
@ -246,7 +239,7 @@ let CoaDetails = React.createClass({
<p>{getLangText('There was an error generating your Certificate of Authenticity.')}</p>,
<p>
{getLangText('Try to refresh the page. If this happens repeatedly, please ')}
<a style={{ cursor: 'pointer' }} onClick={this.contactOnIntercom}>{getLangText('contact us')}</a>.
<a style={{ cursor: 'pointer' }} href="mailto:support@ascribe.io">{getLangText('contact us')}</a>.
</p>
];
} else if (coa && coa.url_safe) {

View File

@ -7,9 +7,6 @@ import ProgressBar from 'react-bootstrap/lib/ProgressBar';
import MediaPlayer from './../ascribe_media/media_player';
import FacebookShareButton from '../ascribe_social_share/facebook_share_button';
import TwitterShareButton from '../ascribe_social_share/twitter_share_button';
import S3DownloadButton from '../ascribe_buttons/s3_download_button';
import CollapsibleButton from './../ascribe_collapsible/collapsible_button';
@ -159,11 +156,6 @@ let MediaContainer = React.createClass({
extraData={extraData}
encodingMessage={this.getEncodingMessage()} />
<p className="text-center hidden-print">
<span className="ascribe-social-button-list">
<FacebookShareButton />
<TwitterShareButton
text={getLangText('Check out %s ascribed piece', didUserRegisterContent ? 'my latest' : 'this' )} />
</span>
<AclProxy
show={['video', 'audio', 'image'].indexOf(mimetype) === -1 || content.acl.acl_download}
aclObject={content.acl}

View File

@ -1,69 +0,0 @@
'use strict';
import React from 'react';
import FacebookHandler from '../../third_party/facebook_handler';
import AppConstants from '../../constants/application_constants';
import { InjectInHeadUtils } from '../../utils/inject_utils';
let FacebookShareButton = React.createClass({
propTypes: {
type: React.PropTypes.string
},
getDefaultProps() {
return {
type: 'button'
};
},
getInitialState() {
return FacebookHandler.getState();
},
componentDidMount() {
FacebookHandler.listen(this.onChange);
this.loadFacebook();
},
shouldComponentUpdate(nextProps, nextState) {
// Don't update if the props haven't changed or the FB SDK loading status is still the same
return this.props.type !== nextProps.type || nextState.loaded !== this.state.loaded;
},
componentDidUpdate() {
// If the component changes, we need to reparse the share button's XFBML.
// To prevent cases where the Facebook SDK hasn't been loaded yet at this stage,
// let's make sure that it's injected before trying to reparse.
this.loadFacebook();
},
onChange(state) {
this.setState(state);
},
loadFacebook() {
InjectInHeadUtils
.inject(AppConstants.facebook.sdkUrl)
.then(() => {
if (this.state.loaded) {
FB.XFBML.parse(this.refs.fbShareButton.getDOMNode().parent)
}
});
},
render() {
return (
<span
ref="fbShareButton"
className="fb-share-button btn btn-ascribe-social"
data-layout={this.props.type}>
</span>
);
}
});
export default FacebookShareButton;

View File

@ -1,55 +0,0 @@
'use strict';
import React from 'react';
import AppConstants from '../../constants/application_constants';
import { InjectInHeadUtils } from '../../utils/inject_utils';
let TwitterShareButton = React.createClass({
propTypes: {
count: React.PropTypes.string,
counturl: React.PropTypes.string,
hashtags: React.PropTypes.string,
size: React.PropTypes.string,
text: React.PropTypes.string,
url: React.PropTypes.string,
via: React.PropTypes.string
},
getDefaultProps() {
return {
count: 'none',
via: 'ascribeIO'
};
},
componentDidMount() {
InjectInHeadUtils.inject(AppConstants.twitter.sdkUrl).then(this.loadTwitterButton);
},
loadTwitterButton() {
const { count, counturl, hashtags, size, text, url, via } = this.props;
twttr.widgets.createShareButton(url, this.refs.twitterShareButton.getDOMNode(), {
count,
counturl,
hashtags,
size,
text,
via,
dnt: true // Do not track
});
},
render() {
return (
<span
ref="twitterShareButton"
className="btn btn-ascribe-social">
</span>
);
}
});
export default TwitterShareButton;

View File

@ -17,18 +17,12 @@ let FileDragAndDropErrorDialog = React.createClass({
handleRetryFiles: React.PropTypes.func.isRequired
},
getRetryButton(text, openIntercom) {
getRetryButton(text) {
return (
<button
type="button"
className='btn btn-default'
onClick={() => {
if (openIntercom) {
window.Intercom('showNewMessage', getLangText("I'm having trouble uploading my file."));
}
this.retryAllFiles()
}}>
onClick={() => this.retryAllFiles()}>
{getLangText(text)}
</button>
);

View File

@ -13,10 +13,6 @@ const MarketErrorConsignUnavailable = React.createClass({
handleSuccess: React.PropTypes.func
},
contactOnIntercom() {
window.Intercom('showNewMessage', getLangText("Hi, I'm having problems consigning to %s", this.props.whitelabelName));
},
render() {
const { editions, handleSuccess, whitelabelName } = this.props;
const multipleEditions = editions.length > 1;
@ -39,7 +35,7 @@ const MarketErrorConsignUnavailable = React.createClass({
{getLangText('If this seems incorrect, or if you would still like to consign %s to %s, please ',
multipleEditions ? 'these Editions' : 'this Edition',
whitelabelName)}
<strong><a style={{ cursor: 'pointer' }} onClick={this.contactOnIntercom}>{getLangText('contact us')}</a></strong>.
<strong><a style={{ cursor: 'pointer' }} href="mailto:support@ascribe.io">{getLangText('contact us')}</a></strong>.
</p>
<button className='btn btn-default btn-wide' onClick={handleSuccess}>
{getLangText('OK')}

View File

@ -24,14 +24,12 @@ const constants = {
{
'subdomain': 'cc',
'name': 'Creative Commons France',
'type': 'wallet',
'ga': 'UA-60614729-4'
'type': 'wallet'
},
{
'subdomain': 'sluice',
'name': 'Sluice Art Fair',
'type': 'prize',
'ga': 'UA-60614729-5'
'type': 'prize'
},
{
'subdomain': 'cyland',
@ -85,8 +83,7 @@ const constants = {
},
],
'defaultDomain': {
'type': 'default',
'ga': 'UA-60614729-2'
'type': 'default'
},
// These are all possible types that are currently supported in HTML5 for the input element
@ -131,16 +128,6 @@ const constants = {
'sdkUrl': '//vjs.zencdn.net/4.12/video.js',
'cssUrl': '//vjs.zencdn.net/4.12/video-js.css'
},
'raven': {
'url': 'https://836bfb71c9c7418a967351d39ce547f0@app.getsentry.com/48351'
},
'facebook': {
'appId': '420813844732240',
'sdkUrl': '//connect.facebook.net/en_US/sdk.js'
},
'twitter': {
'sdkUrl': 'https://platform.twitter.com/widgets.js'
},
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net',
'errorMessagesToIgnore': [
'Authentication credentials were not provided.',

View File

@ -1,39 +0,0 @@
'use strict';
import { altThirdParty } from '../alt';
import EventActions from '../actions/event_actions';
import FacebookActions from '../actions/facebook_actions';
import AppConstants from '../constants/application_constants'
class FacebookHandler {
constructor() {
this.loaded = false;
this.bindActions(EventActions);
this.bindActions(FacebookActions);
}
onApplicationWillBoot(settings) {
// Callback function that FB's sdk will call when it's finished loading
// See https://developers.facebook.com/docs/javascript/quickstart/v2.5
window.fbAsyncInit = () => {
FB.init({
appId: AppConstants.facebook.appId,
// Don't parse anything on the first load as we will parse all XFBML components as necessary.
xfbml: false,
version: 'v2.5',
cookie: false
});
FacebookActions.sdkReady();
};
}
onSdkReady() {
this.loaded = true;
}
}
export default altThirdParty.createStore(FacebookHandler, 'FacebookHandler');

View File

@ -1,26 +0,0 @@
'use strict';
import { altThirdParty } from '../alt';
import EventActions from '../actions/event_actions';
class GoogleAnalyticsHandler {
constructor() {
this.bindActions(EventActions);
}
onRouteDidChange() {
window.ga('send', 'pageview');
}
onApplicationWillBoot(settings) {
if (settings.ga) {
window.ga('create', settings.ga, 'auto');
console.log('Google Analytics loaded');
} else {
console.log('Cannot load Google Analytics: no tracking code provided');
}
}
}
export default altThirdParty.createStore(GoogleAnalyticsHandler, 'GoogleAnalyticsHandler');

View File

@ -1,39 +0,0 @@
'use strict';
import { altThirdParty } from '../alt';
import EventActions from '../actions/event_actions';
import { getSubdomain } from '../utils/general_utils';
class IntercomHandler {
constructor() {
this.bindActions(EventActions);
this.loaded = false;
}
onUserDidAuthenticate(user) {
if (this.loaded) {
return;
}
window.Intercom('boot', {
app_id: 'oboxh5w1',
email: user.email,
subdomain: getSubdomain(),
widget: {
activator: '#IntercomDefaultWidget'
}
});
console.log('Intercom loaded');
this.loaded = true;
}
onUserDidLogout() {
// kill intercom (with fire)
window.Intercom('shutdown');
this.loaded = false;
}
}
export default altThirdParty.createStore(IntercomHandler, 'IntercomHandler');

View File

@ -1,33 +0,0 @@
'use strict';
import { altThirdParty } from '../alt';
import EventActions from '../actions/event_actions';
import Raven from 'raven-js';
class RavenHandler {
constructor() {
this.bindActions(EventActions);
this.loaded = false;
}
onUserDidAuthenticate(user) {
if (this.loaded) {
return;
}
Raven.setUserContext({
email: user.email
});
console.log('Raven loaded');
this.loaded = true;
}
onUserDidLogout() {
Raven.setUserContext();
this.loaded = false;
}
}
export default altThirdParty.createStore(RavenHandler, 'RavenHandler');

View File

@ -1,18 +1,14 @@
'use strict';
import Raven from 'raven-js';
import AppConstants from '../constants/application_constants';
/**
* Logs an error in to the console but also sends it to
* Sentry.
* Logs an error in to the console.
* Optionally, a comment can be defined.
* @param {Error} error a Javascript error
* @param {boolean} ignoreSentry Defines whether or not the error should be submitted to Sentry
* @param {string} comment Will also be submitted to Sentry, but will not be logged
*/
function logGlobal(error, comment, ignoreSentry) {
function logGlobal(error, comment) {
console.error(error);
if (error.hasOwnProperty('json')) {
@ -21,21 +17,9 @@ function logGlobal(error, comment, ignoreSentry) {
json: error.json
};
}
if (!ignoreSentry) {
Raven.captureException(error, comment ? { extra: { comment } } : undefined);
}
}
export function initLogging() {
// Initialize Raven for logging on Sentry
Raven.config(AppConstants.raven.url, {
release: AppConstants.version,
ignoreErrors: AppConstants.errorMessagesToIgnore
}).install();
window.onerror = Raven.process;
console.logGlobal = logGlobal;
}

View File

@ -105,7 +105,6 @@
"opn": "^3.0.2",
"q": "^1.4.1",
"query-string": "^3.0.0",
"raven-js": "^1.1.19",
"react": "0.13.2",
"react-bootstrap": "0.25.1",
"react-datepicker": "^0.12.0",

View File

@ -534,11 +534,6 @@ fieldset[disabled] .btn-secondary.active {
.ascribe-panel-wrapper {
border: 1px solid $ascribe-blue-border;
}
// intercom stuff
#intercom-container .intercom-launcher-button {
background-color: $ascribe--button-default-color !important;
border-color: $ascribe--button-default-color !important;
}
// notifications

View File

@ -144,10 +144,4 @@ $pr--button-color: $pr--nav-fg-prim-color;
text-transform: capitalize;
}
}
// intercom
#intercom-container .intercom-launcher-button {
background-color: $pr--button-color !important;
border-color: $pr--button-color !important;
}
}

View File

@ -155,14 +155,6 @@
}
}
// intercom stuff
.client--sluice {
#intercom-container .intercom-launcher-button {
background-color: $simple-prize--button-color !important;;
border-color: $simple-prize--button-color !important;;
}
}
// notifications
.client--sluice .ascribe-global-notification-success {
background-color: lighten($simple-prize--button-color, 50%);

View File

@ -365,10 +365,4 @@ $vivi23--highlight-color: #2882fa;
background-color: $vivi23--fg-color !important;
border-color: $vivi23--fg-color;
}
// intercom
#intercom-container .intercom-launcher-button {
background-color: $vivi23--button-default-color !important;
border-color: $vivi23--button-default-color !important;
}
}

View File

@ -409,10 +409,4 @@ $artcity--ter-highlight-color: #EDEDF0;
border-color: $artcity--ter-highlight-color;
}
}
// intercom
#intercom-container .intercom-launcher-button {
background-color: $artcity--button-default-color !important;
border-color: $artcity--button-default-color !important;
}
}

View File

@ -186,14 +186,6 @@ $bokk--nav-bt:#FFFFFF;
}
}
// intercom stuff
.client--bokk {
#intercom-container .intercom-launcher-button {
background-color: $bokk--button-color !important;;
border-color: $bokk--button-color !important;;
}
}
// notifications
.client--bokk .ascribe-global-notification-success {
background-color: lighten($bokk--button-color, 50%);

View File

@ -178,14 +178,6 @@ $cc--button-color: $cc--nav-fg-prim-color;
}
}
// intercom stuff
.client--cc {
#intercom-container .intercom-launcher-button {
background-color: $cc--button-color !important;;
border-color: $cc--button-color !important;;
}
}
// notifications
.client--cc .ascribe-global-notification-success {
background-color: lighten($cc--button-color, 50%);

View File

@ -197,14 +197,6 @@ $cyland--button-sec-color: #515151;
}
}
// intercom stuff
.client--cyland {
#intercom-container .intercom-launcher-button {
background-color: $cyland--button-color !important;;
border-color: $cyland--button-color !important;;
}
}
// notifications
.client--cyland .ascribe-global-notification-success {
background-color: lighten($cyland--button-color, 50%);

View File

@ -515,15 +515,6 @@ $ikono--font: 'Helvetica Neue', 'Helvetica', sans-serif !important;
}
// intercom stuff
.client--ikonotv {
#intercom-container .intercom-launcher-button {
background-color: $ikono--button-color !important;;
border-color: $ikono--button-color !important;;
}
}
// notifications
.client--ikonotv .ascribe-global-notification-success {
background-color: lighten($ikono--button-color, 20%);

View File

@ -375,10 +375,4 @@ $market--highlight-color: #2882fa;
background-color: $market--fg-color !important;
border-color: $market--fg-color;
}
// intercom
#intercom-container .intercom-launcher-button {
background-color: $market--button-default-color !important;
border-color: $market--button-default-color !important;
}
}

View File

@ -380,10 +380,4 @@ $polline--highlight-color: #2882fa;
background-color: $polline--fg-color !important;
border-color: $polline--fg-color;
}
// intercom
#intercom-container .intercom-launcher-button {
background-color: $polline--button-default-color !important;
border-color: $polline--button-default-color !important;
}
}

View File

@ -22,8 +22,6 @@ gemini.suite('Work detail', (suite) => {
actions.waitForElementToShow('.ascribe-app', TIMEOUTS.NORMAL);
// Wait for the social media buttons to appear
actions.waitForElementToShow('.ascribe-social-button-list .fb-share-button iframe', TIMEOUTS.SUPER_DUPER_EXTRA_LONG);
actions.waitForElementToShow('.ascribe-social-button-list .twitter-share-button', TIMEOUTS.SUPER_DUPER_EXTRA_LONG);
actions.waitForElementToShow('.ascribe-media-player', TIMEOUTS.LONG);
});