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

[JENKINS-71909]: Revert https://github.com/jenkinsci/active-choices-p… #298

Merged
merged 1 commit into from
Oct 6, 2024
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
- Bump typescript from 5.4.3 to 5.6.2
- Bump webpack from 5.91.0 to 5.94.0
- Bump ws from 8.17.0 to 8.17.1
- Reverted JENKINS-71365, pull request #79, making the Stapler proxy synchronous again, to ensure determinism in parameters resolution, fixing a regression
- Update pom.xml to switch from node 18.16 to 18.18 (for eslint 9)
- Update pom.xml to bump Jenkins version to Jenkins 2.462.2 (job-dsl requirement)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<gitHubRepo>jenkinsci/active-choices-plugin</gitHubRepo>
<node.version>18.18.0</node.version>
<yarn.version>1.22.19</yarn.version>
<ui.loading.timeout>PT60S</ui.loading.timeout>
<ui.loading.timeout>PT300S</ui.loading.timeout>
</properties>

<scm>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@
</j:choose>
</select>
</f:entry>
<f:entry title="${%Referenced parameters}" field="referencedParameters" help="${rootURL}/../plugin/uno-choice/help-referencedParameters.html">
<f:entry title="${%Referenced parameters}" field="referencedParameters" help="/plugin/uno-choice/help-referencedParameters.html">
<f:textbox name="parameter.referencedParameters" value="${instance.referencedParameters}" />
</f:entry>
<f:entry title="${%Enable filters}" field="filterable" help="${rootURL}/../plugin/uno-choice/help-filterableParameters.html">
<f:entry title="${%Enable filters}" field="filterable" help="/plugin/uno-choice/help-filterableParameters.html">
<f:checkbox name="parameter.filterable" checked="${instance.filterable}">${%Filterable}</f:checkbox>
</f:entry>
<f:entry title="${%Filter starts at}" field="filterLength" help="${rootURL}/../plugin/uno-choice/help-filterLengthParameters.html">
<f:entry title="${%Filter starts at}" field="filterLength" help="/plugin/uno-choice/help-filterLengthParameters.html">
<f:textbox name="parameter.filterLength" default="1" value="${instance.filterLength}" />
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,18 @@
// source, references table
var referencedParameters = Array();
<j:forEach var="value" items="${it.getReferencedParametersAsArray()}">
// add the element we want to monitor
referencedParameters.push("${value}");
// add the element we want to monitor
referencedParameters.push("${value}");
</j:forEach>

if (window.makeStaplerProxy) {
window.__old__makeStaplerProxy = window.makeStaplerProxy;
window.makeStaplerProxy = UnoChoice.makeStaplerProxy2;
}
var cascadeChoiceParameter = <st:bind value="${it}"/>; // Create Jenkins proxy
if (window.makeStaplerProxy) {
window.makeStaplerProxy = window.__old__makeStaplerProxy;
}
UnoChoice.renderCascadeChoiceParameter('#${h.escape(paramName)}', ${it.filterable}, '${h.escape(it.getName())}', '${h.escape(it.getRandomName())}', ${it.getFilterLength()}, '${h.escape(paramName)}', referencedParameters, cascadeChoiceParameter);

</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,10 @@
</j:choose>
</select>
</f:entry>
<f:entry title="${%Enable filters}" field="filterable" help="${rootURL}/../plugin/uno-choice/help-filterableParameters.html">
<f:entry title="${%Enable filters}" field="filterable" help="/plugin/uno-choice/help-filterableParameters.html">
<f:checkbox name="parameter.filterable" checked="${instance.filterable}">${%Filterable}</f:checkbox>
</f:entry>
<f:entry title="${%Filter starts at}" field="filterLength" help="${rootURL}/../plugin/uno-choice/help-filterLengthParameters.html">
<f:entry title="${%Filter starts at}" field="filterLength" help="/plugin/uno-choice/help-filterLengthParameters.html">
<f:textbox name="parameter.filterLength" default="1" value="${instance.filterLength}" />
</f:entry>
</j:jelly>
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,11 @@
</j:choose>
</select>
</f:entry>
<f:entry title="${%Referenced parameters}" field="referencedParameters" help="${rootURL}/../plugin/uno-choice/help-referencedParameters.html">
<f:entry title="${%Referenced parameters}" field="referencedParameters" help="/plugin/uno-choice/help-referencedParameters.html">
<f:textbox name="parameter.referencedParameters" value="${instance.referencedParameters}" />
</f:entry>
<f:advanced>
<f:entry title="${%Omit value field}" field="omitValueField" help="${rootURL}/../plugin/uno-choice/help-omitValueField.html">
<f:entry title="${%Omit value field}" field="omitValueField" help="/plugin/uno-choice/help-omitValueField.html">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A e2e test was failing on the IDE (didn't check if it was failing on Jenkins). There seems to be a new convention where parameters like omitValueField automatically load if there is a file sitting next to the Jelly file with name omitValueField-help.html, I think. But instead of trying that I just used another recent example (gitlab-plugin) as reference to update these.

<f:checkbox name="parameter.omitValueField" checked="${instance.omitValueField}" default="false">${%Omit value field}</f:checkbox>
</f:entry>
</f:advanced>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@
// source, references table
var referencedParameters = Array();
<j:forEach var="value" items="${it.getReferencedParametersAsArray()}">
// add the element we want to monitor
referencedParameters.push("${value}");
// add the element we want to monitor
referencedParameters.push("${value}");
</j:forEach>

if (window.makeStaplerProxy) {
window.__old__makeStaplerProxy = window.makeStaplerProxy;
window.makeStaplerProxy = UnoChoice.makeStaplerProxy2;
}
var dynamicReferenceParameter = <st:bind value="${it}"/>; // Create Jenkins proxy
if (window.makeStaplerProxy) {
window.makeStaplerProxy = window.__old__makeStaplerProxy;
}
UnoChoice.renderDynamicRenderParameter('#${paramName}', '${h.escape(it.getName())}', '${h.escape(paramName)}', referencedParameters, dynamicReferenceParameter);

// update spinner id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
maxCount = ${it.visibleItemCount};
}

var refElement = document.getElementById("${id}");
var refElement = document.getElementById("ecp_${h.escape(it.randomName)}_0");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This var doesn't exit, resulting in a warning during runtime (browser console) and no element found.

if(maxCount > 0 && refElement && refElement.offsetHeight !=0) {
for(var i=0; i< maxCount; i++) {
height += refElement.offsetHeight + 3;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<f:property field="scriptlerBuilder"/>
<f:entry
field="isSandboxed"
help="${rootURL}/../descriptor/org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript/help/sandbox"
help="/descriptor/org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SecureGroovyScript/help/sandbox"
>
<f:checkbox
title="Use Groovy Sandbox"
Expand Down
Loading