Skip to content

Commit

Permalink
Merge pull request #11 from opencloud/JENKINS-8276-fix-job-filters
Browse files Browse the repository at this point in the history
[JENKINS-8276] Moved method that tests for job filter extenstions fro…
  • Loading branch information
tbingaman committed Oct 5, 2015
2 parents 3769737 + 7a9f98f commit 7e82f27
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
Expand Up @@ -104,8 +104,12 @@ public Iterable<ViewJobFilter> getJobFilters() {
return jobFilters;
}

/**
* @deprecated use {@link SectionedViewSectionDescriptor#hasJobFilterExtensions()} instead
*/
@Deprecated
public boolean hasJobFilterExtensions() {
return !ViewJobFilter.all().isEmpty();
return getDescriptor().hasJobFilterExtensions();
}

public Width getWidth() {
Expand Down
Expand Up @@ -55,6 +55,10 @@ protected SectionedViewSectionDescriptor(Class<? extends SectionedViewSection> c
protected SectionedViewSectionDescriptor() {
}

public boolean hasJobFilterExtensions() {
return !ViewJobFilter.all().isEmpty();
}

@Override
public SectionedViewSection newInstance(StaplerRequest req, JSONObject formData) throws FormException {
SectionedViewSection section = (SectionedViewSection)req.bindJSON(getClass().getDeclaringClass(), formData);
Expand Down
Expand Up @@ -49,7 +49,7 @@ THE SOFTWARE.
</f:entry>
</f:optionalBlock>

<j:if test="${instance.hasJobFilterExtensions()}">
<j:if test="${descriptor.hasJobFilterExtensions()}">
<j:invokeStatic var="allJobFilters" className="hudson.views.ViewJobFilter" method="all"/>
<f:block>
<f:hetero-list name="jobFilters" hasHeader="true"
Expand Down
Expand Up @@ -43,7 +43,7 @@ THE SOFTWARE.
</j:forEach>
</f:entry>

<j:if test="${instance.hasJobFilterExtensions()}">
<j:if test="${descriptor.hasJobFilterExtensions()}">
<j:invokeStatic var="allJobFilters" className="hudson.views.ViewJobFilter" method="all"/>
<f:block>
<f:hetero-list name="jobFilters" hasHeader="true"
Expand Down

0 comments on commit 7e82f27

Please sign in to comment.