[ADF-3108] Search - facetQueries panel renders when not defined in configuration (#3417)

* show facetQueries based on configuration definition

* tests

* FacetQueries is defined
This commit is contained in:
Cilibiu Bogdan
2018-06-01 00:05:46 +03:00
committed by Denys Vuika
parent 3f332997c6
commit 2f12f518ef
4 changed files with 50 additions and 11 deletions

View File

@@ -159,6 +159,19 @@ export class SearchQueryBuilderService {
return [];
}
/**
* Check if FacetQueries has been defined
*/
get hasFacetQueries(): boolean {
if (this.config
&& this.config.facetQueries
&& this.config.facetQueries.queries
&& this.config.facetQueries.queries.length > 0) {
return true;
}
return false;
}
private get sort(): RequestSortDefinitionInner[] {
return this.sorting.map(def => {
return {
@@ -217,14 +230,4 @@ export class SearchQueryBuilderService {
return null;
}
private get hasFacetQueries(): boolean {
if (this.config
&& this.config.facetQueries
&& this.config.facetQueries.queries
&& this.config.facetQueries.queries.length > 0) {
return true;
}
return false;
}
}