@@ -31,13 +31,13 @@ import { ViewMode } from '../../core/shared/view-mode.model';
3131import { SelectionConfig } from './search-results/search-results.component' ;
3232import { ListableObject } from '../object-collection/shared/listable-object.model' ;
3333import { CollectionElementLinkType } from '../object-collection/collection-element-link.type' ;
34- import { environment } from 'src/environments/environment' ;
3534import { SubmissionObject } from '../../core/submission/models/submission-object.model' ;
3635import { SearchFilterConfig } from './models/search-filter-config.model' ;
3736import { WorkspaceItem } from '../../core/submission/models/workspaceitem.model' ;
3837import { ITEM_MODULE_PATH } from '../../item-page/item-page-routing-paths' ;
3938import { COLLECTION_MODULE_PATH } from '../../collection-page/collection-page-routing-paths' ;
4039import { COMMUNITY_MODULE_PATH } from '../../community-page/community-page-routing-paths' ;
40+ import { AppConfig , APP_CONFIG } from '../../../config/app-config.interface' ;
4141
4242@Component ( {
4343 selector : 'ds-search' ,
@@ -283,7 +283,9 @@ export class SearchComponent implements OnDestroy, OnInit {
283283 protected windowService : HostWindowService ,
284284 @Inject ( SEARCH_CONFIG_SERVICE ) public searchConfigService : SearchConfigurationService ,
285285 protected routeService : RouteService ,
286- protected router : Router ) {
286+ protected router : Router ,
287+ @Inject ( APP_CONFIG ) protected appConfig : AppConfig ,
288+ ) {
287289 this . isXsOrSm$ = this . windowService . isXsOrSm ( ) ;
288290 }
289291
@@ -450,8 +452,10 @@ export class SearchComponent implements OnDestroy, OnInit {
450452 let followLinks = [
451453 followLink < Item > ( 'thumbnail' , { isOptional : true } ) ,
452454 followLink < SubmissionObject > ( 'item' , { isOptional : true } , followLink < Item > ( 'thumbnail' , { isOptional : true } ) ) as any ,
453- followLink < Item > ( 'accessStatus' , { isOptional : true , shouldEmbed : environment . item . showAccessStatuses } ) ,
454455 ] ;
456+ if ( this . appConfig . item . showAccessStatuses ) {
457+ followLinks . push ( followLink < Item > ( 'accessStatus' , { isOptional : true } ) ) ;
458+ }
455459 if ( this . configuration === 'supervision' ) {
456460 followLinks . push ( followLink < WorkspaceItem > ( 'supervisionOrders' , { isOptional : true } ) as any ) ;
457461 }
0 commit comments