Skip to content

Commit

Permalink
JENKINS-26036 additionally, remove nested-view dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
apemberton committed May 31, 2015
1 parent ef94a3a commit ea265bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 30 deletions.
6 changes: 0 additions & 6 deletions pom.xml
Expand Up @@ -52,12 +52,6 @@
</pluginRepositories>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>nested-view</artifactId>
<version>1.8</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
Expand Down
Expand Up @@ -2,16 +2,11 @@

import hudson.model.Action;
import hudson.model.TransientViewActionFactory;
import hudson.model.ViewGroup;
import hudson.model.Hudson;
import hudson.model.View;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.lang.StringUtils;

/**
* Adds the walldisplay link action to all views
*
Expand All @@ -21,24 +16,8 @@ public class WallDisplayTransientViewActionFactory extends TransientViewActionFa

@Override
public List<Action> createFor(final View view) {

List<Action> result = new ArrayList<Action>();
String viewName = view.getViewName();

if (Hudson.getInstance().getPlugin("nested-view") != null) {
ArrayList<String> viewNames = new ArrayList<String>();
viewNames.add(viewName);
ViewGroup owner = view.getOwner();
while (owner instanceof hudson.plugins.nested_view.NestedView) {
viewNames.add(((hudson.plugins.nested_view.NestedView) owner).getViewName());
owner = ((hudson.plugins.nested_view.NestedView) owner).getOwner();
}
Collections.reverse(viewNames);
viewName = StringUtils.join(viewNames, "/view/");
}
result.add(new WallDisplayViewAction(viewName, view.getOwner().getUrl()));
return result;

WallDisplayViewAction action = new WallDisplayViewAction(view.getViewName(), view.getOwner().getUrl());
return Arrays.asList((Action) action);
}

}

0 comments on commit ea265bc

Please sign in to comment.