Removing old history pushes

This commit is contained in:
James Barnsley
2019-01-14 08:47:35 +13:00
parent 4a02b97e5e
commit 6bc7852c29
11 changed files with 1825 additions and 967 deletions

15
mopidy_iris/static/.htaccess Executable file
View File

@ -0,0 +1,15 @@
<IfModule mod_rewrite.c>
RewriteEngine On
# Remove /iris/ from all requests (except /ws) to accommodate the
# ./mopidy/{extension} webserver format
RewriteCond %{REQUEST_URI} !^/ws/
RewriteRule ^iris/(.*)$ /$1 [NC,L]
# Rewrite all non-file URLs to our React index.html
# This is essential for React Router to handle page refreshers
RewriteCond %{REQUEST_URI} ^(.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.html [L]
</IfModule>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
// Release details // Release details
// These are automatically injected to built HTML // These are automatically injected to built HTML
var build = "1547017245"; var build = "1547109095";
var version = "3.31.8"; var version = "3.31.8";
// Construct the script tag // Construct the script tag

View File

@ -0,0 +1 @@
test

View File

@ -10,6 +10,7 @@
}, },
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"history": "^4.7.2",
"jquery": "^3", "jquery": "^3",
"mopidy": "^0.5" "mopidy": "^0.5"
}, },

View File

@ -142,11 +142,11 @@ class App extends React.Component{
// When we have navigated to a new route // When we have navigated to a new route
if (this.props.location !== prevProps.location){ if (this.props.location !== prevProps.location){
// Log our pageview // Log our pageview
if (this.props.allow_reporting){ if (this.props.allow_reporting){
ReactGA.set({ page: window.location }); ReactGA.set({ page: this.props.location.pathname });
ReactGA.pageview(window.location); ReactGA.pageview(this.props.location.pathname);
} }
// Scroll to top of <main> // Scroll to top of <main>
@ -368,51 +368,62 @@ class App extends React.Component{
<div className={className}> <div className={className}>
<div className="body"> <div className="body">
<Sidebar />
<PlaybackControls />
<main id="main" className="smooth-scroll">
<Switch>
<ErrorBoundary>
<Route exact path="/" component={Queue} />
<Route path="/initial-setup" component={InitialSetup} />
<Route path="/kiosk-mode" component={KioskMode} />
<Route path="/add-to-playlist/:uris" component={AddToPlaylist} />
<Route path="/image-zoom" component={ImageZoom} />
<Route path="/share-configuration" component={ShareConfiguration} />
<Route path="/edit-command/:id?" component={EditCommand} />
<Route path="/queue" component={Queue} /> <Switch>
<Route path="/queue/history" component={QueueHistory} /> <Route path="/initial-setup" component={InitialSetup} />
<Route path="/queue/radio" component={EditRadio} /> <Route path="/kiosk-mode" component={KioskMode} />
<Route path="/queue/add-uri" component={AddToQueue} /> <Route path="/add-to-playlist/:uris" component={AddToPlaylist} />
<Route path="/settings/debug" component={Debug} /> <Route path="/image-zoom" component={ImageZoom} />
<Route path="/settings/service/:sub_view?" component={Settings} /> <Route path="/share-configuration" component={ShareConfiguration} />
<Route path="/edit-command/:id?" component={EditCommand} />
<Route path="/search/:type/:term?" component={Search} />
<Route path="/album/:uri" component={Album} /> <Route path="/queue/radio" component={EditRadio} />
<Route path="/artist/:uri/:sub_view?" component={Artist} /> <Route path="/queue/add-uri" component={AddToQueue} />
<Route path="/playlist/create" component={CreatePlaylist} /> <Route path="/playlist/create" component={CreatePlaylist} />
<Route path="/playlist/:uri" component={Playlist} /> <Route path="/playlist/:uri/edit" component={EditPlaylist} />
<Route path="/playlist/:uri/edit" component={EditPlaylist} />
<Route path="/user/:uri" component={User} />
<Route path="/track/:uri" component={Track} />
<Route path="/discover/recommendations/:seeds?" component={DiscoverRecommendations} />
<Route path="/discover/featured" component={DiscoverFeatured} />
<Route path="/discover/categories" component={DiscoverCategories} />
<Route path="/discover/categories/:id" component={DiscoverCategory} />
<Route path="/discover/new-releases" component={DiscoverNewReleases} />
<Route path="/library/artists" component={LibraryArtists} /> <Route>
<Route path="/library/albums" component={LibraryAlbums} /> <div>
<Route path="/library/tracks" component={LibraryTracks} /> <Sidebar />
<Route path="/library/playlists" component={LibraryPlaylists} /> <PlaybackControls />
<Route path="/library/browse/:uri?" component={LibraryBrowse} /> <main id="main" className="smooth-scroll">
<Switch>
<Route exact path="/" component={Queue} />
</ErrorBoundary> <Route path="/queue" component={Queue} />
</Switch> <Route path="/queue/history" component={QueueHistory} />
</main> <Route path="/settings/debug" component={Debug} />
<Route path="/settings/service/:sub_view?" component={Settings} />
<Route path="/search/:type/:term?" component={Search} />
<Route path="/album/:uri" component={Album} />
<Route path="/artist/:uri/:sub_view?" component={Artist} />
<Route path="/playlist/:uri" component={Playlist} />
<Route path="/user/:uri" component={User} />
<Route path="/track/:uri" component={Track} />
<Route path="/discover/recommendations/:seeds?" component={DiscoverRecommendations} />
<Route path="/discover/featured" component={DiscoverFeatured} />
<Route path="/discover/categories" component={DiscoverCategories} />
<Route path="/discover/categories/:id" component={DiscoverCategory} />
<Route path="/discover/new-releases" component={DiscoverNewReleases} />
<Route path="/library/artists" component={LibraryArtists} />
<Route path="/library/albums" component={LibraryAlbums} />
<Route path="/library/tracks" component={LibraryTracks} />
<Route path="/library/playlists" component={LibraryPlaylists} />
<Route path="/library/browse/:uri?" component={LibraryBrowse} />
<Route>
<h1>I'm lost</h1>
</Route>
</Switch>
</main>
</div>
</Route>
</Switch>
</div> </div>
<ContextMenu /> <ContextMenu />

View File

@ -3,7 +3,7 @@ import React, { PropTypes } from 'react'
import { connect } from 'react-redux' import { connect } from 'react-redux'
import { createStore, bindActionCreators } from 'redux' import { createStore, bindActionCreators } from 'redux'
import history from './history';
import * as helpers from '../helpers' import * as helpers from '../helpers'
import * as uiActions from '../services/ui/actions' import * as uiActions from '../services/ui/actions'
import GridItem from './GridItem' import GridItem from './GridItem'
@ -44,7 +44,7 @@ class AlbumGrid extends React.Component{
type="album" type="album"
item={album} item={album}
show_source_icon={this.props.show_source_icon} show_source_icon={this.props.show_source_icon}
onClick={e => {this.props.history.push(global.baseURL+'album/'+encodeURIComponent(album.uri))}} onClick={e => {history.push(global.baseURL+'album/'+encodeURIComponent(album.uri))}}
onContextMenu={e => this.handleContextMenu(e,album)} onContextMenu={e => this.handleContextMenu(e,album)}
/> />
)} )}

View File

@ -3,6 +3,8 @@ import React, { PropTypes } from 'react';
import { connect } from 'react-redux'; import { connect } from 'react-redux';
import { bindActionCreators } from 'redux'; import { bindActionCreators } from 'redux';
//import { Link } from 'react-router-dom';
import Link from './Link'; import Link from './Link';
import Icon from './Icon'; import Icon from './Icon';
import Dropzones from './Fields/Dropzones'; import Dropzones from './Fields/Dropzones';

View File

@ -386,7 +386,7 @@ class TrackList extends React.Component{
render(){ render(){
if (!this.props.tracks || Object.prototype.toString.call(this.props.tracks) !== '[object Array]' ){ if (!this.props.tracks || Object.prototype.toString.call(this.props.tracks) !== '[object Array]'){
return null; return null;
} }
@ -449,4 +449,6 @@ const mapDispatchToProps = (dispatch) => {
} }
} }
export default connect(mapStateToProps, mapDispatchToProps)(TrackList) export default TrackList
//export default connect(mapStateToProps, mapDispatchToProps)(TrackList)

5
src/js/components/history.js Executable file
View File

@ -0,0 +1,5 @@
import createBrowserHistory from 'history/createBrowserHistory'
const customHistory = createBrowserHistory()
export default customHistory;