Skip to content

Commit

Permalink
Merge pull request #871 from csordasmarton/lazy_load_report_detail
Browse files Browse the repository at this point in the history
Lazy loading bug viewer report data
  • Loading branch information
whisperity authored Sep 6, 2017
2 parents 45c498e + d07b60b commit 6736b45
Showing 1 changed file with 24 additions and 17 deletions.
41 changes: 24 additions & 17 deletions www/scripts/codecheckerviewer/BugViewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
this.bugStore = new Observable(new Memory({
data : [{ id : 'root' }],
getChildren : function (node) {
if (node.getChildren)
return node.getChildren(node);

return this.query({ parent : node.id });
}
}));
Expand Down Expand Up @@ -669,8 +672,19 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
},

_formatReportDetails : function (report, reportDetails) {
var res = [];

res.push({
id : report.reportId + '_0',
name : '<b><u>' + entities.encode(report.checkerMsg) + '</u></b>',
parent : report.reportId + '',
report : report,
isLeaf : true,
kind : 'msg'
});

if (reportDetails.pathEvents.length <= 1)
return;
return res;

var filePaths = [];
var areThereMultipleFiles = false;
Expand Down Expand Up @@ -739,7 +753,7 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
name = name.replace('{FILENAME}', filename);
}

that.bugStore.put({
res.push({
id : report.reportId + '_' + (index + 1),
name : name,
tooltip : tooltip,
Expand All @@ -751,7 +765,9 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
kind : kind,
report : report
});
})
});

return res;
},

_addReport : function (report) {
Expand All @@ -764,20 +780,11 @@ function (declare, domClass, dom, style, fx, Toggler, on, query, Memory,
parent : util.severityFromCodeToString(report.severity),
report : report,
isLeaf : false,
kind : 'bugpath'
});

this.bugStore.put({
id : report.reportId + '_0',
name : '<b><u>' + entities.encode(report.checkerMsg) + '</u></b>',
parent : report.reportId + '',
report : report,
isLeaf : true,
kind : 'msg'
});

CC_SERVICE.getReportDetails(report.reportId, function (reportDetails) {
that._formatReportDetails(report, reportDetails);
kind : 'bugpath',
getChildren : function (node) {
var reportDetails = CC_SERVICE.getReportDetails(report.reportId);
return that._formatReportDetails(report, reportDetails);
}
});
},

Expand Down

0 comments on commit 6736b45

Please sign in to comment.