Skip to content

Commit

Permalink
Search card fixes (#1963)
Browse files Browse the repository at this point in the history
* Add back isContainedBy to search-result-card

* Preserve whitespace for description field
  • Loading branch information
futa-ikeda authored Aug 23, 2023
1 parent 23d9714 commit a30faa9
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.description {
white-space: pre-wrap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{/if}}
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
<dd local-class='description'>{{@result.description}}</dd>
{{/if}}
{{#if @result.nodeFunders}}
<dt>{{t 'osf-components.search-result-card.funder'}}</dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.description {
white-space: pre-wrap;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{{!-- Description --}}
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}:</dt>
<dd>{{@result.description}}</dd>
<dd local-class='description'>{{@result.description}}</dd>
{{/if}}

{{!-- Preprint Provider --}}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.description {
white-space: pre-wrap;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<dl>
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
<dd local-class='description'>{{@result.description}}</dd>
{{/if}}
{{#if @result.funders}}
<dt>{{t 'osf-components.search-result-card.funder'}}</dt>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.description {
white-space: pre-wrap;
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<dl>
{{#if @result.description}}
<dt>{{t 'osf-components.search-result-card.description'}}</dt>
<dd>{{@result.description}}</dd>
<dd local-class='description'>{{@result.description}}</dd>
{{/if}}
{{#if @result.funders}}
<dt>{{t 'osf-components.search-result-card.funder'}}</dt>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@
<span>{{t 'osf-components.search-result-card.from'}}: <a href={{@result.isPartOfTitleAndUrl.absoluteUrl}} target='_blank' rel='noopener noreferrer'> {{@result.isPartOfTitleAndUrl.title}} </a></span>
</div>
{{/if}}
{{#if @result.isContainedBy}}
<div>
<span>{{t 'osf-components.search-result-card.from'}}: <a href={{@result.isContainedByTitleAndUrl.absoluteUrl}} target='_blank' rel='noopener noreferrer'> {{@result.isContainedByTitleAndUrl.title}} </a></span>
</div>
{{/if}}
<div local-class='date-fields'>
{{#each @result.dateFields as |field|}}
{{#if field.date}}
Expand Down Expand Up @@ -85,13 +90,6 @@
<panel.body>
<hr>
{{component this.secondaryMetadataComponent result=@result}}
{{!-- {{#if (or (eq @result.resourceType 'registration') (eq @result.resourceType 'registration_component'))}}
<SearchResultCard::RegistrationSecondaryMetadata @result={{@result}} />
{{else if (or (eq @result.resourceType 'project') (eq @result.resourceType 'project_component'))}}
<SearchResultCard::ProjectSecondaryMetadata @result={{@result}} />
{{else if (eq @result.resourceType 'preprint')}}
<SearchResultCard::PreprintSecondaryMetadata @result={{@result}} />
{{/if}} --}}
</panel.body>
</CpPanel>
</div>

0 comments on commit a30faa9

Please sign in to comment.