Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable checkRC field if submit job step is not synchronous #88

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

<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()}" />
<p>${stepId}</p>

<form:entry field="connectionName" title="${%zdevops.classic.connection.title}">
<form:select/>
Expand All @@ -16,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