feat: show year range in album view and match ranges in year filter. #118

This commit is contained in:
Deluan
2020-03-27 21:06:02 -04:00
parent 53e8a92fed
commit 0ca849a61a
5 changed files with 56 additions and 7 deletions
+3 -3
View File
@@ -16,7 +16,7 @@ import {
AutocompleteInput,
TextField
} from 'react-admin'
import { DurationField, Pagination, Title } from '../common'
import { DurationField, Pagination, Title, RangeField } from '../common'
import { useMediaQuery } from '@material-ui/core'
const AlbumFilter = (props) => (
@@ -31,7 +31,7 @@ const AlbumFilter = (props) => (
<AutocompleteInput emptyText="-- None --" />
</ReferenceInput>
<NullableBooleanInput source="compilation" />
<NumberInput source="max_year" />
<NumberInput source="year" />
</Filter>
)
@@ -68,7 +68,7 @@ const AlbumList = (props) => {
render={(r) => (r.albumArtist ? r.albumArtist : r.artist)}
/>
{isDesktop && <NumberField source="songCount" />}
<TextField source="maxYear" />
<RangeField source={'year'} sortBy={'maxYear'} />
{isDesktop && <DurationField source="duration" />}
</Datagrid>
</List>