Skip to content

Commit

Permalink
Add Withdrawn label to withdrawn things
Browse files Browse the repository at this point in the history
  • Loading branch information
futa-ikeda committed Aug 23, 2023
1 parent cea1f72 commit 8fd580a
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/search-result.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@ export default class SearchResultModel extends Model {
get registrationTemplate() {
return this.resourceMetadata.conformsTo?.[0]?.title?.[0]?.['@value'];
}

get isWithdrawn() {
return this.resourceMetadata.dateWithdrawn || this.resourceMetadata['https://osf.io/vocab/2022/withdrawal'];
}
}

declare module 'ember-data/types/registries/model' {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,12 @@
.orcid-logo {
color: #a6ce39;
}

.withdrawn-label {
background-color: $color-bg-gray-darker;
color: $color-text-white;
border-radius: 0.25em;
padding: 0.2em 0.6em 0.3em;
font-size: 75%;
font-weight: bold;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
</div>
<h4 local-class='display-name'>
<a href={{@result.absoluteUrl}} target='_blank' rel='noopener noreferrer'> {{@result.displayTitle}} </a>
{{#if @result.isWithdrawn}}
<span local-class='withdrawn-label'>{{t 'osf-components.search-result-card.withdrawn'}}</span>
{{/if}}
{{#if @result.orcids}}
{{#each @result.orcids as |item|}}
<a href={{item}}
Expand Down
1 change: 1 addition & 0 deletions translations/en-us.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1890,6 +1890,7 @@ osf-components:
project_component: Project component
registration_component: Registration component
link_to_orcid_id: Link to orcid id
withdrawn: Withdrawn
resources-list:
add_instructions: 'Link a DOI from a repository to your registration by clicking the green “+” button.'
add_instructions_adhere: 'Contributors affirmed to adhere to the criteria for each badge.'
Expand Down

0 comments on commit 8fd580a

Please sign in to comment.