Skip to content

Commit 76e3719

Browse files
committed
fix problem on run modal
1 parent 6604688 commit 76e3719

File tree

7 files changed

+340
-7
lines changed

7 files changed

+340
-7
lines changed

source/src/main/webapp/TestCaseExecution.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<script type="text/javascript" src="js/transversalobject/File.js"></script>
4040
<script type="text/javascript" src="js/transversalobject/Robot.js"></script>
4141
<script type="text/javascript" src="js/transversalobject/Application.js"></script>
42+
<script type="text/javascript" src="js/transversalobject/TestCaseSimpleExecution.js"></script>
4243
<link rel="stylesheet" type="text/css" href="css/pages/TestCaseExecution.css">
4344
<link href="https://cdn.jsdelivr.net/css-toggle-switch/latest/toggle-switch.css" rel="stylesheet"/>
4445

source/src/main/webapp/TestCaseList.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<script type="text/javascript" src="js/pages/TestCaseList.js"></script>
3939
<script type="text/javascript" src="js/transversalobject/TestCase.js"></script>
4040
<script type="text/javascript" src="js/transversalobject/Application.js"></script>
41+
<script type="text/javascript" src="js/transversalobject/TestCaseSimpleExecution.js"></script>
4142
<title id="pageTitle">Test Case</title>
4243
</head>
4344
<body x-data x-cloak class="crb_body">

source/src/main/webapp/TestCaseScript.jsp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
<script type="text/javascript" src="js/transversalobject/AppService.js"></script>
4141
<script type="text/javascript" src="js/transversalobject/Application.js"></script>
4242
<script type="text/javascript" src="js/transversalobject/TestCaseExecutionQueue.js"></script>
43+
<script type="text/javascript" src="js/transversalobject/TestCaseSimpleExecution.js"></script>
4344
<link rel="stylesheet" type="text/css" href="css/pages/TestCaseScript.css">
4445
</head>
4546
<body x-data x-cloak class="crb_body">

source/src/main/webapp/include/transversalobject/TestCaseSimpleExecution.html

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,10 @@ <h3 class="text-2xl font-semibold">Run Test Case</h3>
2626
</div>
2727

2828
<!-- BODY -->
29-
<div class="p-8 space-y-8">
29+
<div class="p-8">
30+
31+
<!-- NOTIFY ANCHOR -->
32+
<div id="modalNotify"></div>
3033

3134
<!-- TEST INFO -->
3235
<div>
@@ -187,9 +190,10 @@ <h4 class="font-semibold text-lg">Choose robot</h4>
187190
<i data-lucide="sliders" class="text-orange-500 w-6 h-6"></i>
188191
</div>
189192
<h4 class="font-semibold text-foreground">Customize execution settings</h4>
190-
<i data-lucide="save"
191-
@click="saveSettings()"
192-
class="ml-auto w-5 h-5 text-gray-400 cursor-pointer hover:text-green-500"></i>
193+
<button @click="saveSettings()"
194+
class="ml-auto text-gray-400 hover:text-green-500 cursor-pointer">
195+
<i data-lucide="save" class="w-5 h-5"></i>
196+
</button>
193197
</div>
194198

195199
<div class="space-y-3">
@@ -290,7 +294,7 @@ <h4 class="font-semibold text-foreground">Customize execution settings</h4>
290294
<!-- FOOTER -->
291295
<div class="flex justify-end gap-4 pt-6">
292296
<button @click="close()"
293-
class="px-6 py-2 rounded-xl text-slate-700 bg-slate-200 hover:bg-slate-300">
297+
class="px-6 py-2 rounded-xl !text-slate-700 bg-slate-200 hover:bg-slate-300">
294298
Close
295299
</button>
296300

@@ -374,7 +378,11 @@ <h4 class="font-semibold text-foreground">Customize execution settings</h4>
374378
'executionSettings',
375379
JSON.stringify(this.settings)
376380
);
377-
notifyInPage("success", "Settings successfully saved")
381+
notifyInModal(
382+
"success",
383+
"Settings successfully saved",
384+
"#modalNotify"
385+
);
378386
},
379387

380388
loadSettings() {

source/src/main/webapp/js/global/notification.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,17 @@ function notifyInline(message, type = 'info', targetQuerySelector, confirm) {
4141
});
4242
}
4343

44+
function notifyInModal(type, message, targetQuerySelector) {
45+
Swal.fire({
46+
toast: true,
47+
position: 'top-end',
48+
icon: type,
49+
title: message,
50+
showConfirmButton: false,
51+
timer: 2500,
52+
target: document.querySelector(targetQuerySelector),
53+
backdrop: false,
54+
background: 'var(--crb-new-bg)',
55+
color: 'var(--crb-black-color)'
56+
});
57+
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,14 @@ $.when($.getScript("js/global/global.js")
360360
$("#rerunFromQueueandSee").attr("data-original-title", "Last Execution was <span class='status" + data.contentTable.controlStatus + "'>" + data.contentTable.controlStatus + "</span> in <b>" + data.contentTable.env + "</b> in <b>" + data.contentTable.country + "</b><br> on " + new Date(data.contentTable.end).toLocaleString());
361361
$("#runTestCase").unbind('click');
362362
$("#runTestCase").on('click', function () {
363-
openModalExecutionSimple(application, test, testcase, description, data.contentTable.country, data.contentTable.env, data.contentTable.robot);
363+
window.dispatchEvent(new CustomEvent('open-execution', {
364+
detail: {
365+
application: application,
366+
test: test,
367+
testcase: testcase,
368+
description: description
369+
}
370+
}))
364371
});
365372

366373
if (data.contentTable.queueId > 0) {

0 commit comments

Comments
 (0)