Fix severity sort
@@ -89,13 +89,6 @@ function (declare, Deferred, ObjectStore, Store, QueryResults, topic,
_formatItems : function (reportDataList) {
reportDataList.forEach(function (reportData) {
- reportData.severity =
- util.severityFromCodeToString(reportData.severity);
-
- reportData.severityContent ='<span title="' + reportData.severity + '"'
- + ' class="icon-severity icon-severity-' + reportData.severity
- + '"></span>';
-
reportData.checkedFile = reportData.checkedFile +
' @ Line ' + reportData.lastBugPosition.startLine;
});
@@ -190,6 +183,13 @@ function (declare, Deferred, ObjectStore, Store, QueryResults, topic,
}
});
+ function severityFormatter(id) {
+ var severityStr = util.severityFromCodeToString(id);
+ var title = severityStr.charAt(0).toUpperCase() + severityStr.slice(1);
+ return '<span title="' + title + '" class="icon-severity icon-severity-'
+ + severityStr + '"></span>';
+ }
+
var ListOfBugsGrid = declare(DataGrid, {
constructor : function () {
var width = (100 / 5).toString() + '%';
@@ -198,7 +198,7 @@ function (declare, Deferred, ObjectStore, Store, QueryResults, topic,
{ name : 'File', field : 'checkedFile', cellClasses : 'link compact', width : '100%' },
{ name : 'Message', field : 'checkerMsg', width : '100%' },
{ name : 'Checker name', field : 'checkerId', cellClasses : 'link', width : '50%' },
- { name : 'Severity', field : 'severityContent', cellClasses : 'severity' },
+ { name : 'Severity', field : 'severity', cellClasses : 'severity', formatter : severityFormatter },
{ name : 'Suppress', field : 'suppressComment' }
];
