Skip to content

Commit

Permalink
search filterfacet isOpenByDefault as facetentry property to FacetsCo…
Browse files Browse the repository at this point in the history
…nverter

DSpace#9404
  • Loading branch information
floriangantner committed Mar 11, 2024
1 parent 6b3e62c commit 5167563
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public void addFacetValues(Context context, final DiscoverResult searchResult, f
if (field.exposeMinAndMaxValue()) {
handleExposeMinMaxValues(context, field, facetEntry);
}
facetEntry.setOpenByDefault(field.isOpenByDefault());
facetEntry.setExposeMinMax(field.exposeMinAndMaxValue());
facetEntry.setFacetType(field.getType());
for (DiscoverResult.FacetResult value : CollectionUtils.emptyIfNull(facetValues)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public static Matcher<? super Object> authorFacet(boolean hasNext) {
hasJsonPath("$.name", is("author")),
hasJsonPath("$.facetType", is("text")),
hasJsonPath("$.facetLimit", any(Integer.class)),
hasJsonPath("$.openByDefault", any(Boolean.class)),
hasJsonPath("$._links.self.href", containsString("api/discover/facets/author")),
hasJsonPath("$._links", matchNextLink(hasNext, "api/discover/facets/author"))
);
Expand All @@ -40,6 +41,7 @@ public static Matcher<? super Object> authorFacetWithMinMax(boolean hasNext, Str
hasJsonPath("$.facetLimit", any(Integer.class)),
hasJsonPath("$.minValue", is(min)),
hasJsonPath("$.maxValue", is(max)),
hasJsonPath("$.openByDefault", any(Boolean.class)),
hasJsonPath("$._links.self.href", containsString("api/discover/facets/author")),
hasJsonPath("$._links", matchNextLink(hasNext, "api/discover/facets/author"))
);
Expand Down

0 comments on commit 5167563

Please sign in to comment.