Skip to content

Commit

Permalink
Merge pull request #427 from UN-OCHA/feature/UNO-812
Browse files Browse the repository at this point in the history
Switch keyfigures to using figure_id
  • Loading branch information
attiks authored Jan 15, 2024
2 parents f9f3287 + b60c031 commit 076ac8a
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,11 @@ public function viewElements(FieldItemListInterface $items, $langcode) {
$elements = [];
foreach ($items as $delta => $item) {
if ($field_type === 'key_figure') {
$data = $this->ochaKeyFiguresApiClient->getFigure(
$data = $this->ochaKeyFiguresApiClient->getFigureByFigureId(
$item->getFigureProvider(),
$item->getFigureId()
$item->getFigureYear(),
$item->getFigureCountry(),
$item->getFigureId(),
);
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,20 @@ dt.uno-figure__label-wrapper {
color: var(--brand-primary);
font-size: 1.625rem;
font-weight: bold;
display: flex;
flex-wrap: wrap;
}
dd.uno-figure__value {
margin: 0;
}

dd.uno-figure__value > .uno-figure__year {
font-size: 1rem;
font-weight: 400;
flex: 1 0 100%;
color: var(--brand-default-text-color);
}

@media screen and (min-width: 480px) {
.uno-figure {
display: flex;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@
<small{{ unit_attribute.addClass('uno-figure__unit') }}> ({{ unit }})</small>
{%- endif -%}
</dt>
<dd{{ value_attributes.addClass('uno-figure__value') }}>{{ value == 0 ? 0 : value }}</dd>
<dd{{ value_attributes.addClass('uno-figure__value') }}>
{{ value == 0 ? 0 : value }}
<span class="uno-figure__year">{{ year }}</span>
</dd>
</div>
{% endif %}

0 comments on commit 076ac8a

Please sign in to comment.