Skip to content

Commit 1b19d0f

Browse files
Andrea Barbassoatarix83
authored andcommitted
Merged in task/dspace-cris-2023_02_x/DSC-1747_AB (pull request DSpace#1797)
[DSC-1747] restore thumbnails in search pages Approved-by: Giuseppe Digilio
2 parents 5360535 + 6bd188c commit 1b19d0f

4 files changed

Lines changed: 17 additions & 5 deletions

File tree

src/app/search-page/configuration-search-page.component.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { RouteService } from '../core/services/route.service';
99
import { SearchService } from '../core/shared/search/search.service';
1010
import { Router } from '@angular/router';
1111
import { SearchManager } from '../core/browse/search-manager';
12+
import { APP_CONFIG, AppConfig } from '../../config/app-config.interface';
1213

1314
/**
1415
* This component renders a search page using a configuration as input.
@@ -35,7 +36,8 @@ export class ConfigurationSearchPageComponent extends SearchComponent {
3536
@Inject(PLATFORM_ID) public platformId: any,
3637
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
3738
protected routeService: RouteService,
38-
protected router: Router) {
39-
super(service, searchManager, sidebarService, windowService, searchConfigService, platformId, routeService, router);
39+
protected router: Router,
40+
@Inject(APP_CONFIG) protected appConfig: AppConfig,) {
41+
super(service, searchManager, sidebarService, windowService, searchConfigService, platformId, routeService, router, appConfig);
4042
}
4143
}

src/app/shared/search/search.component.spec.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ import { SearchFilterConfig } from './models/search-filter-config.model';
3434
import { FilterType } from './models/filter-type.model';
3535
import { getCommunityPageRoute } from '../../community-page/community-page-routing-paths';
3636
import { getCollectionPageRoute } from '../../collection-page/collection-page-routing-paths';
37+
import { APP_CONFIG } from '../../../config/app-config.interface';
38+
import { environment } from '../../../environments/environment';
3739

3840
let comp: SearchComponent;
3941
let fixture: ComponentFixture<SearchComponent>;
@@ -239,6 +241,10 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar
239241
{
240242
provide: SEARCH_CONFIG_SERVICE,
241243
useValue: searchConfigurationServiceStub
244+
},
245+
{
246+
provide: APP_CONFIG,
247+
useValue: environment
242248
}
243249
],
244250
schemas: [NO_ERRORS_SCHEMA]

src/app/shared/search/search.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routi
5151
import { SearchManager } from '../../core/browse/search-manager';
5252
import { AlertType } from '../alert/alert-type';
5353
import { isPlatformServer } from '@angular/common';
54+
import { APP_CONFIG } from '../../../config/app-config.interface';
5455

5556
@Component({
5657
selector: 'ds-search',
@@ -187,7 +188,7 @@ export class SearchComponent implements OnInit, OnDestroy {
187188
/**
188189
* Whether to show the thumbnail preview
189190
*/
190-
@Input() showThumbnails;
191+
@Input() showThumbnails: boolean;
191192

192193
/**
193194
* Whether to show the view mode switch
@@ -368,7 +369,8 @@ export class SearchComponent implements OnInit, OnDestroy {
368369
@Inject(PLATFORM_ID) public platformId: any,
369370
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
370371
protected routeService: RouteService,
371-
protected router: Router,) {
372+
protected router: Router,
373+
@Inject(APP_CONFIG) protected appConfig: any,){
372374
this.isXsOrSm$ = this.windowService.isXsOrSm();
373375
}
374376

@@ -385,6 +387,8 @@ export class SearchComponent implements OnInit, OnDestroy {
385387
return;
386388
}
387389

390+
this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;
391+
388392
if (this.useUniquePageId) {
389393
// Create an unique pagination id related to the instance of the SearchComponent
390394
this.paginationId = uniqueId(this.paginationId);

src/app/shared/search/themed-search.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {
6868

6969
@Input() showSidebar: boolean;
7070

71-
@Input() showThumbnails;
71+
@Input() showThumbnails: boolean;
7272

7373
@Input() showViewModes: boolean;
7474

0 commit comments

Comments
 (0)