Skip to content

Commit

Permalink
[JENKINS-74014] Extract inline JavaScript from `BuildTimestampWrapper…
Browse files Browse the repository at this point in the history
…/global.jelly` (#76)
  • Loading branch information
yaroslavafenkin authored Nov 6, 2024
1 parent 135b826 commit bcdf74e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,22 +148,22 @@ public FormValidation doCheckPattern(@QueryParameter("pattern") String patternPa
}
}

public FormValidation doCheckKey(@QueryParameter("key") String key) {
if (isVariableNameValid(key)) {
public FormValidation doCheckKey(@QueryParameter String value) {
if (isVariableNameValid(value)) {
return FormValidation.ok();
}
return FormValidation.error("Invalid variable name");
}

public FormValidation doCheckValue(@QueryParameter("value") String value) {
public FormValidation doCheckValue(@QueryParameter String value) {
if (isPatternValid(value)) {
return FormValidation.ok();
}
return FormValidation.error("Invalid pattern");
}

public FormValidation doCheckShiftExpression(@QueryParameter("shiftExpression") String shiftExpression) {
if (ShiftExpressionHelper.isShiftExpressionValid(shiftExpression)) {
public FormValidation doCheckShiftExpression(@QueryParameter String value) {
if (ShiftExpressionHelper.isShiftExpressionValid(value)) {

Check warning on line 166 in src/main/java/com/orctom/jenkins/plugin/buildtimestamp/BuildTimestampWrapper.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered lines

Lines 152-166 are not covered by tests
return FormValidation.ok();
}
return FormValidation.error("Invalid time shift expression");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
<f:repeatable field="extraProperties" items="${extraProperties}">
<table width="100%">
<f:entry title="Name:" field="key" help="/plugin/build-timestamp/help-name.html">
<f:textbox field="key" value="${instance.key}"
checkUrl="'${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkKey?key='+escape(this.value)" />
<f:textbox checkDependsOn=""
checkUrl="${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkKey" />
</f:entry>
<f:entry title="Pattern:" field="value" help="/plugin/build-timestamp/help-pattern.html">
<f:textbox field="value" value="${instance.value}"
checkUrl="'${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkValue?value='+escape(this.value)" />
<f:textbox checkDependsOn=""
checkUrl="${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkValue" />
</f:entry>
<f:entry title="Shift timestamp:" field="shiftExpression" help="/plugin/build-timestamp/help-shiftExpression.html">
<f:textbox field="shiftExpression" value="${instance.shiftExpression}"
checkUrl="'${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkShiftExpression?shiftExpression='+escape(this.value)" />
<f:textbox checkDependsOn=""
checkUrl="${rootURL}/descriptorByName/com.orctom.jenkins.plugin.buildtimestamp.BuildTimestampWrapper/checkShiftExpression" />
</f:entry>
<f:entry title="">
<div align="right">
Expand Down

0 comments on commit bcdf74e

Please sign in to comment.