From 023d7bfa8a16e21bc3062e26f218db2a4c700731 Mon Sep 17 00:00:00 2001 From: Deluan Date: Wed, 17 Nov 2021 18:47:54 -0500 Subject: [PATCH] Remove link from songs to artist (when artist has no albums) --- ui/src/common/ArtistLinkField.js | 25 +++++++++++++------------ ui/src/layout/Menu.js | 2 +- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ui/src/common/ArtistLinkField.js b/ui/src/common/ArtistLinkField.js index f0a0a8e54..54babf220 100644 --- a/ui/src/common/ArtistLinkField.js +++ b/ui/src/common/ArtistLinkField.js @@ -14,24 +14,25 @@ export const useGetHandleArtistClick = (width) => { } } -const songsFilteredByArtist = (artist) => { - return `/song?filter={"artist":"${artist}"}` -} - export const ArtistLinkField = withWidth()( ({ record, className, width, source }) => { const artistLink = useGetHandleArtistClick(width) const id = record[source + 'Id'] - const link = id ? artistLink(id) : songsFilteredByArtist(record[source]) return ( - e.stopPropagation()} - className={className} - > - {record[source]} - + <> + {id ? ( + e.stopPropagation()} + className={className} + > + {record[source]} + + ) : ( + record[source] + )} + ) } ) diff --git a/ui/src/layout/Menu.js b/ui/src/layout/Menu.js index e57defe85..db5b82472 100644 --- a/ui/src/layout/Menu.js +++ b/ui/src/layout/Menu.js @@ -68,7 +68,7 @@ const Menu = ({ dense = false }) => { const renderResourceMenuItemLink = (resource) => ( }