From 2f5895f97d93aaf601dbd6fc433ce1217d978dd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Tamargo?= Date: Fri, 10 Jan 2025 12:13:53 +0100 Subject: [PATCH] MBS-13804: Also show where the review is on sidebar For reviews, it can be annoying to have just a "Review" link with no info about what kind of review it is and have to hover in order to find out. This shows the hostname of the review URL on the sidebar, so that the user can decide based on that what review(s) they are interested in. I remove www. because it doesn't seem to add anything of value and takes sidebar space. --- root/layout/components/ExternalLinks.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/root/layout/components/ExternalLinks.js b/root/layout/components/ExternalLinks.js index b40bc44eee0..ab00dc16e90 100644 --- a/root/layout/components/ExternalLinks.js +++ b/root/layout/components/ExternalLinks.js @@ -87,6 +87,7 @@ component ExternalLinks( for (let i = 0; i < relationships.length; i++) { const relationship = relationships[i]; const target = relationship.target; + console.log(target); const entityCredit = entity.id === relationship.entity0_id ? relationship.entity0_credit : relationship.entity1_credit; @@ -120,13 +121,19 @@ component ExternalLinks( />, ); } else if (linkType.name === 'review') { + const urlObject = new URL(target.name); + const hostName = urlObject.host.replace('www.', ''); + blogsAndReviews.push( , );