Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/js/techreport/summaryCards.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ class SummaryCard {
});
}

if(latestChange && latestChange.string && latestChange.perc) {
if(latestChange && latestChange.string && latestChange.perc != null) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you broke this in #1068 as 0's weren't showing so fixed it here.

const changeSlot = card.querySelector('[data-slot="change"]');
const changeMeaning = changeSlot?.dataset?.meaning;

if(changeSlot) {
changeSlot.textContent = latestChange.string;
const styling = UIUtils.getChangeStatus(latestChange.perc, changeMeaning);
changeSlot.classList.add(styling?.color, styling?.direction);
changeSlot.className = `monthchange ${styling?.color} ${styling?.direction}`;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/js/techreport/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ function updateTable(id, config, appConfig, apps, data) {
}

if(column.styling) {
wrapper.classList.add('monthchange', column.styling?.direction, column.styling?.color);
wrapper.className = `monthchange ${column?.styling?.color} ${column?.styling?.direction}`;
}

// Add cell to the row
Expand Down
4 changes: 2 additions & 2 deletions src/js/techreport/timeseries.js
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ class Timeseries {
const styling = UIUtils.getChangeStatus(latestMoM, changeMeaning);
const monthChange = document.createElement('span');
monthChange.textContent = latestMoMStr;
monthChange.classList.add('monthchange', styling?.color, styling.direction);
monthChange.className = `monthchange ${styling?.color} ${styling?.direction}`;
itemWrapper.appendChild(monthChange);
}

Expand Down Expand Up @@ -250,7 +250,7 @@ class Timeseries {
const styling = UIUtils.getChangeStatus(latestMoM, changeMeaning);
const monthChange = document.createElement('span');
monthChange.textContent = latestMoMStr;
monthChange.classList.add('monthchange', styling?.color, styling.direction);
monthChange.className = `monthchange ${styling?.color} ${styling?.direction}`;
card.appendChild(monthChange);
}
}
Expand Down
Loading