diff --git a/package-lock.json b/package-lock.json index c5621bf..bf34f74 100644 --- a/package-lock.json +++ b/package-lock.json @@ -3109,9 +3109,9 @@ } }, "node_modules/@oacore/design": { - "version": "5.0.14", - "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.14/9e924ce081989de9542d42f160221de2f3072db9", - "integrity": "sha512-HvcZ8LZMGu2NttGwO87pa4RsvSkSyWYyfIlUZbBg+sNyMlS5Ai4DvZDkaSnK7fGwZpETlntvmifoHPLvNzQgyg==", + "version": "5.0.17", + "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.17/4a26f591d4bc10c66182e06369bf432ebca79f23", + "integrity": "sha512-LxcehauoJkdHEJ3QgWcbJCxRCFbnxeLmxkRP5ALc+ESslY10msBx2zUFxAT7z+FAJ6VD+qQ5/SoIZCzkkMEOVQ==", "hasInstallScript": true, "license": "UNLICENSED", "dependencies": { @@ -21669,9 +21669,9 @@ } }, "@oacore/design": { - "version": "5.0.14", - "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.14/9e924ce081989de9542d42f160221de2f3072db9", - "integrity": "sha512-HvcZ8LZMGu2NttGwO87pa4RsvSkSyWYyfIlUZbBg+sNyMlS5Ai4DvZDkaSnK7fGwZpETlntvmifoHPLvNzQgyg==", + "version": "5.0.17", + "resolved": "https://npm.pkg.github.com/download/@oacore/design/5.0.17/4a26f591d4bc10c66182e06369bf432ebca79f23", + "integrity": "sha512-LxcehauoJkdHEJ3QgWcbJCxRCFbnxeLmxkRP5ALc+ESslY10msBx2zUFxAT7z+FAJ6VD+qQ5/SoIZCzkkMEOVQ==", "requires": { "@babel/runtime": "^7.12.1", "@mdi/svg": "^5.8.55", diff --git a/templates/search/results.jsx b/templates/search/results.jsx index ae5729a..9e91a69 100644 --- a/templates/search/results.jsx +++ b/templates/search/results.jsx @@ -27,6 +27,8 @@ const Results = ({ works, searchId }) => const fullTextLink = links.find((l) => l.type === 'download')?.url const metadataLink = links.find((l) => l.type === 'display')?.url + const urlSearchString = window.location.search + const publicationDate = publishedDate ? formatDate(new Date(publishedDate)) : yearPublished !== null && toString(yearPublished) @@ -70,6 +72,7 @@ const Results = ({ works, searchId }) => if (innerDownloadLink) return innerDownloadLink return innerFullTextLink } + return ( className={styles.searchResults} useLogo={!!checkBillingType()} searchId={searchId} - renderRedirectLink + renderRedirectLink={ + !urlSearchString.includes('author') && + !window.location.pathname.includes('data-providers') + } data={{ workId: id, title, @@ -87,15 +93,22 @@ const Results = ({ works, searchId }) => publicationDate: publicationDate || null, thumbnailUrl: thumbnailLink || `//core.ac.uk/image/${id}/medium`, metadataLink: - generateMetadataLink(metadataLink, searchId, id) || - generateMetadataLink(displayLink, searchId, id), - fullTextLink: renderFullTextLink({ - fullTextLink, - downloadLink, - modifiedReaderLink, - searchId, - id, - }), + !urlSearchString.includes('author') && + !window.location.pathname.includes('data-providers') + ? generateMetadataLink(metadataLink, searchId, id) || + generateMetadataLink(displayLink, searchId, id) + : metadataLink || displayLink, + fullTextLink: + !urlSearchString.includes('author') && + !window.location.pathname.includes('data-providers') + ? renderFullTextLink({ + fullTextLink, + downloadLink, + modifiedReaderLink, + searchId, + id, + }) + : fullTextLink || readerLink || downloadLink, dataProviders: dataProviders || [], isRecommended: memberType?.billing_type === 'sustaining', }}