Skip to content

Commit

Permalink
fix(resource): resource viewer is broken if fileRepresentation has re…
Browse files Browse the repository at this point in the history
…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 6a360ac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Expand Up @@ -5,6 +5,7 @@
background: white;
padding: 8px 16px;
@include mat-box-shadow();
border-radius: $border-radius;

table {
border-collapse: collapse;
Expand Down
6 changes: 3 additions & 3 deletions src/app/workspace/resource/resource.component.html
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down
3 changes: 1 addition & 2 deletions src/app/workspace/resource/resource.component.ts
Expand Up @@ -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);
}
},
Expand Down Expand Up @@ -340,7 +340,6 @@ export class ResourceComponent implements OnInit, OnChanges, OnDestroy {
];

this.representationsToDisplay = stillImageRepresentations;

// --> TODO: get regions here

break;
Expand Down

0 comments on commit 6a360ac

Please sign in to comment.