Skip to content

Commit

Permalink
[FIXED JENKINS-17713] JobColumn/column.jelly needs to have an itemGro…
Browse files Browse the repository at this point in the history
…up for display name calculation.

So passing it in explicitly from both the view main page and from the Maven module set modules page.
A more automatic solution might be to make getRelativeDisplayNameFrom use Ancestor.
  • Loading branch information
jglick authored and kohsuke committed Jun 19, 2013
1 parent 982397e commit b0c2224
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion core/src/main/resources/hudson/model/TreeView/ajaxRows.jelly
Expand Up @@ -32,6 +32,7 @@ THE SOFTWARE.
<table><!-- throw away table tag to group rows together -->
<j:set var="depth" value="${request.getParameter('depth')}" />
<j:set var="indenter" value="${it.createFixedIndenter(depth)}" />
<!-- TODO set itemGroup? -->
<j:forEach var="v" items="${it.views}">
<t:projectViewNested />
</j:forEach>
Expand All @@ -40,4 +41,4 @@ THE SOFTWARE.
</j:forEach>
</table>
</l:ajax>
</j:jelly>
</j:jelly>
2 changes: 1 addition & 1 deletion core/src/main/resources/hudson/model/View/main.groovy
Expand Up @@ -11,7 +11,7 @@ if (items.isEmpty()) {
}
include(my,"noJob.jelly");
} else {
t.projectView(jobs: items, showViewTabs: true, columnExtensions: my.columns, indenter: my.indenter) {
t.projectView(jobs: items, showViewTabs: true, columnExtensions: my.columns, indenter: my.indenter, itemGroup: my.owner.itemGroup) {
set("views",my.owner.views);
set("currentView",my);
if (my.owner.class == hudson.model.MyViewsProperty.class) {
Expand Down
Expand Up @@ -25,6 +25,6 @@ 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">
<td style="${indenter.getCss(job)}">
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link inside'> <l:breakable value="${h.getRelativeDisplayNameFrom(job,currentView.owner.itemGroup)}"/></a>
<a href="${jobBaseUrl}${job.shortUrl}" class='model-link inside'> <l:breakable value="${h.getRelativeDisplayNameFrom(job, itemGroup)}"/></a>
</td>
</j:jelly>
3 changes: 3 additions & 0 deletions core/src/main/resources/lib/hudson/projectView.jelly
Expand Up @@ -49,6 +49,9 @@ THE SOFTWARE.
<st:attribute name="columnExtensions" type="Collection&lt;hudson.views.ListViewColumn>">
List view columns to render. If omitted, the default ones from ListView.getDefaultColumns() are used.
</st:attribute>
<st:attribute name="itemGroup" use="optional" type="hudson.model.ItemGroup">
The containing group, for purposes of name calculation.
</st:attribute>
</st:documentation>

<t:setIconSize/>
Expand Down
Expand Up @@ -44,7 +44,7 @@ THE SOFTWARE.
</j:when>
<j:otherwise>
<j:set var="needsView" value="${it.hasDisabledModule()}" />
<t:projectView jobs="${it.getDisabledModules(false)}" showViewTabs="${needsView}" indenter="${it.createIndenter()}">
<t:projectView jobs="${it.getDisabledModules(false)}" showViewTabs="${needsView}" indenter="${it.createIndenter()}" itemGroup="${it}">
<!-- view tab bar -->
<j:if test="${needsView}">
<l:tabBar>
Expand Down
5 changes: 0 additions & 5 deletions test/src/test/java/hudson/maven/MavenMultiModuleTest.java
@@ -1,6 +1,5 @@
package hudson.maven;

import com.gargoylesoftware.htmlunit.html.HtmlAnchor;
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import org.junit.Assert;
import org.jvnet.hudson.test.Bug;
Expand Down Expand Up @@ -413,7 +412,6 @@ else if (parentModuleName.equals("org.jvnet.hudson.main.test.multimod.incr:modul
assertEquals("not only one module", 1, m.getModules().size());
}

@Ignore("still failing")
@Bug(17713)
@Test public void modulesPageLinks() throws Exception {
j.configureMaven3();
Expand All @@ -425,9 +423,6 @@ else if (parentModuleName.equals("org.jvnet.hudson.main.test.multimod.incr:modul
assertEquals(1, m.getLastBuild().getNumber());
JenkinsRule.WebClient wc = j.createWebClient();
HtmlPage modulesPage = wc.getPage(ms, "modules");
for (HtmlAnchor a : modulesPage.getAnchors()) {
System.out.println(a.getHrefAttribute() + " → " + a.asText());
}
modulesPage.getAnchorByText(m.getDisplayName()).openLinkInNewWindow();
}

Expand Down

0 comments on commit b0c2224

Please sign in to comment.