From 9f5c1e3192fb4b1d5742b2125df1c5d6817f4c9c Mon Sep 17 00:00:00 2001
From: futa-ikeda <51409893+futa-ikeda@users.noreply.github.com>
Date: Mon, 23 Oct 2023 16:32:25 -0400
Subject: [PATCH] [ENG-4838] Update search-result card to show preprint word
(#2036)
* Update search-result card to show preprint word for preprint discover page
* Update provider word for preprint secondary metadata
* Use translation map
* Use translation for preprintWord
---
.../addon/components/search-page/template.hbs | 2 +-
.../search-result-card/component.ts | 21 ++++++++++++++++---
translations/en-us.yml | 2 +-
3 files changed, 20 insertions(+), 5 deletions(-)
diff --git a/lib/osf-components/addon/components/search-page/template.hbs b/lib/osf-components/addon/components/search-page/template.hbs
index 1c69cadb328..bd08792e367 100644
--- a/lib/osf-components/addon/components/search-page/template.hbs
+++ b/lib/osf-components/addon/components/search-page/template.hbs
@@ -227,7 +227,7 @@ as |layout|>
{{t 'search.no-results'}}
diff --git a/lib/osf-components/addon/components/search-result-card/component.ts b/lib/osf-components/addon/components/search-result-card/component.ts index a0af4a4941d..dab8376a399 100644 --- a/lib/osf-components/addon/components/search-result-card/component.ts +++ b/lib/osf-components/addon/components/search-result-card/component.ts @@ -6,10 +6,23 @@ import { tracked } from '@glimmer/tracking'; import Intl from 'ember-intl/services/intl'; import SearchResultModel from 'ember-osf-web/models/search-result'; -import UserModel from 'ember-osf-web/models/user'; +import PreprintProviderModel from 'ember-osf-web/models/preprint-provider'; + + +const CardLabelTranslationKeys = { + project: 'osf-components.search-result-card.project', + project_component: 'osf-components.search-result-card.project_component', + registration: 'osf-components.search-result-card.registration', + registration_component: 'osf-components.search-result-card.registration_component', + preprint: 'osf-components.search-result-card.preprint', + file: 'osf-components.search-result-card.file', + user: 'osf-components.search-result-card.user', + unknown: 'osf-components.search-result-card.unknown', +}; interface Args { result: SearchResultModel; + provider?: PreprintProviderModel; } export default class SearchResultCard extends Component