mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-10-31 16:00:05 -04:00
UI: Make reports.list contain actual reports
This commit is contained in:
parent
0cd27fea87
commit
e49b11f349
@ -152,8 +152,8 @@ class ReportsTab extends React.Component {
|
|||||||
if (!this.state.initialized) {
|
if (!this.state.initialized) {
|
||||||
if (selected == -1 &&
|
if (selected == -1 &&
|
||||||
nextProps.reports.list.length > 0) {
|
nextProps.reports.list.length > 0) {
|
||||||
nextProps.onSelectReport(nextProps.reports.map[nextProps.reports.list[0]]);
|
nextProps.onSelectReport(nextProps.reports.list[0]);
|
||||||
nextProps.onTabulateReport(nextProps.reports.map[nextProps.reports.list[0]]);
|
nextProps.onTabulateReport(nextProps.reports.list[0]);
|
||||||
this.setState({initialized: true});
|
this.setState({initialized: true});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ module.exports = function(state = initialState, action) {
|
|||||||
for (var i = 0; i < action.reports.length; i++) {
|
for (var i = 0; i < action.reports.length; i++) {
|
||||||
var report = action.reports[i];
|
var report = action.reports[i];
|
||||||
reports[report.ReportId] = report;
|
reports[report.ReportId] = report;
|
||||||
list.push(report.ReportId);
|
list.push(report);
|
||||||
if (state.selected == report.ReportId)
|
if (state.selected == report.ReportId)
|
||||||
selected = state.selected;
|
selected = state.selected;
|
||||||
}
|
}
|
||||||
@ -85,7 +85,7 @@ module.exports = function(state = initialState, action) {
|
|||||||
var list = [];
|
var list = [];
|
||||||
for (var reportId in reports) {
|
for (var reportId in reports) {
|
||||||
if (reports.hasOwnProperty(reportId))
|
if (reports.hasOwnProperty(reportId))
|
||||||
list.push(report.ReportId);
|
list.push(report);
|
||||||
}
|
}
|
||||||
return assign({}, state, {
|
return assign({}, state, {
|
||||||
map: reports,
|
map: reports,
|
||||||
|
Loading…
Reference in New Issue
Block a user