mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
[DURACOM-303] rename variable, minor code refactor
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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();
|
||||
|
||||
|
@@ -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() {
|
||||
|
@@ -13,6 +13,10 @@ export class SearchConfigurationServiceStub {
|
||||
return observableOf([]);
|
||||
}
|
||||
|
||||
getCurrentFilters() {
|
||||
return observableOf([]);
|
||||
}
|
||||
|
||||
getCurrentScope(a) {
|
||||
return observableOf('test-id');
|
||||
}
|
||||
|
@@ -445,6 +445,6 @@ export class DefaultAppConfig implements AppConfig {
|
||||
};
|
||||
|
||||
search: SearchConfig = {
|
||||
defaultFilterCount: 5
|
||||
filterPlaceholdersCount: 5
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user