Skip to content

Commit

Permalink
Add more secondary metadata to search-result-card (#1943)
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda authored Aug 17, 2023
1 parent a6be211 commit 8d33501
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/models/search-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default class SearchResultModel extends Model {
}

get registrationTemplate() {
return this.resourceMetadata['https://osf.io/vocab/2022/registration_type']?.[0]?.['@value'];
return this.resourceMetadata.conformsTo?.[0]?.title?.[0]?.['@value'];
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@
</InlineList>
</dd>
{{/if}}
{{#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}}
{{#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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
<dl>
{{!-- Description --}}
<dt>{{t 'osf-components.search-result-card.description'}}:</dt>
<dd>{{@result.description}}</dd>
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}:</dt>
<dd>{{@result.description}}</dd>
{{/if}}

{{!-- Preprint Provider --}}
<dt>{{t 'osf-components.search-result-card.preprint_provider'}}</dt>
<dd>{{@result.provider.name}}</dd>
{{#if @result.provider}}
<dt>{{t 'osf-components.search-result-card.preprint_provider'}}</dt>
<dd>{{@result.provider.name}}</dd>
{{/if}}

{{!-- 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 @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}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@
<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>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
<dl>
{{#if @result.funder}}
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
{{/if}}
{{#if @result.provider}}
<dt>{{t 'osf-components.search-result-card.preprint_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>
<InlineList
Expand Down

0 comments on commit 8d33501

Please sign in to comment.