Reinstating initial setup; Only reporting to analytics where approved, fixes #247 and #268

This commit is contained in:
James Barnsley
2018-06-05 13:43:02 +12:00
parent 984d613e17
commit c27588f2f0
22 changed files with 26310 additions and 24003 deletions

View File

@ -90,13 +90,17 @@ class Playlist extends React.Component{
}
follow(){
ReactGA.event({ category: 'Playlist', action: 'Follow', label: this.props.playlist.uri })
if (this.props.allow_reporting){
ReactGA.event({ category: 'Playlist', action: 'Follow', label: this.props.playlist.uri });
}
this.props.spotifyActions.toggleFollowingPlaylist(this.props.playlist.uri, 'PUT')
}
// TODO: Once unfollowing occurs, remove playlist from global playlists list
unfollow(){
ReactGA.event({ category: 'Playlist', action: 'Unfollow', label: this.props.playlist.uri })
if (this.props.allow_reporting){
ReactGA.event({ category: 'Playlist', action: 'Unfollow', label: this.props.playlist.uri });
}
this.props.spotifyActions.toggleFollowingPlaylist(this.props.playlist.uri, 'DELETE' )
}
@ -239,6 +243,7 @@ class Playlist extends React.Component{
const mapStateToProps = (state, ownProps) => {
var uri = ownProps.params.uri;
return {
allow_reporting: state.ui.allow_reporting,
slim_mode: state.ui.slim_mode,
load_queue: state.ui.load_queue,
tracks: state.core.tracks,

View File

@ -3,7 +3,6 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux'
import { Link, hashHistory } from 'react-router'
import { bindActionCreators } from 'redux'
import ReactGA from 'react-ga'
import Header from '../components/Header'
import Icon from '../components/Icon'

View File

@ -239,6 +239,28 @@ class Settings extends React.Component {
<h4 className="underline">Services</h4>
<Services active={this.props.params.sub_view} />
<h4 className="underline">Privacy</h4>
<div className="field checkbox">
<div className="name">Reporting</div>
<div className="input">
<label>
<input
type="checkbox"
name="allow_reporting"
checked={ this.props.ui.allow_reporting }
onChange={ e => this.props.uiActions.set({ allow_reporting: !this.props.ui.allow_reporting })} />
<span className="label">
Allow reporting of anonymous usage statistics
</span>
</label>
</div>
</div>
<div className="field">
<div>Google Analytics is used to collect usage data and errors to help trace issues and provide valuable insight into how we can continue to make improvements. Personal information is anonymized prior to collection.</div>
</div>
<h4 className="underline">Advanced</h4>
<div className="field checkbox">
@ -301,10 +323,6 @@ class Settings extends React.Component {
<div className="field">
<div>
<em><a href="https://github.com/jaedb/Iris" target="_blank">Iris</a></em> is an open-source project by <a href="https://github.com/jaedb" target="_blank">James Barnsley</a>. It is provided free and with absolutely no warranty. If you paid someone for this software, please let me know.
<br />
<br />
Google Analytics is used to collect usage data and errors to help trace issues and provide valuable insight into how we can continue to make improvements. Personal information is anonymized prior to collection. For more information, see <a href="https://github.com/jaedb/Iris/wiki/Terms-of-use" target="_blank">terms and conditions</a>.
<br />
</div>
<br /><br />
<div>