Skip to content

Commit

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

* pass prop correctly

* CORE: remove prop

* remove link
  • Loading branch information
ekachxaidze98 authored Nov 12, 2024
1 parent 6fd99dc commit 9634090
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 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 renderKeys={false} works={outputs.results} />
<Results 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: 1 addition & 5 deletions templates/search/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,7 @@ const SearchTemplate = observe(({ data }) => {
/>
)}
</div>
<Results
renderKeys
works={data.results}
searchId={data.searchId}
/>
<Results 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: 2 additions & 5 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, renderKeys }) =>
const Results = ({ works, searchId }) =>
works.map(
({
id,
Expand All @@ -27,8 +27,6 @@ const Results = ({ works, searchId, renderKeys }) =>
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 @@ -80,8 +78,7 @@ const Results = ({ works, searchId, renderKeys }) =>
className={styles.searchResults}
useLogo={!!checkBillingType()}
searchId={searchId}
renderKeys={renderKeys}
renderRedirectLink={!urlSearchString.includes('author')}
renderRedirectLink
data={{
workId: id,
title,
Expand Down

0 comments on commit 9634090

Please sign in to comment.