mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-13 13:03:04 +00:00
Fixed check for Hierarchical Vocabulary
This commit is contained in:
@@ -56,6 +56,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
preloadLevel: number;
|
||||
|
||||
private vocabulary$: Observable<Vocabulary>;
|
||||
private isHierarchicalVocabulary$: Observable<boolean>;
|
||||
private subs: Subscription[] = [];
|
||||
|
||||
constructor(protected vocabularyService: VocabularyService,
|
||||
@@ -123,6 +124,10 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
distinctUntilChanged()
|
||||
);
|
||||
|
||||
this.isHierarchicalVocabulary$ = this.vocabulary$.pipe(
|
||||
map((result: Vocabulary) => result.hierarchical)
|
||||
);
|
||||
|
||||
this.subs.push(this.group.get(this.model.id).valueChanges.pipe(
|
||||
filter((value) => this.currentValue !== value))
|
||||
.subscribe((value) => {
|
||||
@@ -143,9 +148,7 @@ export class DsDynamicOneboxComponent extends DsDynamicVocabularyComponent imple
|
||||
* Checks if configured vocabulary is Hierarchical or not
|
||||
*/
|
||||
isHierarchicalVocabulary(): Observable<boolean> {
|
||||
return this.vocabulary$.pipe(
|
||||
map((result: Vocabulary) => result.hierarchical)
|
||||
);
|
||||
return this.isHierarchicalVocabulary$;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user