提交 d0dbd3b8 编写于 作者: R Rafa de la Torre 提交者: Kohsuke Kawaguchi

[FIXED JENKINS-13916] Text parameters are now defined and shown in a textarea...

[FIXED JENKINS-13916] Text parameters are now defined and shown in a textarea instead of a one line textbox.
上级 73ca50cd
......@@ -75,6 +75,9 @@ Upcoming changes</a>
<li class=bug>
Dynamically recomputing matrix axes wasn't working.
(<a href="https://github.com/jenkinsci/jenkins/pull/523">pull 523</a>)
<li class=bug>
"Text" build parameter should use &lt;textarea> for configuration
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-13916">issue 13916</a>)
<li class=rfe>
Make the draggable component more obvious by providing a border.
<li class=rfe>
......
......@@ -44,4 +44,16 @@ public class TextParameterDefinition extends StringParameterDefinition {
return Messages.TextParameterDefinition_DisplayName();
}
}
@Override
public ParameterValue createValue(StaplerRequest req, JSONObject jo) {
TextParameterValue value = req.bindJSON(TextParameterValue.class, jo);
value.setDescription(getDescription());
return value;
}
@Override
public ParameterValue createValue(String value) {
return new TextParameterValue(getName(), value, getDescription());
}
}
/*
* The MIT License
*
* Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Luca Domenico Milanesio, Tom Huybrechts, Rafa de la Torre
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
* THE SOFTWARE.
*/
package hudson.model;
import org.kohsuke.stapler.DataBoundConstructor;
/**
* @author Rafa de la Torre <rtorre@tuenti.com>
*/
public class TextParameterValue extends StringParameterValue {
@DataBoundConstructor
public TextParameterValue(String name, String value) {
super(name, value);
}
public TextParameterValue(String name, String value, String description) {
super(name, value, description);
}
@Override
public String toString() {
return "(TextParameterValue) " + getName() + "='" + value + "'";
}
}
<!--
The MIT License
Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Seiji Sogabe, Tom Huybrechts, Rafa de la Torre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='false'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${%Name}" help="/help/parameter/name.html">
<f:textbox name="parameter.name" value="${instance.name}" />
</f:entry>
<f:entry title="${%Default Value}" help="/help/parameter/string-default.html">
<f:textarea name="parameter.defaultValue" value="${instance.defaultValue}" />
</f:entry>
<f:entry title="${%Description}" help="/help/parameter/description.html">
<f:textarea name="parameter.description" value="${instance.description}" />
</f:entry>
</j:jelly>
\ No newline at end of file
<!--
The MIT License
Copyright (c) 2004-2012, Sun Microsystems, Inc., Kohsuke Kawaguchi, Tom Huybrechts, Rafa de la Torre
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-->
<?jelly escape-by-default='true'?>
<j:jelly xmlns:j="jelly:core" xmlns:st="jelly:stapler" xmlns:d="jelly:define"
xmlns:l="/lib/layout" xmlns:t="/lib/hudson" xmlns:f="/lib/form"
xmlns:i="jelly:fmt" xmlns:p="/lib/hudson/project">
<f:entry title="${it.name}" description="${it.description}">
<f:textarea name="value" value="${it.value}" readonly="readonly" />
</f:entry>
</j:jelly>
\ No newline at end of file
......@@ -81,6 +81,7 @@ THE SOFTWARE.
class="setting-input ${attrs.checkUrl!=null?'validated':''} ${attrs['codemirror-mode']!=null?'codemirror':''} ${attrs.class}"
checkUrl="${attrs.checkUrl}" checkMethod="${attrs.checkMethod}"
rows="${h.determineRows(value)}"
readonly="${attrs.readonly}"
codemirror-mode="${attrs['codemirror-mode']}"
codemirror-config="${attrs['codemirror-config']}">
<st:out value="${value}" />
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册