Skip to content

Commit

Permalink
test-prop (#354)
Browse files Browse the repository at this point in the history
* test-prop

* pass prop correctly
  • Loading branch information
ekachxaidze98 authored Nov 12, 2024
1 parent 5b656b9 commit 6fd99dc
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion templates/data-provider/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ const DataProviderTemplate = ({ data, onSearch, className, ...restProps }) => {
className={styles.sort}
/>
</div>
<Results works={outputs.results} />
<Results renderKeys={false} works={outputs.results} />
{outputs.data.length === 0 && outputs.error == null && (
<div className={styles.noResultsFound}>
This data provider has not articles yet.
Expand Down
6 changes: 5 additions & 1 deletion templates/search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,11 @@ const SearchTemplate = observe(({ data }) => {
/>
)}
</div>
<Results works={data.results} searchId={data.searchId} />
<Results
renderKeys
works={data.results}
searchId={data.searchId}
/>
{data.currentPage === 1000 && (
<div className={styles.more}>
Our search interface allows you to see only the first 10.000
Expand Down
7 changes: 5 additions & 2 deletions templates/search/results.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { checkType } from '../../utils/data-providers-transform'

import { formatDate } from 'utils/helpers'

const Results = ({ works, searchId }) =>
const Results = ({ works, searchId, renderKeys }) =>
works.map(
({
id,
Expand All @@ -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)
Expand Down Expand Up @@ -78,7 +80,8 @@ const Results = ({ works, searchId }) =>
className={styles.searchResults}
useLogo={!!checkBillingType()}
searchId={searchId}
renderRedirectLink
renderKeys={renderKeys}
renderRedirectLink={!urlSearchString.includes('author')}
data={{
workId: id,
title,
Expand Down

0 comments on commit 6fd99dc

Please sign in to comment.