mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-14 05:23:06 +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(SEARCH_CONFIG_SERVICE) private searchConfigService: SearchConfigurationService,
|
||||||
@Inject(APP_CONFIG) protected appConfig: AppConfig,
|
@Inject(APP_CONFIG) protected appConfig: AppConfig,
|
||||||
) {
|
) {
|
||||||
this.defaultFilterCount = this.appConfig.search.defaultFiltersCount ?? 5;
|
this.defaultFilterCount = this.appConfig.search.filterPlaceholdersCount ?? 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
@@ -4,6 +4,8 @@ import {
|
|||||||
} from '@angular/core/testing';
|
} from '@angular/core/testing';
|
||||||
import { NgxSkeletonLoaderModule } from 'ngx-skeleton-loader';
|
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';
|
import { SearchResultsSkeletonComponent } from './search-results-skeleton.component';
|
||||||
|
|
||||||
describe('SearchResultsSkeletonComponent', () => {
|
describe('SearchResultsSkeletonComponent', () => {
|
||||||
@@ -13,6 +15,9 @@ describe('SearchResultsSkeletonComponent', () => {
|
|||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
imports: [SearchResultsSkeletonComponent, NgxSkeletonLoaderModule],
|
imports: [SearchResultsSkeletonComponent, NgxSkeletonLoaderModule],
|
||||||
|
providers: [
|
||||||
|
{ provide: SearchService, useValue: new SearchServiceStub() },
|
||||||
|
],
|
||||||
})
|
})
|
||||||
.compileComponents();
|
.compileComponents();
|
||||||
|
|
||||||
|
@@ -42,7 +42,7 @@ export class SearchResultsSkeletonComponent implements OnInit {
|
|||||||
protected readonly ViewMode = ViewMode;
|
protected readonly ViewMode = ViewMode;
|
||||||
|
|
||||||
constructor(private searchService: SearchService) {
|
constructor(private searchService: SearchService) {
|
||||||
this.viewMode$ = searchService.getViewMode();
|
this.viewMode$ = this.searchService.getViewMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
@@ -13,6 +13,10 @@ export class SearchConfigurationServiceStub {
|
|||||||
return observableOf([]);
|
return observableOf([]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getCurrentFilters() {
|
||||||
|
return observableOf([]);
|
||||||
|
}
|
||||||
|
|
||||||
getCurrentScope(a) {
|
getCurrentScope(a) {
|
||||||
return observableOf('test-id');
|
return observableOf('test-id');
|
||||||
}
|
}
|
||||||
|
@@ -445,6 +445,6 @@ export class DefaultAppConfig implements AppConfig {
|
|||||||
};
|
};
|
||||||
|
|
||||||
search: SearchConfig = {
|
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.
|
* 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.
|
* 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.
|
* 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