Defaufault sorting; playback control button feedback, fixes #299

This commit is contained in:
James Barnsley
2018-06-18 20:44:35 +12:00
parent 1d492bbfef
commit 3cd4316eed
14 changed files with 230 additions and 42 deletions

View File

@ -18792,7 +18792,7 @@ var DropdownField = function (_React$Component) {
className += ' ' + this.props.className;
}
var current_value = null;
if (this.props.value) {
if (this.props.value !== undefined) {
current_value = this.props.value;
} else if (this.props.options.length > 0) {
current_value = this.props.options[0].value;
@ -18838,7 +18838,7 @@ var DropdownField = function (_React$Component) {
if (_this2.isMultiSelect()) {
var is_selected = current_value.indexOf(option.value) > -1;
} else {
var is_selected = current_value == option.value;
var is_selected = current_value === option.value;
}
return _react2.default.createElement(
'div',
@ -64043,7 +64043,10 @@ var Artist = function (_React$Component) {
albums.push(this.props.albums[uri]);
}
}
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
if (this.props.sort) {
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
}
if (this.props.filter) {
albums = helpers.applyFilter('album_type', this.props.filter, albums);
@ -64153,6 +64156,9 @@ var Artist = function (_React$Component) {
default:
var sort_options = [{
value: null,
label: 'Default'
}, {
value: 'name',
label: 'Name'
}, {
@ -64244,7 +64250,7 @@ var Artist = function (_React$Component) {
name: 'Sort',
value: this.props.sort,
options: sort_options,
selected_icon: this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
selected_icon: this.props.sort ? this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down' : null,
handleChange: function handleChange(value) {
_this2.setSort(value);_this2.props.uiActions.hideContextMenu();
}
@ -64367,7 +64373,7 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
local_library_artists: state.mopidy.library_artists,
albums: state.core.albums ? state.core.albums : [],
filter: state.ui.artist_albums_filter ? state.ui.artist_albums_filter : null,
sort: state.ui.artist_albums_sort ? state.ui.artist_albums_sort : 'name',
sort: state.ui.artist_albums_sort ? state.ui.artist_albums_sort : null,
sort_reverse: state.ui.artist_albums_sort_reverse ? true : false,
spotify_authorized: state.spotify.authorization,
mopidy_connected: state.mopidy.connected
@ -75972,7 +75978,9 @@ var LibraryArtists = function (_React$Component) {
}
}
artists = helpers.sortItems(artists, this.props.sort, this.props.sort_reverse);
if (this.props.sort) {
artists = helpers.sortItems(artists, this.props.sort, this.props.sort_reverse);
}
if (this.state.filter !== '') {
artists = helpers.applyFilter('name', this.state.filter, artists);
@ -76052,6 +76060,9 @@ var LibraryArtists = function (_React$Component) {
}];
var sort_options = [{
label: 'Default',
value: null
}, {
label: 'Name',
value: 'name'
}, {
@ -76073,7 +76084,7 @@ var LibraryArtists = function (_React$Component) {
name: 'Sort',
value: this.props.sort,
options: sort_options,
selected_icon: this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
selected_icon: this.props.sort ? this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down' : null,
handleChange: function handleChange(value) {
_this3.setSort(value);_this3.props.uiActions.hideContextMenu();
}
@ -76131,8 +76142,8 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
spotify_library_artists_status: state.ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR !== undefined ? state.ui.processes.SPOTIFY_GET_LIBRARY_ARTISTS_PROCESSOR.status : null,
artists: state.core.artists,
source: state.ui.library_artists_source ? state.ui.library_artists_source : 'all',
sort: state.ui.library_artists_sort ? state.ui.library_artists_sort : 'name',
sort_reverse: state.ui.library_artists_sort_reverse ? true : false,
sort: state.ui.library_artists_sort ? state.ui.library_artists_sort : null,
sort_reverse: state.ui.library_artists_sort_reverse ? state.ui.library_artists_sort_reverse : false,
view: state.ui.library_artists_view
};
};
@ -76371,7 +76382,9 @@ var LibraryAlbums = function (_React$Component) {
}
}
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
if (this.props.sort) {
albums = helpers.sortItems(albums, this.props.sort, this.props.sort_reverse);
}
if (this.state.filter && this.state.filter !== '') {
albums = helpers.applyFilter('name', this.state.filter, albums);
@ -76457,6 +76470,9 @@ var LibraryAlbums = function (_React$Component) {
}];
var sort_options = [{
value: null,
label: 'Default'
}, {
value: 'name',
label: 'Name'
}, {
@ -76484,7 +76500,7 @@ var LibraryAlbums = function (_React$Component) {
name: 'Sort',
value: this.props.sort,
options: sort_options,
selected_icon: this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
selected_icon: this.props.sort ? this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down' : null,
handleChange: function handleChange(val) {
_this3.setSort(val);_this3.props.uiActions.hideContextMenu();
}
@ -76544,8 +76560,8 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
spotify_library_albums_status: state.ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR !== undefined ? state.ui.processes.SPOTIFY_GET_LIBRARY_ALBUMS_PROCESSOR.status : null,
view: state.ui.library_albums_view,
source: state.ui.library_albums_source ? state.ui.library_albums_source : 'all',
sort: state.ui.library_albums_sort ? state.ui.library_albums_sort : 'name',
sort_reverse: state.ui.library_albums_sort_reverse ? true : false
sort: state.ui.library_albums_sort ? state.ui.library_albums_sort : null,
sort_reverse: state.ui.library_albums_sort_reverse ? state.ui.library_albums_sort_reverse : false
};
};
@ -76925,7 +76941,9 @@ var LibraryPlaylists = function (_React$Component) {
}
}
playlists = helpers.sortItems(playlists, this.props.sort, this.props.sort_reverse);
if (this.props.sort) {
playlists = helpers.sortItems(playlists, this.props.sort, this.props.sort_reverse);
}
playlists = helpers.removeDuplicates(playlists);
if (this.state.filter !== '') {
@ -77013,6 +77031,9 @@ var LibraryPlaylists = function (_React$Component) {
}];
var sort_options = [{
value: null,
label: 'Default'
}, {
value: 'name',
label: 'Name'
}, {
@ -77042,7 +77063,7 @@ var LibraryPlaylists = function (_React$Component) {
name: 'Sort',
value: this.props.sort,
options: sort_options,
selected_icon: this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down',
selected_icon: this.props.sort ? this.props.sort_reverse ? 'keyboard_arrow_up' : 'keyboard_arrow_down' : null,
handleChange: function handleChange(value) {
_this3.setSort(value);_this3.props.uiActions.hideContextMenu();
}
@ -77111,8 +77132,8 @@ var mapStateToProps = function mapStateToProps(state, ownProps) {
me_id: state.spotify.me ? state.spotify.me.id : false,
view: state.ui.library_playlists_view,
source: state.ui.library_playlists_source ? state.ui.library_playlists_source : 'all',
sort: state.ui.library_playlists_sort ? state.ui.library_playlists_sort : 'name',
sort_reverse: state.ui.library_playlists_sort_reverse ? true : false,
sort: state.ui.library_playlists_sort ? state.ui.library_playlists_sort : null,
sort_reverse: state.ui.library_playlists_sort_reverse ? state.ui.library_playlists_sort_reverse : false,
playlists: state.core.playlists
};
};