Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reorder card fields; Add link to preprint provider field; Change page size #1951

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ export default class SearchPage extends Component<SearchArgs> {
'page[cursor]': page,
sort,
cardSearchFilter: filterQueryObject,
'page[size]': 10,
});
await searchResult.relatedProperties;
this.relatedProperties = searchResult.relatedProperties;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
{{/if}}
{{#if @result.resourceNature}}
<dt>{{t 'osf-components.search-result-card.resource_nature'}}</dt>
<dd>{{@result.resourceNature}}</dd>
{{/if}}
{{#if @result.nodeFunders}}
<dt>{{t 'osf-components.search-result-card.funder'}}</dt>
<dd>
Expand All @@ -24,6 +20,18 @@
</InlineList>
</dd>
{{/if}}
{{#if @result.resourceNature}}
<dt>{{t 'osf-components.search-result-card.resource_type'}}</dt>
<dd>{{@result.resourceNature}}</dd>
{{/if}}
{{#if @result.nodeLicense}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.nodeLicense.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.nodeLicense.name}}</a></dd>
{{/if}}
{{#if @result.absoluteUrl}}
<dt>{{t 'osf-components.search-result-card.url'}}</dt>
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd>
{{/if}}
{{#if @result.doi}}
<dt>{{t 'osf-components.search-result-card.doi'}}</dt>
<dd>
Expand All @@ -37,8 +45,4 @@
</InlineList>
</dd>
{{/if}}
{{#if @result.nodeLicense}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.nodeLicense.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.nodeLicense.name}}</a></dd>
{{/if}}
</dl>
Original file line number Diff line number Diff line change
Expand Up @@ -8,40 +8,7 @@
{{!-- Preprint Provider --}}
{{#if @result.provider}}
<dt>{{t 'osf-components.search-result-card.preprint_provider'}}</dt>
<dd>{{@result.provider.name}}</dd>
{{/if}}

{{!-- License --}}
{{#if @result.license}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></dd>
{{/if}}

{{!-- DOI --}}
{{#if @result.doi}}
<dt>{{t 'osf-components.search-result-card.doi'}}</dt>
<dd>
<InlineList
@items={{@result.doi}}
@total={{@result.doi.count}}
@truncate={{5}}
as |list|
>
<a href={{list.item}} target='_blank' rel='noopener noreferrer'>{{list.item}}</a>
</InlineList>
</dd>
{{/if}}

{{!-- Conflict of interest statement --}}
{{#if @result.resourceMetadata.statedConflictOfInterest}}
<dt>{{t 'osf-components.search-result-card.conflict_of_interest'}}</dt>
<dd>
{{#if @result.resourceMetadata.statedConflictOfInterest.[0].[@value]}}
{{@result.resourceMetadata.statedConflictOfInterest.[0].[@value]}}
{{else}}
{{t 'osf-components.search-result-card.no_conflict_of_interest'}}
{{/if}}
</dd>
<dd><a href={{@result.provider.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.provider.name}}</a></dd>
{{/if}}

{{!-- Associated Data --}}
Expand Down Expand Up @@ -80,5 +47,43 @@
</InlineList>
</dd>
{{/if}}

{{!-- Conflict of interest statement --}}
{{#if @result.resourceMetadata.statedConflictOfInterest}}
<dt>{{t 'osf-components.search-result-card.conflict_of_interest'}}</dt>
<dd>
{{#if @result.resourceMetadata.statedConflictOfInterest.[0].[@value]}}
{{@result.resourceMetadata.statedConflictOfInterest.[0].[@value]}}
{{else}}
{{t 'osf-components.search-result-card.no_conflict_of_interest'}}
{{/if}}
</dd>
{{/if}}

{{!-- License --}}
{{#if @result.license}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></dd>
{{/if}}

{{#if @result.absoluteUrl}}
<dt>{{t 'osf-components.search-result-card.url'}}</dt>
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd>
{{/if}}

{{!-- DOI --}}
{{#if @result.doi}}
<dt>{{t 'osf-components.search-result-card.doi'}}</dt>
<dd>
<InlineList
@items={{@result.doi}}
@total={{@result.doi.count}}
@truncate={{5}}
as |list|
>
<a href={{list.item}} target='_blank' rel='noopener noreferrer'>{{list.item}}</a>
</InlineList>
</dd>
{{/if}}
</dl>

Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,26 @@
</InlineList>
</dd>
{{/if}}
{{#if @result.resourceNature}}
<dt>{{t 'osf-components.search-result-card.resource_type'}}</dt>
<dd>{{@result.resourceNature}}</dd>
{{/if}}
{{#if @result.isPartOfCollection}}
<dt>{{t 'osf-components.search-result-card.collection'}}</dt>
<dd><a href={{@result.isPartOfCollection.absoluteUrl}} target='_blank' rel='noopener noreferrer'> {{@result.isPartOfCollection.title}} </a></dd>
{{/if}}
{{#if @result.resourceNature}}
<dt>{{t 'osf-components.search-result-card.resource_nature'}}</dt>
<dd>{{@result.resourceNature}}</dd>
{{/if}}
{{#if @resource.language}}
<dt>{{t 'osf-components.search-result-card.language'}}</dt>
<dd>{{@resource.language}}</dd>
{{/if}}
{{#if @result.license}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></dd>
{{/if}}
{{#if @result.absoluteUrl}}
<dt>{{t 'osf-components.search-result-card.url'}}</dt>
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd>
{{/if}}
{{#if @result.doi}}
<dt>{{t 'osf-components.search-result-card.doi'}}</dt>
<dd>
Expand All @@ -41,8 +49,4 @@
</InlineList>
</dd>
{{/if}}
{{#if @result.license}}
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></dd>
{{/if}}
</dl>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
{{/if}}
{{#if @result.provider}}
<dt>{{t 'osf-components.search-result-card.registration_provider'}}</dt>
<dd><a href={{@result.provider.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.provider.name}}</a></dd>
{{/if}}
{{#if @result.funders}}
<dt>{{t 'osf-components.search-result-card.funder'}}</dt>
<dd>
Expand All @@ -20,6 +16,10 @@
</InlineList>
</dd>
{{/if}}
{{#if @result.provider}}
<dt>{{t 'osf-components.search-result-card.registration_provider'}}</dt>
<dd><a href={{@result.provider.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.provider.name}}</a></dd>
{{/if}}
{{#if @result.registrationTemplate}}
<dt>{{t 'osf-components.search-result-card.registration_template'}}</dt>
<dd>{{@result.registrationTemplate}}</dd>
Expand All @@ -28,6 +28,10 @@
<dt>{{t 'osf-components.search-result-card.license'}}</dt>
<dd><a href={{@result.license.identifier}} target='_blank' rel='noopener noreferrer'>{{@result.license.name}}</a></dd>
{{/if}}
{{#if @result.absoluteUrl}}
<dt>{{t 'osf-components.search-result-card.url'}}</dt>
<dd><a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'>{{@result.absoluteUrl}}</a></dd>
{{/if}}
{{#if @result.doi}}
<dt>{{t 'osf-components.search-result-card.doi'}}</dt>
<dd>
Expand Down
3 changes: 2 additions & 1 deletion translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1858,7 +1858,8 @@ routes:
email: Email
osf-components:
search-result-card:
resource_nature: Resource nature
url: URL
resource_type: Resource type
title: Title
collection: Collection
context: Context
Expand Down
Loading