Skip to content

Commit

Permalink
View run count at the list of runs view
Browse files Browse the repository at this point in the history
  • Loading branch information
csordasmarton committed Nov 2, 2017
1 parent 88addd1 commit 312ad7d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
28 changes: 27 additions & 1 deletion www/scripts/codecheckerviewer/ListOfRuns.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ define([
'dijit/layout/ContentPane',
'dojox/grid/DataGrid',
'codechecker/util'],
function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
function (declare, dom, ItemFileWriteStore, topic, Dialog, Button,
RadioButton, TextBox, BorderContainer, ContentPane, DataGrid, util) {

/**
Expand Down Expand Up @@ -157,7 +157,9 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
});

CC_SERVICE.getRunData(runFilter, function (runDataList) {
that._updateRunCount(runDataList.length);
that._sortRunData(runDataList);

runDataList.forEach(function (item) {
that._addRunData(item);
});
Expand Down Expand Up @@ -190,6 +192,7 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
var that = this;

CC_SERVICE.getRunData(runFilter, function (runDataList) {
that._updateRunCount(runDataList.length);
that._sortRunData(runDataList);

// In Firefox the onLoaded function called immediately before topics
Expand All @@ -207,6 +210,11 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
});
},

_updateRunCount : function (num) {
this.parent._runCount.innerHTML = num;
this.parent.updateTitle();
},

onLoaded : function (runDataList) {}
});

Expand Down Expand Up @@ -273,6 +281,7 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,

postCreate : function () {
this.addChild(this._runFilter);

if (this.get('showDelete'))
this.addChild(this._deleteBtn);
this.addChild(this._diffBtn);
Expand Down Expand Up @@ -326,6 +335,18 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
postCreate : function () {
var that = this;

this._runCountWrapper = dom.create('span', {
class : 'run-count-wrapper',
innerHTML : this.get('title')
});

this._runCount = dom.create('span', {
class : 'run-count',
innerHTML : '?'
}, this._runCountWrapper);

this.updateTitle();

var showDelete = CC_AUTH_SERVICE.hasPermission(
Permission.PRODUCT_STORE, util.createPermissionParams({
productID : CURRENT_PRODUCT.id
Expand All @@ -339,6 +360,7 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
var listOfRunsGrid = new ListOfRunsGrid({
region : 'center',
infoPane : runsInfoPane,
parent : this,
onLoaded : that.onLoaded,
showDelete : showDelete
});
Expand All @@ -349,6 +371,10 @@ function (declare, domConstruct, ItemFileWriteStore, topic, Dialog, Button,
this.addChild(listOfRunsGrid);
},

updateTitle : function () {
this.set('title', this._runCountWrapper.innerHTML);
},

onLoaded : function (runDataList) {}
});
});
2 changes: 1 addition & 1 deletion www/scripts/codecheckerviewer/codecheckerviewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ function (declare, topic, domConstruct, Dialog, Button,
//--- Center panel ---//

var listOfRuns = new ListOfRuns({
title : 'List of runs',
title : 'Runs',
onLoaded : function (runDataParam) {
runDataList = runDataParam;
initByUrl();
Expand Down
14 changes: 14 additions & 0 deletions www/style/codecheckerviewer.css
Original file line number Diff line number Diff line change
Expand Up @@ -1191,3 +1191,17 @@ span[class*="severity-"] {
.checker-statistics-list {
flex-grow: 1;
}

.run-count-wrapper {
padding: 10px;
}

.run-count {
background-color: #7994a226;
color: #5a6971;
padding: 2px 5px;
margin-left: 3px;
border-radius: 15px;
line-height: 1;
font-weight: bold;
}

0 comments on commit 312ad7d

Please sign in to comment.