Don't display "Comment" field in details if it is empty
This commit is contained in:
@@ -40,7 +40,9 @@ const AlbumDetails = (props) => {
|
|||||||
<BooleanField source="compilation" />
|
<BooleanField source="compilation" />
|
||||||
<DateField source="updatedAt" showTime />
|
<DateField source="updatedAt" showTime />
|
||||||
<SizeField source="size" />
|
<SizeField source="size" />
|
||||||
|
{props.record && props.record['comment'] && (
|
||||||
<MultiLineTextField source="comment" />
|
<MultiLineTextField source="comment" />
|
||||||
|
)}
|
||||||
</SimpleShowLayout>
|
</SimpleShowLayout>
|
||||||
</Show>
|
</Show>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -29,6 +29,9 @@ export const SongDetails = (props) => {
|
|||||||
if (!record.discSubtitle) {
|
if (!record.discSubtitle) {
|
||||||
delete data.discSubtitle
|
delete data.discSubtitle
|
||||||
}
|
}
|
||||||
|
if (!record.comment) {
|
||||||
|
delete data.comment
|
||||||
|
}
|
||||||
if (record.playCount > 0) {
|
if (record.playCount > 0) {
|
||||||
data.playDate = <DateField record={record} source="playDate" showTime />
|
data.playDate = <DateField record={record} source="playDate" showTime />
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user