Skip to content

Commit

Permalink
UI improvements on last seem menu.
Browse files Browse the repository at this point in the history
  • Loading branch information
vertigo17 committed Jan 9, 2025
1 parent 5bba57c commit fe9d9b5
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 20 deletions.
19 changes: 14 additions & 5 deletions source/src/main/webapp/js/global/header.js
Original file line number Diff line number Diff line change
Expand Up @@ -362,16 +362,20 @@ function loadUserSystemCombo() {


function refreshHistoryMenu() {
let entryList = localStorage.getItem("historyTestcases");
entryList = JSON.parse(entryList);

$(".histo").remove();

let entryList = localStorage.getItem("historyTestcases");
entryList = JSON.parse(entryList);
if (entryList !== null && entryList.length > 0) {
$("#userMenu").append("<li class='menuSeparator histo'><span>Last Seen Testcases</span></li>");
for (var item in entryList) {
let newitem = entryList.length - item - 1;
$("#userMenu").append("<li class='histo'><a name='menuitem' href='TestCaseScript.jsp?test=" + encodeURIComponent(entryList[newitem].test) + "&testcase=" + encodeURIComponent(entryList[newitem].testcase) + "'><i class='fa fa-bars'></i><span> " + entryList[newitem].test + " " + entryList[newitem].testcase + "</span></a></li>");
let desc = "<div></div>";
if ((entryList[newitem].description !== undefined) && (entryList[newitem].description !== "")) {
desc = "<div style='font-size: 10px;min-width: 350px'> " + entryList[newitem].description + "</div>";
}
$("#userMenu").append("<li class='histo'><a name='menuitem' href='TestCaseScript.jsp?test=" + encodeURIComponent(entryList[newitem].test) + "&testcase=" + encodeURIComponent(entryList[newitem].testcase) + "'><i class='fa fa-bars'></i>" +
"<span> " + entryList[newitem].test + " " + entryList[newitem].testcase + "</span>" + desc + "</a></li>");
}
}
entryList = localStorage.getItem("historyExecutions");
Expand All @@ -380,7 +384,12 @@ function refreshHistoryMenu() {
$("#userMenu").append("<li class='menuSeparator histo'><span>Last Seen Executions</span></li>");
for (var item in entryList) {
let newitem = entryList.length - item - 1;
$("#userMenu").append("<li class='histo'><a name='menuitem' href='TestCaseExecution.jsp?executionId=" + entryList[newitem].id + "'><i class='fa fa-gear'></i><span> " + entryList[newitem].id + "</span></a></li>");
let desc = "<div style='font-size: 10px;min-width: 350px'> " + entryList[newitem].test + " " + entryList[newitem].testcase + " | " + entryList[newitem].country + " " + entryList[newitem].environment + " " + entryList[newitem].robot + "</div>";
if ((entryList[newitem].description !== undefined) && (entryList[newitem].description !== "")) {
desc += "<div style='font-size: 10px;min-width: 350px'> " + entryList[newitem].description + "</div>";
}
$("#userMenu").append("<li class='histo'><a name='menuitem' href='TestCaseExecution.jsp?executionId=" + entryList[newitem].id + "'><i class='fa fa-gear status" + entryList[newitem].controlStatus + "'></i>" +
"<span class='status" + entryList[newitem].controlStatus + "'> " + entryList[newitem].id + "</span>" + desc + "</a></li>");
}
}
entryList = localStorage.getItem("historyCampaigns");
Expand Down
3 changes: 1 addition & 2 deletions source/src/main/webapp/js/pages/TestCaseExecution.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ function getHistoryExecution(tce) {
result.country = tce.country;
result.robot = tce.robot;
result.description = tce.description;
result.controlStatus = tce.controlStatus;
return result;
}

Expand Down Expand Up @@ -518,7 +519,6 @@ function updatePage(data, steps) {
// Adding all media attached to execution.
var fileContainer = $("#testCaseConfig #tcFileContentField");
var fileExeContainer = $("#testCaseConfig #tcDetailFileContentField");
console.info("call1 " + isTheExecutionManual);
addFileLink(data.fileList, fileContainer, fileExeContainer, isTheExecutionManual);

var myURL = $("#bugButtons").data("appBugURL");
Expand Down Expand Up @@ -561,7 +561,6 @@ function updatePage(data, steps) {
$("#bugButtons").append(link);


console.info(dataApp.contentTable);
// Open Bug with direct call to BugTracker using connector
if (dataApp.contentTable.bugTrackerConnector !== "NONE") {
link = $("<button class='btn btn-default btn-block marginTop5'>").attr("id", "addBugFromExternal").text(" Open a new bug using " + dataApp.contentTable.bugTrackerConnector + " connector").prepend($(" <span class='glyphicon glyphicon-cloud'></span>"));
Expand Down
27 changes: 14 additions & 13 deletions source/src/main/webapp/js/pages/TestCaseScript.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,7 @@ function getHistoryTestcase(object) {
result.id = object.test + '-' + object.testcase;
result.test = object.test;
result.testcase = object.testcase;
result.description = object.description;
return result;
}

Expand Down Expand Up @@ -807,39 +808,39 @@ function generateImportInfoId(stepInfo) {

var importInfoIdx = 0;

function appendActionsForConditionCombobox(combo, operator){
function appendActionsForConditionCombobox(combo, operator) {

combo.empty();
var steps = $("#steps li").data("item").steps;
for (s in steps) {
if (operator.startsWith("ifStepStatus")) {
if (steps[s].sort != undefined) {
combo.append($("<option></option>")
.text("Step " + steps[s].sort + " - " + steps[s].description)
.attr("stepId", steps[s].stepId)
.val(steps[s].stepId));
.text("Step " + steps[s].sort + " - " + steps[s].description)
.attr("stepId", steps[s].stepId)
.val(steps[s].stepId));
}
} else {
var actions = $("#steps li").data("item").steps[s].actions;
for (a in actions) {
if (operator.startsWith("ifActionStatus")) {
if (actions[a].sort != undefined) {
combo.append($("<option></option>")
.text("Step " + steps[s].sort + " - Action " + actions[a].sort + " - " + actions[a].description)
.attr("actionId", actions[a].actionId)
.attr("stepId", steps[s].stepId)
.val(steps[s].stepId + "-" + actions[a].actionId));
.text("Step " + steps[s].sort + " - Action " + actions[a].sort + " - " + actions[a].description)
.attr("actionId", actions[a].actionId)
.attr("stepId", steps[s].stepId)
.val(steps[s].stepId + "-" + actions[a].actionId));
}
} else {
var controls = $("#steps li").data("item").steps[s].actions[a].controls;
for (c in controls) {
if (controls[c].sort != undefined) {
combo.append($("<option></option>")
.text("Step " + steps[s].sort + " - Action " + actions[a].sort + " - Control " + controls[c].sort + " - " + controls[c].description)
.attr("actionId", actions[a].actionId)
.attr("stepId", steps[s].stepId)
.attr("controlId", controls[c].controlId)
.val(steps[s].stepId + "-" + actions[a].actionId+ "-" + controls[c].controlId));
.text("Step " + steps[s].sort + " - Action " + actions[a].sort + " - Control " + controls[c].sort + " - " + controls[c].description)
.attr("actionId", actions[a].actionId)
.attr("stepId", steps[s].stepId)
.attr("controlId", controls[c].controlId)
.val(steps[s].stepId + "-" + actions[a].actionId + "-" + controls[c].controlId));
}
}
}
Expand Down

0 comments on commit fe9d9b5

Please sign in to comment.