Skip to content
Permalink
Browse files
fix(resource): resource viewer is broken if fileRepresentation has re…
…stricted view (DEV-455) (#666)

* style(permission-info): missing style in prev PR

* fix(resource): disable osd if image has restricted view (DEV-455)
  • Loading branch information
kilchenmann committed Feb 18, 2022
1 parent 8be1efe commit 6a360acd50cdceff5a75dceea116839a3648b1f0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
@@ -5,6 +5,7 @@
background: white;
padding: 8px 16px;
@include mat-box-shadow();
border-radius: $border-radius;

table {
border-collapse: collapse;
@@ -2,8 +2,8 @@
<div class="resource-view" *ngIf="resource && !loading">

<!-- dsp-resource-representation -->
<div class="representation-container center" *ngIf="representationsToDisplay.length"
[ngSwitch]="representationsToDisplay[0].fileValue.type">
<div class="representation-container center" *ngIf="representationsToDisplay.length && representationsToDisplay[0].fileValue"
[ngSwitch]="representationsToDisplay[0].fileValue?.type">
<!-- still image view -->
<app-still-image #stillImage class="dsp-representation" *ngSwitchCase="representationConstants.stillImage"
[images]="representationsToDisplay"
@@ -52,7 +52,7 @@

<!-- annotations -->
<mat-tab label="annotations"
*ngIf="representationsToDisplay.length && representationsToDisplay[0].fileValue.type === representationConstants.stillImage">
*ngIf="representationsToDisplay.length && representationsToDisplay[0].fileValue && representationsToDisplay[0].fileValue.type === representationConstants.stillImage">
<ng-template matTabLabel class="annotations">
<span [matBadge]="representationsToDisplay[0]?.annotations.length"
[matBadgeHidden]="representationsToDisplay[0]?.annotations.length === 0" matBadgeColor="primary"
@@ -299,7 +299,7 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy {

this.collectRepresentationsAndAnnotations(this.incomingResource);

if (this.representationsToDisplay.length && this.compoundPosition) {
if (this.representationsToDisplay.length && this.representationsToDisplay[0].fileValue && this.compoundPosition) {
this.getIncomingRegions(this.incomingResource, 0);
}
},
@@ -340,7 +340,6 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy {
];

this.representationsToDisplay = stillImageRepresentations;

// --> TODO: get regions here

break;

0 comments on commit 6a360ac

Please sign in to comment.