Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIXED JENKINS-26921] Move build graph on one click less distance to …
…job's root page
- Loading branch information
1 parent
32fb32e
commit df2e776
Showing
2 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
src/main/java/org/jenkinsci/plugins/buildgraphview/BuildGraphProjectAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package org.jenkinsci.plugins.buildgraphview; | ||
|
||
import hudson.model.AbstractProject; | ||
import hudson.model.Action; | ||
import jenkins.model.Jenkins; | ||
|
||
public class BuildGraphProjectAction implements Action { | ||
|
||
private AbstractProject abstractProject; | ||
|
||
public BuildGraphProjectAction(AbstractProject abstractProject) { | ||
this.abstractProject = abstractProject; | ||
} | ||
|
||
@Override | ||
public String getIconFileName() { | ||
return "/plugin/buildgraph-view/images/16x16/chain.png"; | ||
} | ||
|
||
@Override | ||
public String getDisplayName() { | ||
return "Build Graph"; | ||
} | ||
|
||
@Override | ||
public String getUrlName() { | ||
return Jenkins.getInstance().getRootUrl() + abstractProject.getLastBuild().getUrl() + "BuildGraph"; | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/org/jenkinsci/plugins/buildgraphview/BuildGraphProjectActionFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.jenkinsci.plugins.buildgraphview; | ||
|
||
import hudson.Extension; | ||
import hudson.model.AbstractProject; | ||
import hudson.model.Action; | ||
import hudson.model.TransientProjectActionFactory; | ||
|
||
import java.util.Collection; | ||
import java.util.Collections; | ||
|
||
@Extension | ||
public class BuildGraphProjectActionFactory extends TransientProjectActionFactory{ | ||
@Override | ||
public Collection<? extends Action> createFor(AbstractProject abstractProject) { | ||
return Collections.singleton(new BuildGraphProjectAction(abstractProject)); | ||
} | ||
} |