UI: Fine tuning the resource navigation

This commit is contained in:
Deluan 2020-01-22 14:18:55 -05:00
parent 04637b24cd
commit e5e20750e5
3 changed files with 13 additions and 6 deletions

View file

@ -16,9 +16,9 @@ const App = () => (
layout={Layout} layout={Layout}
loginPage={Login} loginPage={Login}
> >
<Resource name="song" {...song} options={{ subMenu: 'library' }} />
<Resource name="album" {...album} options={{ subMenu: 'library' }} />
<Resource name="artist" {...artist} options={{ subMenu: 'library' }} /> <Resource name="artist" {...artist} options={{ subMenu: 'library' }} />
<Resource name="album" {...album} options={{ subMenu: 'library' }} />
<Resource name="song" {...song} options={{ subMenu: 'library' }} />
<Resource name="user" {...user} /> <Resource name="user" {...user} />
</Admin> </Admin>
) )

View file

@ -34,8 +34,13 @@ const AlbumDetails = (props) => {
) )
} }
const albumRowClick = (id, basePath, record) => const albumRowClick = (id, basePath, record) => {
`/song?filter={"artist":"${record.artist}","album":"${record.name}","album_id":"${record.id}"}&order=ASC&sort=trackNumber` const filter = { album: record.name, album_id: id }
if (!record.compilation) {
filter.artist = record.artist
}
return `/song?filter=${JSON.stringify(filter)}&order=ASC&sort=trackNumber`
}
const AlbumList = (props) => ( const AlbumList = (props) => (
<List <List

View file

@ -15,8 +15,10 @@ const ArtistFilter = (props) => (
</Filter> </Filter>
) )
const artistRowClick = (id, basePath, record) => const artistRowClick = (id, basePath, record) => {
`/album?filter={"artist":"${record.name}","artist_id":"${record.id}"}&order=ASC&sort=year` const filter = { artist_id: id }
return `/album?filter=${JSON.stringify(filter)}&order=ASC&sort=year`
}
const ArtistList = (props) => ( const ArtistList = (props) => (
<List <List