Add Date Added column in Album and Song lists (#2055)
This commit is contained in:
@@ -94,14 +94,19 @@ const AlbumList = (props) => {
|
||||
// Workaround to force album columns to appear the first time.
|
||||
// See https://github.com/navidrome/navidrome/pull/923#issuecomment-833004842
|
||||
// TODO: Find a better solution
|
||||
useSetToggleableFields('album', [
|
||||
'artist',
|
||||
'songCount',
|
||||
'playCount',
|
||||
'year',
|
||||
'duration',
|
||||
'rating',
|
||||
])
|
||||
useSetToggleableFields(
|
||||
'album',
|
||||
[
|
||||
'artist',
|
||||
'songCount',
|
||||
'playCount',
|
||||
'year',
|
||||
'duration',
|
||||
'rating',
|
||||
'createdAt',
|
||||
],
|
||||
['createdAt']
|
||||
)
|
||||
|
||||
// If it does not have filter/sort params (usually coming from Menu),
|
||||
// reload with correct filter/sort params
|
||||
|
||||
@@ -3,6 +3,7 @@ import {
|
||||
Datagrid,
|
||||
DatagridBody,
|
||||
DatagridRow,
|
||||
DateField,
|
||||
NumberField,
|
||||
TextField,
|
||||
} from 'react-admin'
|
||||
@@ -102,12 +103,14 @@ const AlbumTableView = ({
|
||||
className={classes.ratingField}
|
||||
/>
|
||||
),
|
||||
createdAt: isDesktop && <DateField source="createdAt" showTime />,
|
||||
}
|
||||
}, [classes.ratingField, isDesktop])
|
||||
|
||||
const columns = useSelectedFields({
|
||||
resource: 'album',
|
||||
columns: toggleableFields,
|
||||
defaultOff: ['createdAt'],
|
||||
})
|
||||
|
||||
return isXsmall ? (
|
||||
|
||||
Reference in New Issue
Block a user