Skip to content

Commit 8e7307f

Browse files
committed
add link to test folder from testcase list page
1 parent 119c95f commit 8e7307f

File tree

6 files changed

+46
-11
lines changed

6 files changed

+46
-11
lines changed

source/src/main/webapp/Test.jsp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@
2929
<!DOCTYPE html>
3030
<html class="h-full">
3131
<head>
32-
<meta name="active-menu" content="test">
33-
<meta name="active-submenu" content="Test.jsp">
32+
<meta name="active-menu" content="maintain">
33+
<meta name="active-submenu" content="TestCaseList.jsp">
34+
<meta name="active-page" content="Test.jsp">
3435
<meta name="page" content="Test Folder">
3536
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
3637
<%@ include file="include/global/dependenciesInclusions.html" %>
@@ -45,8 +46,16 @@
4546
<%@ include file="include/pages/test/editTest.html" %>
4647
<%@ include file="include/pages/test/addTest.html" %>
4748

49+
<div class="mb-4">
50+
<button id='backToTestCaseListButton' type='button'
51+
class='flex items-center gap-2 px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 hover:border-sky-500 h-10'
52+
onclick="window.location.href='TestCaseList.jsp'">
53+
<span class='glyphicon glyphicon-arrow-left'></span>
54+
<span>Back to TestCase List</span>
55+
</button>
56+
</div>
4857
<h1 class="page-title-line" id="title">Test</h1>
49-
<div class="crb_card">
58+
<div class="">
5059
<div id="testList">
5160
<table id="testTable" class="table table-hover display" name="testTable">
5261
</table>

source/src/main/webapp/TestCaseExecution.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<head>
2626
<meta name="active-menu" content="reporting">
2727
<meta name="active-submenu" content="TestCaseExecution.jsp">
28+
<meta name="active-page" content="TestCaseExecution.jsp">
2829
<meta name="page" content="Test Case Execution">
2930
<<meta content="text/html; charset=UTF-8" http-equiv="content-type">
3031
<%@ include file="include/global/dependenciesInclusions.html" %>

source/src/main/webapp/include/global/aiBottomBar.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@
145145

146146
const protocol = window.location.protocol === "https:" ? "wss://" : "ws://";
147147
const host = window.location.host;
148-
const pageName = document.querySelector('meta[name="active-submenu"]')?.content;
148+
const pageName = document.querySelector('meta[name="active-page"]')?.content;
149149
const fullPath = window.location.pathname;
150150
const context = pageName ? fullPath.replace("/" + pageName, "") : "";
151151

source/src/main/webapp/include/global/dependenciesInclusions.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
<!--Static content-->
88
<script type="text/javascript" src="js/static-data/labels.js"></script>
99

10-
<!--Favico JS
11-
<script src="dependencies/favico.js-0.3.10/favico-0.3.10.min.js"></script>-->
10+
<!--Favico JS-->
11+
<script src="dependencies/favico.js-0.3.10/favico-0.3.10.min.js"></script>
1212

1313
<!--Font Awesome-->
1414
<link rel="stylesheet" type="text/css" href="dependencies/FontAwesome-4.5.0/css/font-awesome.min.css">

source/src/main/webapp/js/pages/Test.js

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ $.when($.getScript("js/global/global.js")).then(function () {
2828
$('#addEntryModal').on('hidden.bs.modal', {extra: "#addEntryModal"}, modalFormCleaner);
2929

3030
var config = new TableConfigurationsServerSide("testTable", "ReadTest", "contentTable", aoColumnsFunc(), [1, 'asc']);
31-
var table = createDataTableWithPermissions(config, renderOptionsForTest, "#testList", undefined, true);
31+
var table = createDataTableWithPermissionsNew(config, renderOptionsForTest, "#testList", undefined, true);
3232

3333
$('[data-toggle="popover"]').popover({
3434
'placement': 'auto',
@@ -68,10 +68,25 @@ function renderOptionsForTest(data) {
6868

6969
if (data["hasPermissions"]) {
7070
if ($("#createTestButton").length === 0) {
71-
var contentToAdd = "<div class='marginBottom10'><button id='createTestButton' type='button' class='btn btn-default'>\n\
72-
<span class='glyphicon glyphicon-plus-sign'></span> " + doc.getDocLabel("page_test", "btn_create") + "</button></div>";
73-
74-
$("#testTable_wrapper div#testTable_length").before(contentToAdd);
71+
var contentToAdd = "";
72+
// Bouton Create
73+
contentToAdd += `
74+
<button id='createTestButton' type='button'
75+
class='bg-sky-400 hover:bg-sky-500 flex items-center space-x-1 px-3 py-1 rounded-lg h-10 w-auto'>
76+
<span class='glyphicon glyphicon-plus-sign'></span>
77+
<span>${doc.getDocLabel("page_test", "btn_create")}</span>
78+
</button>
79+
`;
80+
81+
var $wrapper = $("#testTable_buttonWrapper");
82+
if ($wrapper.length) {
83+
// Ajoute le bouton au **début** du wrapper
84+
$wrapper.append(contentToAdd);
85+
} else {
86+
// fallback si le wrapper n’existe pas encore
87+
console.warn("Wrapper #testTable_buttonWrapper introuvable, insertion avant length");
88+
$("#testTable_wrapper div#testTable_length").before("<div id='testTable_buttonWrapper' class='flex w-full gap-2'>" + contentToAdd + "</div>");
89+
}
7590
$('#testList #createTestButton').click(addEntryClick);
7691
}
7792
}

source/src/main/webapp/js/pages/TestCaseList.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,16 @@ function renderOptionsForTestCaseList(data) {
129129
</button>
130130
`;
131131

132+
// Bouton TestFolder
133+
contentToAdd += `
134+
<button id='testFolderButton' type='button'
135+
class='flex items-center gap-2 px-3 py-2 rounded-lg border border-gray-300 dark:border-gray-600 hover:border-sky-500 h-10'
136+
onclick="window.location.href='Test.jsp'">
137+
<span class='glyphicon glyphicon-folder-close'></span>
138+
<span>Manage Test Folder</span>
139+
</button>
140+
`;
141+
132142
// Bouton Import
133143
contentToAdd += `
134144
<button id='importTestCaseButton' type='button'

0 commit comments

Comments
 (0)