From fbc7abe7158819dcd8569be0ec89c789a1740e72 Mon Sep 17 00:00:00 2001 From: Giorgio Sironi Date: Wed, 18 Dec 2024 09:42:50 +0000 Subject: [PATCH] Prepare journal to display assessment terms for version-of-record articles teasers https://github.com/elifesciences/issues/issues/9034 --- composer.lock | 8 ++++---- src/ViewModel/Converter/ArticleTeaserConverter.php | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/composer.lock b/composer.lock index 0ad12e2cb..6f93527eb 100644 --- a/composer.lock +++ b/composer.lock @@ -1277,12 +1277,12 @@ "source": { "type": "git", "url": "https://github.com/elifesciences/api-sdk-php.git", - "reference": "77c2e13e39a9db4af7b20b538a92bb870805c089" + "reference": "23e15c0eb88f9e9137dc41e9c99920669b851e87" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elifesciences/api-sdk-php/zipball/77c2e13e39a9db4af7b20b538a92bb870805c089", - "reference": "77c2e13e39a9db4af7b20b538a92bb870805c089", + "url": "https://api.github.com/repos/elifesciences/api-sdk-php/zipball/23e15c0eb88f9e9137dc41e9c99920669b851e87", + "reference": "23e15c0eb88f9e9137dc41e9c99920669b851e87", "shasum": "" }, "require": { @@ -1331,7 +1331,7 @@ "issues": "https://github.com/elifesciences/api-sdk-php/issues", "source": "https://github.com/elifesciences/api-sdk-php/tree/master" }, - "time": "2024-12-12T15:19:39+00:00" + "time": "2024-12-17T08:11:51+00:00" }, { "name": "elife/civi-contacts", diff --git a/src/ViewModel/Converter/ArticleTeaserConverter.php b/src/ViewModel/Converter/ArticleTeaserConverter.php index 0820c67ba..d82af3698 100644 --- a/src/ViewModel/Converter/ArticleTeaserConverter.php +++ b/src/ViewModel/Converter/ArticleTeaserConverter.php @@ -44,6 +44,7 @@ public function convert($object, string $viewModel = null, array $context = []) $status = $statusInfo['status']; $statusColor = $statusInfo['statusColor']; + $teaserTermsBuilder = new TeaserTermsBuilder(); return ViewModel\Teaser::main( $object->getFullTitle(), $this->urlGenerator->generate('article', [$object]), @@ -60,7 +61,8 @@ public function convert($object, string $viewModel = null, array $context = []) $this->simpleDate($object, $context), $status, $statusColor - ) + ), + $object->getElifeAssessment() ? $teaserTermsBuilder->build($object->getElifeAssessment()) : null ) ); }