mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
[CST-5676] Bitstream edit page is broken if no policies are set
This commit is contained in:
@@ -387,16 +387,6 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
|||||||
*/
|
*/
|
||||||
protected subs: Subscription[] = [];
|
protected subs: Subscription[] = [];
|
||||||
|
|
||||||
/**
|
|
||||||
* Set to blank to detect changes in format.
|
|
||||||
*/
|
|
||||||
bitstreamFormat = {};
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set to true to detect changes in bundle.
|
|
||||||
*/
|
|
||||||
bitstreamBundle = {};
|
|
||||||
|
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute,
|
constructor(private route: ActivatedRoute,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@@ -695,31 +685,15 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
|||||||
const regexExcludeBundles = /OTHERCONTENT|THUMBNAIL|LICENSE/;
|
const regexExcludeBundles = /OTHERCONTENT|THUMBNAIL|LICENSE/;
|
||||||
const regexIIIFItem = /true|yes/i;
|
const regexIIIFItem = /true|yes/i;
|
||||||
|
|
||||||
this.bitstream.format.subscribe(res => {
|
|
||||||
this.bitstreamFormat = res;
|
|
||||||
});
|
|
||||||
this.bitstream.bundle.subscribe(res => {
|
|
||||||
this.bitstreamBundle = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
const isImage$ = this.bitstream.format.pipe(
|
const isImage$ = this.bitstream.format.pipe(
|
||||||
getFirstSucceededRemoteData(),
|
getFirstSucceededRemoteData(),
|
||||||
map((format: RemoteData<BitstreamFormat>) => format.payload.mimetype.includes('image/')));
|
map((format: RemoteData<BitstreamFormat>) => format.payload.mimetype.includes('image/')));
|
||||||
|
|
||||||
let isImageBitstream = false;
|
|
||||||
isImage$.subscribe(res => {
|
|
||||||
isImageBitstream = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
const isIIIFBundle$ = this.bitstream.bundle.pipe(
|
const isIIIFBundle$ = this.bitstream.bundle.pipe(
|
||||||
getFirstSucceededRemoteData(),
|
getFirstSucceededRemoteData(),
|
||||||
map((bundle: RemoteData<Bundle>) =>
|
map((bundle: RemoteData<Bundle>) =>
|
||||||
this.dsoNameService.getName(bundle.payload).match(regexExcludeBundles) == null));
|
this.dsoNameService.getName(bundle.payload).match(regexExcludeBundles) == null));
|
||||||
|
|
||||||
let isIIIFBundleBitstream = false;
|
|
||||||
isIIIFBundle$.subscribe(res => {
|
|
||||||
isIIIFBundleBitstream = res;
|
|
||||||
});
|
|
||||||
const isEnabled$ = this.bitstream.bundle.pipe(
|
const isEnabled$ = this.bitstream.bundle.pipe(
|
||||||
getFirstSucceededRemoteData(),
|
getFirstSucceededRemoteData(),
|
||||||
map((bundle: RemoteData<Bundle>) => bundle.payload.item.pipe(
|
map((bundle: RemoteData<Bundle>) => bundle.payload.item.pipe(
|
||||||
@@ -729,11 +703,6 @@ export class EditBitstreamPageComponent implements OnInit, OnDestroy {
|
|||||||
item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null)
|
item.payload.firstMetadataValue('dspace.iiif.enabled').match(regexIIIFItem) !== null)
|
||||||
))));
|
))));
|
||||||
|
|
||||||
let isEnabledBitstream: Observable<boolean>;
|
|
||||||
isEnabled$.subscribe(res => {
|
|
||||||
isEnabledBitstream = res;
|
|
||||||
});
|
|
||||||
|
|
||||||
const iiifSub = combineLatest(
|
const iiifSub = combineLatest(
|
||||||
isImage$,
|
isImage$,
|
||||||
isIIIFBundle$,
|
isIIIFBundle$,
|
||||||
|
Reference in New Issue
Block a user