mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-09 01:56:03 +00:00
applied the stapler subtype bindJSON change to SCM browsers, too.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@10560 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
903da46035
commit
fdb4e7253e
2 files changed
+7
-16
No files matched your search
@@ -66,17 +66,9 @@ public class RepositoryBrowsers {
|
||||
T createInstance(Class<T> type, StaplerRequest req, JSONObject parent, String fieldName) throws FormException {
|
||||
List<Descriptor<RepositoryBrowser<?>>> list = filter(type);
|
||||
|
||||
Object o = parent.get(fieldName);
|
||||
JSONObject o = (JSONObject)parent.get(fieldName);
|
||||
if(o==null) return null;
|
||||
|
||||
if(o instanceof String && "auto".equals(o))
|
||||
return null;
|
||||
|
||||
if (o instanceof JSONArray) {
|
||||
JSONArray a = (JSONArray) o;
|
||||
return type.cast(list.get(a.getInt(0)).newInstance(req,a.getJSONObject(1)));
|
||||
}
|
||||
|
||||
throw new AssertionError(o.getClass()+" : "+o);
|
||||
return req.bindJSON(type,o);
|
||||
}
|
||||
}
|
||||
@@ -9,12 +9,11 @@
|
||||
<j:set var="currentBrowser" value="${scm.browser}"/>
|
||||
<j:forEach var="d" items="${scmd.browserDescriptors}" varStatus="loop">
|
||||
<f:dropdownListBlock value="${loop.index}" title="${d.displayName}" selected="${currentBrowser.descriptor==d}">
|
||||
<f:nested>
|
||||
<table width="100%">
|
||||
<j:set var="browser" value="${h.ifThenElse(currentBrowser.descriptor==d, currentBrowser, null)}"/>
|
||||
<st:include from="${d}" page="${d.configPage}"/>
|
||||
</table>
|
||||
</f:nested>
|
||||
<j:set var="browser" value="${h.ifThenElse(currentBrowser.descriptor==d, currentBrowser, null)}"/>
|
||||
<tr><td>
|
||||
<input type="hidden" name="stapler-class" value="${d.clazz.name}" />
|
||||
</td></tr>
|
||||
<st:include from="${d}" page="${d.configPage}"/>
|
||||
</f:dropdownListBlock>
|
||||
</j:forEach>
|
||||
</f:dropdownList>
|
||||
|
||||
Reference in new issue
Block a user