From 3369b7e5870203cdcbdf8d2f1affc213a92b2640 Mon Sep 17 00:00:00 2001 From: Rony Byalsky Date: Sat, 22 Jun 2019 12:01:16 +0300 Subject: [PATCH] Show exec comments as tooltips (a 'star't next to exec description) --- .../docRoot/css/indexPageStyle.css | 11 +++++++++ .../docRoot/js/indexPageScript.js | 24 +++++++++++++++++-- 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/server/difido-server/docRoot/css/indexPageStyle.css b/server/difido-server/docRoot/css/indexPageStyle.css index 0efbb7fd..88ccbfc8 100644 --- a/server/difido-server/docRoot/css/indexPageStyle.css +++ b/server/difido-server/docRoot/css/indexPageStyle.css @@ -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; } \ No newline at end of file diff --git a/server/difido-server/docRoot/js/indexPageScript.js b/server/difido-server/docRoot/js/indexPageScript.js index fbc9408e..bbb996d0 100644 --- a/server/difido-server/docRoot/js/indexPageScript.js +++ b/server/difido-server/docRoot/js/indexPageScript.js @@ -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("  " + desc); + } + else { + $(descCell).html("  " + desc); + } + }); }, "drawCallback": function (settings) { // After drawing the table, reselecting all the previously selected rows.