Date: Wed, 23 May 2018 16:39:29 +0200
Subject: [PATCH 4/6] remove Facebook
---
js/actions/facebook_actions.js | 14 ----
js/app.js | 1 -
.../ascribe_detail/media_container.js | 2 -
.../facebook_share_button.js | 69 -------------------
js/constants/application_constants.js | 4 --
js/third_party/facebook_handler.js | 39 -----------
test/gemini/tests/main/detail.js | 1 -
7 files changed, 130 deletions(-)
delete mode 100644 js/actions/facebook_actions.js
delete mode 100644 js/components/ascribe_social_share/facebook_share_button.js
delete mode 100644 js/third_party/facebook_handler.js
diff --git a/js/actions/facebook_actions.js b/js/actions/facebook_actions.js
deleted file mode 100644
index 2e784fba..00000000
--- a/js/actions/facebook_actions.js
+++ /dev/null
@@ -1,14 +0,0 @@
-'use strict';
-
-import { altThirdParty } from '../alt';
-
-
-class FacebookActions {
- constructor() {
- this.generateActions(
- 'sdkReady'
- );
- }
-}
-
-export default altThirdParty.createActions(FacebookActions);
diff --git a/js/app.js b/js/app.js
index 29558be2..26dc34d6 100644
--- a/js/app.js
+++ b/js/app.js
@@ -24,7 +24,6 @@ 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 NotificationsHandler from './third_party/notifications_handler';
import RavenHandler from './third_party/raven_handler';
diff --git a/js/components/ascribe_detail/media_container.js b/js/components/ascribe_detail/media_container.js
index de6d8976..ab3ab6aa 100644
--- a/js/components/ascribe_detail/media_container.js
+++ b/js/components/ascribe_detail/media_container.js
@@ -7,7 +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';
@@ -160,7 +159,6 @@ let MediaContainer = React.createClass({
encodingMessage={this.getEncodingMessage()} />
-
diff --git a/js/components/ascribe_social_share/facebook_share_button.js b/js/components/ascribe_social_share/facebook_share_button.js
deleted file mode 100644
index d5fbf699..00000000
--- a/js/components/ascribe_social_share/facebook_share_button.js
+++ /dev/null
@@ -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 (
-
-
- );
- }
-});
-
-export default FacebookShareButton;
diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js
index 2186b945..17eedab8 100644
--- a/js/constants/application_constants.js
+++ b/js/constants/application_constants.js
@@ -131,10 +131,6 @@ const constants = {
'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'
},
diff --git a/js/third_party/facebook_handler.js b/js/third_party/facebook_handler.js
deleted file mode 100644
index 9e40e7ab..00000000
--- a/js/third_party/facebook_handler.js
+++ /dev/null
@@ -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');
diff --git a/test/gemini/tests/main/detail.js b/test/gemini/tests/main/detail.js
index 1a51836b..6ee0f38e 100644
--- a/test/gemini/tests/main/detail.js
+++ b/test/gemini/tests/main/detail.js
@@ -22,7 +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);
});
From eb0aad0fe12222b97e588b07bfc57b61fc1764b3 Mon Sep 17 00:00:00 2001
From: Matthias Kretschmann
Date: Wed, 23 May 2018 16:42:01 +0200
Subject: [PATCH 5/6] remove Twitter
---
.../ascribe_detail/media_container.js | 6 --
.../twitter_share_button.js | 55 -------------------
js/constants/application_constants.js | 3 -
test/gemini/tests/main/detail.js | 1 -
4 files changed, 65 deletions(-)
delete mode 100644 js/components/ascribe_social_share/twitter_share_button.js
diff --git a/js/components/ascribe_detail/media_container.js b/js/components/ascribe_detail/media_container.js
index ab3ab6aa..bc8efcd5 100644
--- a/js/components/ascribe_detail/media_container.js
+++ b/js/components/ascribe_detail/media_container.js
@@ -7,8 +7,6 @@ import ProgressBar from 'react-bootstrap/lib/ProgressBar';
import MediaPlayer from './../ascribe_media/media_player';
-import TwitterShareButton from '../ascribe_social_share/twitter_share_button';
-
import S3DownloadButton from '../ascribe_buttons/s3_download_button';
import CollapsibleButton from './../ascribe_collapsible/collapsible_button';
@@ -158,10 +156,6 @@ let MediaContainer = React.createClass({
extraData={extraData}
encodingMessage={this.getEncodingMessage()} />
-
-
-
-
- );
- }
-});
-
-export default TwitterShareButton;
diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js
index 17eedab8..504676b3 100644
--- a/js/constants/application_constants.js
+++ b/js/constants/application_constants.js
@@ -131,9 +131,6 @@ const constants = {
'raven': {
'url': 'https://836bfb71c9c7418a967351d39ce547f0@app.getsentry.com/48351'
},
- 'twitter': {
- 'sdkUrl': 'https://platform.twitter.com/widgets.js'
- },
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net',
'errorMessagesToIgnore': [
'Authentication credentials were not provided.',
diff --git a/test/gemini/tests/main/detail.js b/test/gemini/tests/main/detail.js
index 6ee0f38e..99bc5c84 100644
--- a/test/gemini/tests/main/detail.js
+++ b/test/gemini/tests/main/detail.js
@@ -22,7 +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 .twitter-share-button', TIMEOUTS.SUPER_DUPER_EXTRA_LONG);
actions.waitForElementToShow('.ascribe-media-player', TIMEOUTS.LONG);
});
From 8a9671813c8ab6ba45bda67b195b18303f970f7f Mon Sep 17 00:00:00 2001
From: Matthias Kretschmann
Date: Thu, 24 May 2018 10:04:45 +0200
Subject: [PATCH 6/6] remove Sentry
---
js/app.js | 2 --
js/constants/application_constants.js | 3 ---
js/third_party/raven_handler.js | 33 ---------------------------
js/utils/error_utils.js | 20 ++--------------
package.json | 1 -
5 files changed, 2 insertions(+), 57 deletions(-)
delete mode 100644 js/third_party/raven_handler.js
diff --git a/js/app.js b/js/app.js
index 26dc34d6..f6c877cf 100644
--- a/js/app.js
+++ b/js/app.js
@@ -25,8 +25,6 @@ import EventActions from './actions/event_actions';
// You can comment out the modules you don't need
// import DebugHandler from './third_party/debug_handler';
import NotificationsHandler from './third_party/notifications_handler';
-import RavenHandler from './third_party/raven_handler';
-
const AppGateway = {
start() {
diff --git a/js/constants/application_constants.js b/js/constants/application_constants.js
index 504676b3..ec26e8e4 100644
--- a/js/constants/application_constants.js
+++ b/js/constants/application_constants.js
@@ -128,9 +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'
- },
'cloudfrontDomain': 'd1qjsxua1o9x03.cloudfront.net',
'errorMessagesToIgnore': [
'Authentication credentials were not provided.',
diff --git a/js/third_party/raven_handler.js b/js/third_party/raven_handler.js
deleted file mode 100644
index f294bc95..00000000
--- a/js/third_party/raven_handler.js
+++ /dev/null
@@ -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');
diff --git a/js/utils/error_utils.js b/js/utils/error_utils.js
index 4aa74247..6c2225a6 100644
--- a/js/utils/error_utils.js
+++ b/js/utils/error_utils.js
@@ -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;
}
diff --git a/package.json b/package.json
index 556e24f7..0768e7f4 100644
--- a/package.json
+++ b/package.json
@@ -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",