From 227d8657cc596d6178a05c37af820b079fce19bd Mon Sep 17 00:00:00 2001 From: James Barnsley Date: Thu, 17 Aug 2017 17:37:53 +1200 Subject: [PATCH] Editing playlists, possibly addresses #119; Editing collaborative state --- src/js/components/Modal/EditPlaylistModal.js | 16 ++++++++-------- src/js/components/SpotifyAuthenticationFrame.js | 5 ++++- src/js/services/spotify/actions.js | 2 +- src/js/views/Playlist.js | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/src/js/components/Modal/EditPlaylistModal.js b/src/js/components/Modal/EditPlaylistModal.js index 58bb55f9..22133a48 100755 --- a/src/js/components/Modal/EditPlaylistModal.js +++ b/src/js/components/Modal/EditPlaylistModal.js @@ -12,8 +12,8 @@ export default class EditPlaylistModal extends React.Component{ error: null, name: this.props.data.name, description: (this.props.data.description ? this.props.data.description : ''), - is_public: this.props.data.is_public, - is_collaborative: this.props.data.is_collaborative + public: this.props.data.public, + collaborative: this.props.data.collaborative } } @@ -24,7 +24,7 @@ export default class EditPlaylistModal extends React.Component{ this.setState({error: 'Name is required'}) return false } else { - this.props.coreActions.savePlaylist(this.props.data.uri, this.state.name, this.state.description, this.state.is_public, this.state.is_collaborative) + this.props.coreActions.savePlaylist(this.props.data.uri, this.state.name, this.state.description, this.state.public, this.state.collaborative) this.props.uiActions.closeModal() return false } @@ -56,16 +56,16 @@ export default class EditPlaylistModal extends React.Component{ this.setState({ is_public: !this.state.is_public })} /> + checked={ this.state.public } + onChange={ e => this.setState({ public: !this.state.public })} /> Public diff --git a/src/js/components/SpotifyAuthenticationFrame.js b/src/js/components/SpotifyAuthenticationFrame.js index 438850c4..ed3ff9f6 100755 --- a/src/js/components/SpotifyAuthenticationFrame.js +++ b/src/js/components/SpotifyAuthenticationFrame.js @@ -74,9 +74,12 @@ class SpotifyAuthenticationFrame extends React.Component{ 'user-library-modify', 'user-follow-modify', 'user-follow-read', + 'user-read-email', 'user-top-read', 'user-read-currently-playing', - 'user-read-playback-state' + 'user-read-playback-state', + 'playlist-read-collaborative', + 'ugc-image-upload' // playlist image uploading ] var popup = window.open(url+'&scope='+scopes.join('%20'),"popup","height=680,width=400"); diff --git a/src/js/services/spotify/actions.js b/src/js/services/spotify/actions.js index f0811e96..4613dcdc 100755 --- a/src/js/services/spotify/actions.js +++ b/src/js/services/spotify/actions.js @@ -914,7 +914,7 @@ export function getArtists( uris ){ export function playArtistTopTracks(uri){ return (dispatch, getState) => { - const artists = getState().ui.artists + const artists = getState().core.artists // Do we have this artist (and their tracks) in our index already? if (typeof(artists[uri]) !== 'undefined' && typeof(artists[uri].tracks) !== 'undefined'){ diff --git a/src/js/views/Playlist.js b/src/js/views/Playlist.js index face2fab..758b2573 100755 --- a/src/js/views/Playlist.js +++ b/src/js/views/Playlist.js @@ -126,7 +126,7 @@ class Playlist extends React.Component{ return (
- + {this.props.slim_mode ? null : this.handleContextMenu(e)} />}
)