Skip to content

Commit

Permalink
Merged in task/dspace-cris-2023_02_x/DSC-1747_AB (pull request DSpace…
Browse files Browse the repository at this point in the history
…#1797)

[DSC-1747] restore thumbnails in search pages

Approved-by: Giuseppe Digilio
  • Loading branch information
Andrea Barbasso authored and atarix83 committed Jun 11, 2024
2 parents 5360535 + 6bd188c commit 1b19d0f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/app/search-page/configuration-search-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { RouteService } from '../core/services/route.service';
import { SearchService } from '../core/shared/search/search.service';
import { Router } from '@angular/router';
import { SearchManager } from '../core/browse/search-manager';
import { APP_CONFIG, AppConfig } from '../../config/app-config.interface';

/**
* This component renders a search page using a configuration as input.
Expand All @@ -35,7 +36,8 @@ export class ConfigurationSearchPageComponent extends SearchComponent {
@Inject(PLATFORM_ID) public platformId: any,
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
protected routeService: RouteService,
protected router: Router) {
super(service, searchManager, sidebarService, windowService, searchConfigService, platformId, routeService, router);
protected router: Router,
@Inject(APP_CONFIG) protected appConfig: AppConfig,) {
super(service, searchManager, sidebarService, windowService, searchConfigService, platformId, routeService, router, appConfig);
}
}
6 changes: 6 additions & 0 deletions src/app/shared/search/search.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ import { SearchFilterConfig } from './models/search-filter-config.model';
import { FilterType } from './models/filter-type.model';
import { getCommunityPageRoute } from '../../community-page/community-page-routing-paths';
import { getCollectionPageRoute } from '../../collection-page/collection-page-routing-paths';
import { APP_CONFIG } from '../../../config/app-config.interface';
import { environment } from '../../../environments/environment';

let comp: SearchComponent;
let fixture: ComponentFixture<SearchComponent>;
Expand Down Expand Up @@ -239,6 +241,10 @@ export function configureSearchComponentTestingModule(compType, additionalDeclar
{
provide: SEARCH_CONFIG_SERVICE,
useValue: searchConfigurationServiceStub
},
{
provide: APP_CONFIG,
useValue: environment
}
],
schemas: [NO_ERRORS_SCHEMA]
Expand Down
8 changes: 6 additions & 2 deletions src/app/shared/search/search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routi
import { SearchManager } from '../../core/browse/search-manager';
import { AlertType } from '../alert/alert-type';
import { isPlatformServer } from '@angular/common';
import { APP_CONFIG } from '../../../config/app-config.interface';

@Component({
selector: 'ds-search',
Expand Down Expand Up @@ -187,7 +188,7 @@ export class SearchComponent implements OnInit, OnDestroy {
/**
* Whether to show the thumbnail preview
*/
@Input() showThumbnails;
@Input() showThumbnails: boolean;

/**
* Whether to show the view mode switch
Expand Down Expand Up @@ -368,7 +369,8 @@ export class SearchComponent implements OnInit, OnDestroy {
@Inject(PLATFORM_ID) public platformId: any,
@Inject(SEARCH_CONFIG_SERVICE) public searchConfigService: SearchConfigurationService,
protected routeService: RouteService,
protected router: Router,) {
protected router: Router,
@Inject(APP_CONFIG) protected appConfig: any,){
this.isXsOrSm$ = this.windowService.isXsOrSm();
}

Expand All @@ -385,6 +387,8 @@ export class SearchComponent implements OnInit, OnDestroy {
return;
}

this.showThumbnails = this.showThumbnails ?? this.appConfig.browseBy.showThumbnails;

if (this.useUniquePageId) {
// Create an unique pagination id related to the instance of the SearchComponent
this.paginationId = uniqueId(this.paginationId);
Expand Down
2 changes: 1 addition & 1 deletion src/app/shared/search/themed-search.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ export class ThemedSearchComponent extends ThemedComponent<SearchComponent> {

@Input() showSidebar: boolean;

@Input() showThumbnails;
@Input() showThumbnails: boolean;

@Input() showViewModes: boolean;

Expand Down

0 comments on commit 1b19d0f

Please sign in to comment.