File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ export class PdfViewerEnableComponent implements OnInit {
4747 this . isEnabled$ . pipe (
4848 take ( 1 ) ,
4949 ) . subscribe ( ( isEnabled ) => this . update ( isEnabled ) ) ;
50- this . isViewerConfigAllowed$ = this . pdfViewerService . viewerAllowedForBitstreamFormat $( this . dso ) ;
50+ this . isViewerConfigAllowed$ = this . pdfViewerService . viewerEnabledAndAllowedForBitstreamFormat $( this . dso ) ;
5151 }
5252
5353 update ( $event : boolean ) {
Original file line number Diff line number Diff line change @@ -77,6 +77,20 @@ export class PdfViewerService {
7777 }
7878 }
7979
80+ /**
81+ * Is the PDF viewer enabled and allowed for a given dspace object
82+ * @param dso The dspace object to check
83+ */
84+ viewerEnabledAndAllowedForBitstreamFormat$ ( dso : DSpaceObject ) : Observable < boolean > {
85+ if ( dso instanceof Bitstream ) {
86+ return this . viewerAllowedForBitstreamFormat$ ( dso ) . pipe (
87+ map ( allowedForBsFormat => allowedForBsFormat && this . appConfig . pdfViewer . enabled ) ,
88+ ) ;
89+ } else {
90+ return of ( this . appConfig . pdfViewer . enabled ) ;
91+ }
92+ }
93+
8094 /**
8195 * Is the viewer enabled for this dspace object
8296 * @param dsoToCheck The dspace object to check
Original file line number Diff line number Diff line change @@ -652,6 +652,6 @@ export class DefaultAppConfig implements AppConfig {
652652
653653 // PDF viewer configuration, used by the PdfViewerService
654654 pdfViewer : PdfViewerConfig = {
655- enabled : true ,
655+ enabled : false ,
656656 } ;
657657}
You can’t perform that action at this time.
0 commit comments