Skip to content

Commit

Permalink
disable checkRC if submit job is not sync (#88)
Browse files Browse the repository at this point in the history
Signed-off-by: Anatoli Kalbasin <[email protected]>
  • Loading branch information
callbacksin authored Oct 22, 2024
1 parent 188ef5c commit 620a967
Showing 1 changed file with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@

<jelly:jelly xmlns:jelly="jelly:core" xmlns:form="/lib/form" xmlns:stapler="jelly:stapler">

<style>
.SubmitJob-sub-property {
margin-top: -10px;
margin-left: 30px;
}
</style>

<jelly:set var="stepId" value="${descriptor.createStepId()}" />

<form:entry field="connectionName" title="${%zdevops.classic.connection.title}">
Expand All @@ -15,20 +22,21 @@
<form:entry title="Wait till end and get logs" field="sync">
<form:checkbox id="${stepId}_sync" onclick="checkSync${stepId}();"/>
</form:entry>
<form:entry title="Fail if RC is not 0000" field="checkRC">
<form:entry title="Fail if RC is not 0000" field="checkRC" class="SubmitJob-sub-property">
<form:checkbox id="${stepId}_checkRC" onclick="checkSync${stepId}();"/>
</form:entry>

<script>
function checkSync${stepId}() {
var sync = document.getElementById('${stepId}_sync');
var checkRC = document.getElementById('${stepId}_checkRC');

checkRC.readonly = sync.checked;
console.log("it works");
checkRC.removeAttribute('disabled');

if (!sync.checked &amp;&amp; checkRC.checked) {
checkRC.checked = false;
checkRC.readonly = true;
checkRC.disabled = "disabled";
}
}
</script>
Expand Down

0 comments on commit 620a967

Please sign in to comment.