Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show execution comments as tooltips (a star next to exec description) #228

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions server/difido-server/docRoot/css/indexPageStyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,15 @@ div.dt-buttons {
color: black;
text-decoration: none;
cursor: pointer;
}

.commentStar {
cursor: pointer;
font-size: 12pt;
color: #337ab7;
}

.commentStar:hover {
cursor: pointer;
color: #006;
}
24 changes: 22 additions & 2 deletions server/difido-server/docRoot/js/indexPageScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,28 @@ function populateTable() {
}],
"fnCreatedRow": function (nRow, aData, iDataIndex) {
// Adding attributes to the row. Especially useful for keeping the selected rows after refresh.
$(nRow).attr('id', 'exe' + aData[0]);
$(nRow).attr('exeid', aData[0]);
// Checking if the execution has comments, and if it does, adding the comment as a tooltip that's shown when hovering on the star to the right of the execution description
$.ajax({
url : 'api/executions/' + aData[0],
type : 'GET',
})
.done(function(metadataObj) {

var execId = aData[0];

$(nRow).attr('id', 'exe' + execId);
$(nRow).attr('exeid', execId);

var descCell = $(nRow).find("td")[1];
var desc = $(descCell).html();

if (metadataObj.comment != '') {
$(descCell).html("<span class=\"commentStar\" title=\"Comment:\n" + metadataObj.comment + "\" onclick=\"executionDetails(" + execId + ")\">&starf;</span> &nbsp;" + desc);
}
else {
$(descCell).html("<span class=\"commentStar\" title=\"Click to add comment\" onclick=\"executionDetails(" + execId + ")\">&star;</span> &nbsp;" + desc);
}
});
},
"drawCallback": function (settings) {
// After drawing the table, reselecting all the previously selected rows.
Expand Down