提交 c2787404 编写于 作者: K Kohsuke Kawaguchi

if there's nothing for the user to select, display nothing.

上级 cc29c9b3
......@@ -774,18 +774,11 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
else
executionStrategy = req.bindJSON(esd.get(0).clazz,json.getJSONObject("executionStrategy"));
try {
List<MatrixCheckoutStrategyDescriptor> mrcsd = MatrixCheckoutStrategyDescriptor
.all();
if (mrcsd.size() > 1)
matrixCheckoutStrategy = req.bindJSON(MatrixCheckoutStrategy.class,
json.getJSONObject("matrixCheckoutStrategy"));
else
matrixCheckoutStrategy = req.bindJSON(mrcsd.get(0).clazz,
json.getJSONObject("matrixCheckoutStrategy"));
} catch (Exception exc) {
matrixCheckoutStrategy = new DefaultMatrixCheckoutStrategyImpl();
}
if (json.has("matrixCheckoutStrategy"))
matrixCheckoutStrategy = req.bindJSON(MatrixCheckoutStrategy.class,
json.getJSONObject("matrixCheckoutStrategy"));
else
matrixCheckoutStrategy = null;
// parse system axes
DescribableList<Axis,AxisDescriptor> newAxes = new DescribableList<Axis,AxisDescriptor>(this);
......
......@@ -58,15 +58,9 @@ THE SOFTWARE.
<p:config-scm/>
<f:section title="${%Advanced Source Code Management}">
<j:choose>
<j:when test="${descriptor.matrixRunCheckoutStrategyDescriptors.size() gt 1}">
<f:dropdownDescriptorSelector title="${%Matrix Run Checkout Strategy}" field="matrixCheckoutStrategy"/>
</j:when>
<j:otherwise>
<!-- for the default case when there's only one build checkout strategy, render it inline to simplify the UI -->
<f:property field="matrixCheckoutStrategy" propertyDescriptor="${descriptor.matrixRunCheckoutStrategyDescriptors.get(0)}"/>
</j:otherwise>
</j:choose>
<j:if test="${descriptor.matrixRunCheckoutStrategyDescriptors.size() gt 1}">
<f:dropdownDescriptorSelector title="${%SCM Checkout Strategy}" field="matrixCheckoutStrategy"/>
</j:if>
</f:section>
<p:config-trigger>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册