Skip to content

Commit

Permalink
Merge pull request #28 from alecharp/JENKINS-26895
Browse files Browse the repository at this point in the history
[JENKINS-26895] Fix optional dependency check on dashboard-view
  • Loading branch information
oleg-nenashev committed Dec 8, 2017
2 parents cf22988 + fbf239c commit a11d6a9
Showing 1 changed file with 2 additions and 13 deletions.
Expand Up @@ -12,7 +12,6 @@
import hudson.model.Cause.UserIdCause;
import hudson.plugins.release.ReleaseWrapper.ReleaseBuildBadgeAction;
import hudson.plugins.view.dashboard.DashboardPortlet;
import hudson.tasks.Mailer;
import hudson.util.RunList;

import java.io.IOException;
Expand All @@ -24,7 +23,6 @@
import java.util.ListIterator;

import javax.servlet.ServletException;
import jenkins.model.Jenkins;
import jenkins.model.JenkinsLocationConfiguration;

import org.kohsuke.stapler.DataBoundConstructor;
Expand Down Expand Up @@ -117,18 +115,9 @@ private void rss(StaplerRequest req, StaplerResponse rsp, String suffix, RunList
RSS.forwardToRss(getDisplayName()+ suffix, getDashboard().getUrl() + getUrl(),
runs.newBuilds(), new RelativePathFeedAdapter(getDashboard().getUrl() + getUrl()), req, rsp );
}

public static class DescriptorImpl extends Descriptor<DashboardPortlet> {

@Extension
public static DescriptorImpl newInstance() {
if (Jenkins.getActiveInstance().getPlugin("dashboard-view") != null) {
return new DescriptorImpl();
} else {
return null;
}
}

@Extension(optional = true)
public static class DescriptorImpl extends Descriptor<DashboardPortlet> {
@Override
public String getDisplayName() {
return "Recent Releases";
Expand Down

0 comments on commit a11d6a9

Please sign in to comment.