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