@@ -19,6 +19,7 @@ import { hasValue, isEmpty } from '../../../../../../../app/shared/empty.util';
1919import { PaginationComponentOptions } from '../../../../../../../app/shared/pagination/pagination-component-options.model' ;
2020import { followLink } from '../../../../../../../app/shared/utils/follow-link-config.model' ;
2121import { BitstreamDataService } from '../../../../../../../app/core/data/bitstream-data.service' ;
22+ import { AccessStatusDataService } from '../../../../../../../app/core/data/access-status-data.service' ;
2223import { NotificationsService } from '../../../../../../../app/shared/notifications/notifications.service' ;
2324import { DSONameService } from '../../../../../../../app/core/breadcrumbs/dso-name.service' ;
2425import { APP_CONFIG , AppConfig } from '../../../../../../../config/app-config.interface' ;
@@ -54,6 +55,7 @@ export class FileSectionComponent extends BaseComponent {
5455 licenses$ : Observable < RemoteData < PaginatedList < Bitstream > > > ;
5556 downloadLink$ : Observable < string > ;
5657 downloadLinkAvailable$ : Observable < boolean > ;
58+ hasEmbargo$ : Observable < boolean > ;
5759
5860 cclicenseOptions = Object . assign ( new PaginationComponentOptions ( ) , {
5961 id : 'cclbo' ,
@@ -76,6 +78,7 @@ export class FileSectionComponent extends BaseComponent {
7678 public dsoNameService : DSONameService ,
7779 @Inject ( APP_CONFIG ) protected appConfig : AppConfig ,
7880 protected downloadLinkService : DownloadLinkService ,
81+ protected accessStatusDataService : AccessStatusDataService ,
7982 ) {
8083 super ( bitstreamDataService , notificationsService , translateService , dsoNameService , appConfig ) ;
8184
@@ -124,6 +127,11 @@ export class FileSectionComponent extends BaseComponent {
124127 map ( link => link )
125128 ) ;
126129
130+ this . hasEmbargo$ = this . accessStatusDataService . findAccessStatusFor ( this . item ) . pipe (
131+ getFirstCompletedRemoteData ( ) ,
132+ map ( rd => rd ?. hasSucceeded && rd . payload ?. status === 'embargo' ) ,
133+ ) ;
134+
127135 }
128136
129137 hasValuesInBundle ( bundle : PaginatedList < Bitstream > ) {
0 commit comments