Skip to content

Commit

Permalink
fix: use translated title and subtitle when available (DHIS2-16216)
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardo committed Dec 7, 2023
1 parent 07f2c7d commit 3ab233c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,11 @@ export default function (series, layout, metaData, dashboard) {
}

// DHIS2-578: allow for optional custom subtitle
if (isString(layout.subtitle)) {
subtitle.text = layout.subtitle
const customSubtitle =
(layout.subtitle && layout.displaySubtitle) || layout.subtitle

if (isString(customSubtitle) && customSubtitle.length) {
subtitle.text = customSubtitle
} else {
const filterTitle = getFilterText(layout.filters, metaData)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,10 @@ export default function (layout, metaData, dashboard) {
return title
}

if (isString(layout.title) && layout.title.length) {
title.text = layout.title
const customTitle = (layout.title && layout.displayTitle) || layout.title

if (isString(customTitle) && customTitle.length) {
title.text = customTitle
} else {
switch (layout.type) {
case VIS_TYPE_GAUGE:
Expand Down

0 comments on commit 3ab233c

Please sign in to comment.