mirror of
https://github.com/navidrome/navidrome.git
synced 2026-11-25 19:39:46 +01:00
feat: add artist filter to album view
This commit is contained in:
parent
c84a58ff7d
commit
100db2bcfd
11 changed files with 129 additions and 59 deletions
|
|
@ -9,9 +9,11 @@ import {
|
|||
FunctionField,
|
||||
SearchInput,
|
||||
NumberInput,
|
||||
BooleanInput,
|
||||
NullableBooleanInput,
|
||||
Show,
|
||||
SimpleShowLayout,
|
||||
ReferenceInput,
|
||||
AutocompleteInput,
|
||||
TextField
|
||||
} from 'react-admin'
|
||||
import { DurationField, Pagination, Title } from '../common'
|
||||
|
|
@ -20,7 +22,15 @@ import { useMediaQuery } from '@material-ui/core'
|
|||
const AlbumFilter = (props) => (
|
||||
<Filter {...props}>
|
||||
<SearchInput source="name" alwaysOn />
|
||||
<BooleanInput source="compilation" />
|
||||
<ReferenceInput
|
||||
source="artist_id"
|
||||
reference="artist"
|
||||
sort={{ field: 'name', order: 'ASC' }}
|
||||
filterToQuery={(searchText) => ({ name: [searchText] })}
|
||||
>
|
||||
<AutocompleteInput emptyText="-- None --" />
|
||||
</ReferenceInput>
|
||||
<NullableBooleanInput source="compilation" />
|
||||
<NumberInput source="year" />
|
||||
</Filter>
|
||||
)
|
||||
|
|
|
|||
|
|
@ -17,7 +17,9 @@ const ArtistFilter = (props) => (
|
|||
|
||||
const artistRowClick = (id, basePath, record) => {
|
||||
const filter = { artist_id: id }
|
||||
return `/album?filter=${JSON.stringify(filter)}&order=ASC&sort=year`
|
||||
return `/album?filter=${JSON.stringify(
|
||||
filter
|
||||
)}&order=ASC&sort=year&displayedFilters={"compilation":true}`
|
||||
}
|
||||
|
||||
const ArtistList = (props) => (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue