diff --git a/src/app/shared/search/search-filters/search-filters.component.ts b/src/app/shared/search/search-filters/search-filters.component.ts index 4667694edd..1f08a5ac5d 100644 --- a/src/app/shared/search/search-filters/search-filters.component.ts +++ b/src/app/shared/search/search-filters/search-filters.component.ts @@ -84,7 +84,7 @@ export class SearchFiltersComponent implements OnInit, OnDestroy { @Inject(SEARCH_CONFIG_SERVICE) private searchConfigService: SearchConfigurationService, @Inject(APP_CONFIG) protected appConfig: AppConfig, ) { - this.defaultFilterCount = this.appConfig.search.defaultFiltersCount ?? 5; + this.defaultFilterCount = this.appConfig.search.filterPlaceholdersCount ?? 5; } ngOnInit(): void { diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.spec.ts b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.spec.ts index 0ec74eb946..68c8db5a8e 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.spec.ts +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.spec.ts @@ -4,6 +4,8 @@ import { } from '@angular/core/testing'; import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader'; +import { SearchService } from '../../../../core/shared/search/search.service'; +import { SearchServiceStub } from '../../../testing/search-service.stub'; import { SearchResultsSkeletonComponent } from './search-results-skeleton.component'; describe('SearchResultsSkeletonComponent', () => { @@ -13,6 +15,9 @@ describe('SearchResultsSkeletonComponent', () => { beforeEach(async () => { await TestBed.configureTestingModule({ imports: [SearchResultsSkeletonComponent, NgxSkeletonLoaderModule], + providers: [ + { provide: SearchService, useValue: new SearchServiceStub() }, + ], }) .compileComponents(); diff --git a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts index d2896460e1..28a603cfa3 100644 --- a/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts +++ b/src/app/shared/search/search-results/search-results-skeleton/search-results-skeleton.component.ts @@ -42,7 +42,7 @@ export class SearchResultsSkeletonComponent implements OnInit { protected readonly ViewMode = ViewMode; constructor(private searchService: SearchService) { - this.viewMode$ = searchService.getViewMode(); + this.viewMode$ = this.searchService.getViewMode(); } ngOnInit() { diff --git a/src/app/shared/testing/search-configuration-service.stub.ts b/src/app/shared/testing/search-configuration-service.stub.ts index 78b358f0d4..ef72e40041 100644 --- a/src/app/shared/testing/search-configuration-service.stub.ts +++ b/src/app/shared/testing/search-configuration-service.stub.ts @@ -13,6 +13,10 @@ export class SearchConfigurationServiceStub { return observableOf([]); } + getCurrentFilters() { + return observableOf([]); + } + getCurrentScope(a) { return observableOf('test-id'); } diff --git a/src/config/default-app-config.ts b/src/config/default-app-config.ts index 7ed4168217..2384942e3b 100644 --- a/src/config/default-app-config.ts +++ b/src/config/default-app-config.ts @@ -445,6 +445,6 @@ export class DefaultAppConfig implements AppConfig { }; search: SearchConfig = { - defaultFilterCount: 5 + filterPlaceholdersCount: 5 } } diff --git a/src/config/search-page-config.interface.ts b/src/config/search-page-config.interface.ts index 0f4a145868..410876cde2 100644 --- a/src/config/search-page-config.interface.ts +++ b/src/config/search-page-config.interface.ts @@ -5,8 +5,8 @@ export interface SearchConfig extends Config { * Number used to render n UI elements called loading skeletons that act as placeholders. * These elements indicate that some content will be loaded in their stead. * Since we don't know how many filters will be loaded before we receive a response from the server we use this parameter for the skeletons count. - * For instance f we set 5 then 5 loading skeletons will be visualized before the actual filters are retrieved. + * For instance if we set 5 then 5 loading skeletons will be visualized before the actual filters are retrieved. */ - defaultFilterCount?: number; + filterPlaceholdersCount?: number; }