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.
|
// Workaround to force album columns to appear the first time.
|
||||||
// See https://github.com/navidrome/navidrome/pull/923#issuecomment-833004842
|
// See https://github.com/navidrome/navidrome/pull/923#issuecomment-833004842
|
||||||
// TODO: Find a better solution
|
// TODO: Find a better solution
|
||||||
useSetToggleableFields('album', [
|
useSetToggleableFields(
|
||||||
'artist',
|
'album',
|
||||||
'songCount',
|
[
|
||||||
'playCount',
|
'artist',
|
||||||
'year',
|
'songCount',
|
||||||
'duration',
|
'playCount',
|
||||||
'rating',
|
'year',
|
||||||
])
|
'duration',
|
||||||
|
'rating',
|
||||||
|
'createdAt',
|
||||||
|
],
|
||||||
|
['createdAt']
|
||||||
|
)
|
||||||
|
|
||||||
// If it does not have filter/sort params (usually coming from Menu),
|
// If it does not have filter/sort params (usually coming from Menu),
|
||||||
// reload with correct filter/sort params
|
// reload with correct filter/sort params
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import {
|
|||||||
Datagrid,
|
Datagrid,
|
||||||
DatagridBody,
|
DatagridBody,
|
||||||
DatagridRow,
|
DatagridRow,
|
||||||
|
DateField,
|
||||||
NumberField,
|
NumberField,
|
||||||
TextField,
|
TextField,
|
||||||
} from 'react-admin'
|
} from 'react-admin'
|
||||||
@@ -102,12 +103,14 @@ const AlbumTableView = ({
|
|||||||
className={classes.ratingField}
|
className={classes.ratingField}
|
||||||
/>
|
/>
|
||||||
),
|
),
|
||||||
|
createdAt: isDesktop && <DateField source="createdAt" showTime />,
|
||||||
}
|
}
|
||||||
}, [classes.ratingField, isDesktop])
|
}, [classes.ratingField, isDesktop])
|
||||||
|
|
||||||
const columns = useSelectedFields({
|
const columns = useSelectedFields({
|
||||||
resource: 'album',
|
resource: 'album',
|
||||||
columns: toggleableFields,
|
columns: toggleableFields,
|
||||||
|
defaultOff: ['createdAt'],
|
||||||
})
|
})
|
||||||
|
|
||||||
return isXsmall ? (
|
return isXsmall ? (
|
||||||
|
|||||||
+4
-2
@@ -25,7 +25,8 @@
|
|||||||
"rating": "Rating",
|
"rating": "Rating",
|
||||||
"quality": "Quality",
|
"quality": "Quality",
|
||||||
"bpm": "BPM",
|
"bpm": "BPM",
|
||||||
"playDate": "Last Played"
|
"playDate": "Last Played",
|
||||||
|
"createdAt": "Date added"
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"addToQueue": "Play Later",
|
"addToQueue": "Play Later",
|
||||||
@@ -51,7 +52,8 @@
|
|||||||
"year": "Year",
|
"year": "Year",
|
||||||
"updatedAt": "Updated at",
|
"updatedAt": "Updated at",
|
||||||
"comment": "Comment",
|
"comment": "Comment",
|
||||||
"rating": "Rating"
|
"rating": "Rating",
|
||||||
|
"createdAt": "Date added"
|
||||||
},
|
},
|
||||||
"actions": {
|
"actions": {
|
||||||
"playAll": "Play",
|
"playAll": "Play",
|
||||||
|
|||||||
@@ -139,6 +139,7 @@ const SongList = (props) => {
|
|||||||
bpm: isDesktop && <NumberField source="bpm" />,
|
bpm: isDesktop && <NumberField source="bpm" />,
|
||||||
genre: <TextField source="genre" />,
|
genre: <TextField source="genre" />,
|
||||||
comment: <TextField source="comment" />,
|
comment: <TextField source="comment" />,
|
||||||
|
createdAt: <DateField source="createdAt" showTime />,
|
||||||
}
|
}
|
||||||
}, [isDesktop, classes.ratingField])
|
}, [isDesktop, classes.ratingField])
|
||||||
|
|
||||||
@@ -152,6 +153,7 @@ const SongList = (props) => {
|
|||||||
'albumArtist',
|
'albumArtist',
|
||||||
'genre',
|
'genre',
|
||||||
'comment',
|
'comment',
|
||||||
|
'createdAt',
|
||||||
],
|
],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user