Skip to content

Commit 16370c8

Browse files
committed
Fixed documentation to valid JSDoc tag, prevention for not initializing this.isAdmin$
1 parent a0d031b commit 16370c8

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

src/app/item-page/simple/field-components/clarin-item-versions-field/clarin-item-versions-field.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Component, Input, OnInit } from '@angular/core';
2-
import { Observable } from 'rxjs';
2+
import { Observable, of } from 'rxjs';
33
import { map } from 'rxjs/operators';
44
import { ItemVersionsComponent } from '../../../versions/item-versions.component';
55
import { Item } from '../../../../core/shared/item.model';
@@ -55,8 +55,8 @@ export class ClarinItemVersionsFieldComponent extends ItemVersionsComponent impl
5555
map((versionsDTO: VersionsDTO) => versionsDTO && versionsDTO.totalElements > 1)
5656
);
5757
} else {
58-
// Fallback: always show if user is admin
59-
this.showMetadataValue = this.isAdmin$;
58+
// Fallback: check if isAdmin$ is available, otherwise hide the component
59+
this.showMetadataValue = this.isAdmin$ || of(false);
6060
}
6161
}
6262

src/app/item-page/versions/item-versions.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class ItemVersionsComponent implements OnDestroy, OnInit {
202202
* Loading of the name from the items handles for the items which are stored in the metadata dc.relation.replaces` and
203203
* `dc.relation.isreplacedby`
204204
* Names are stored in this dict to avoid endless calling rest API to get the name of the Item.
205-
* @protected Accessible to extending components that may need to cache item names from handles
205+
* @access protected - Accessible to extending components that may need to cache item names from handles
206206
*/
207207
protected nameCache: { [handle: string]: string } = {};
208208

0 commit comments

Comments
 (0)