Skip to content
Permalink
Browse files

[JENKINS-26895] Fix optional dependency check on dashboard-view

  • Loading branch information
alecharp committed Dec 8, 2017
1 parent cf22988 commit fbf239c96b7baf9a7cc609397bd03077028fcc41
Showing with 2 additions and 13 deletions.
  1. +2 −13 src/main/java/hudson/plugins/release/dashboard/RecentReleasesPortlet.java
@@ -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;
@@ -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;
@@ -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";

0 comments on commit fbf239c

Please sign in to comment.
You can’t perform that action at this time.