From e49b11f349a05e19a1b76afbd58c48285132fb43 Mon Sep 17 00:00:00 2001 From: Aaron Lindsay Date: Fri, 23 Jun 2017 06:00:10 -0400 Subject: [PATCH] UI: Make reports.list contain actual reports --- js/components/ReportsTab.js | 4 ++-- js/reducers/ReportReducer.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/js/components/ReportsTab.js b/js/components/ReportsTab.js index 3693cc4..871777f 100644 --- a/js/components/ReportsTab.js +++ b/js/components/ReportsTab.js @@ -152,8 +152,8 @@ class ReportsTab extends React.Component { if (!this.state.initialized) { if (selected == -1 && nextProps.reports.list.length > 0) { - nextProps.onSelectReport(nextProps.reports.map[nextProps.reports.list[0]]); - nextProps.onTabulateReport(nextProps.reports.map[nextProps.reports.list[0]]); + nextProps.onSelectReport(nextProps.reports.list[0]); + nextProps.onTabulateReport(nextProps.reports.list[0]); this.setState({initialized: true}); } } diff --git a/js/reducers/ReportReducer.js b/js/reducers/ReportReducer.js index 59f70bf..4886ce0 100644 --- a/js/reducers/ReportReducer.js +++ b/js/reducers/ReportReducer.js @@ -58,7 +58,7 @@ module.exports = function(state = initialState, action) { for (var i = 0; i < action.reports.length; i++) { var report = action.reports[i]; reports[report.ReportId] = report; - list.push(report.ReportId); + list.push(report); if (state.selected == report.ReportId) selected = state.selected; } @@ -85,7 +85,7 @@ module.exports = function(state = initialState, action) { var list = []; for (var reportId in reports) { if (reports.hasOwnProperty(reportId)) - list.push(report.ReportId); + list.push(report); } return assign({}, state, { map: reports,