From 6ccf9208f09321d8f34cca5206a0002fd971a449 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Sun, 19 Feb 2017 16:42:22 -0500 Subject: [PATCH] Reports: Add keys to everything to make React happy --- js/components/ReportsTab.js | 22 ++++++++++++---------- js/components/StackedBarChart.js | 16 ++++++++-------- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/js/components/ReportsTab.js b/js/components/ReportsTab.js index 4a99f72..409321b 100644 --- a/js/components/ReportsTab.js +++ b/js/components/ReportsTab.js @@ -49,26 +49,28 @@ module.exports = React.createClass({ }; }(); titleTracks.push(( - )); - titleTracks.push((/)); + titleTracks.push((/)); seriesTraversal.push(this.props.selectedReport.seriesTraversal[i]); } - if (titleTracks.length == 0) + if (titleTracks.length == 0) { titleTracks.push(( - )); - else + } else { + var i = this.props.selectedReport.seriesTraversal.length-1; titleTracks.push(( - )); + } report = ( {this.props.report.Labels[i]} + {this.props.report.Labels[i]} )); labels.push(( - + )); } // Make X axis marks and labels var makeXLabel = function(value) { labels.push(( - + )); labels.push(( - {value} + {value} )); } for (var i=0; i < minMax[1]; i+= xAxisMarksEvery) @@ -146,7 +146,7 @@ module.exports = React.createClass({ } seriesBars.push(( - + {child}: {value} @@ -155,7 +155,7 @@ module.exports = React.createClass({ if (seriesBars.length > 0) { legendMap[child] = childId; bars.push(( - + {seriesBars} )); @@ -168,10 +168,10 @@ module.exports = React.createClass({ var legendClasses = "chart-color" + (legendMap[series] % 12); var legendY = (legendMap[series] - 1)*15; legend.push(( - + )); legend.push(( - {series} + {series} )); }