mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
remove search configuration enforcement (#3315)
This commit is contained in:
committed by
Eugenio Romano
parent
84a9837789
commit
bd4451e83d
@@ -27,14 +27,6 @@ describe('SearchQueryBuilder', () => {
|
||||
return config;
|
||||
};
|
||||
|
||||
it('should throw error if configuration not provided', () => {
|
||||
expect(() => {
|
||||
const appConfig = new AppConfigService(null);
|
||||
// tslint:disable-next-line:no-unused-expression
|
||||
new SearchQueryBuilderService(appConfig, null);
|
||||
}).toThrowError('Search configuration not found.');
|
||||
});
|
||||
|
||||
it('should use only enabled categories', () => {
|
||||
const config: SearchConfiguration = {
|
||||
categories: [
|
||||
|
@@ -41,15 +41,11 @@ export class SearchQueryBuilderService {
|
||||
|
||||
constructor(appConfig: AppConfigService, private alfrescoApiService: AlfrescoApiService) {
|
||||
this.config = appConfig.get<SearchConfiguration>('search');
|
||||
if (!this.config) {
|
||||
throw new Error('Search configuration not found.');
|
||||
}
|
||||
|
||||
if (this.config.categories) {
|
||||
this.categories = this.config.categories.filter(f => f.enabled);
|
||||
if (this.config) {
|
||||
this.categories = (this.config.categories || []).filter(f => f.enabled);
|
||||
this.filterQueries = this.config.filterQueries || [];
|
||||
}
|
||||
|
||||
this.filterQueries = this.config.filterQueries || [];
|
||||
}
|
||||
|
||||
addFilterQuery(query: string): void {
|
||||
|
Reference in New Issue
Block a user