feat: add artist filter to album view
This commit is contained in:
@@ -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) => (
|
||||
|
||||
Reference in New Issue
Block a user