mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00
111768: add back necessary setCurrentValue calls that were removed earlier
This commit is contained in:

committed by
Tim Donohue

parent
3ce4603328
commit
85694ec285
@@ -11,7 +11,7 @@ import {
|
|||||||
import { UntypedFormGroup } from '@angular/forms';
|
import { UntypedFormGroup } from '@angular/forms';
|
||||||
|
|
||||||
import { Observable, of as observableOf } from 'rxjs';
|
import { Observable, of as observableOf } from 'rxjs';
|
||||||
import { catchError, map, tap } from 'rxjs/operators';
|
import { catchError, distinctUntilChanged, map, tap } from 'rxjs/operators';
|
||||||
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
import { DynamicFormLayoutService, DynamicFormValidationService } from '@ng-dynamic-forms/core';
|
||||||
|
|
||||||
@@ -79,6 +79,10 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
|
|||||||
tap(() => this.loading = false)
|
tap(() => this.loading = false)
|
||||||
).subscribe((list: PaginatedList<VocabularyEntry>) => {
|
).subscribe((list: PaginatedList<VocabularyEntry>) => {
|
||||||
this.optionsList = list.page;
|
this.optionsList = list.page;
|
||||||
|
if (this.model.value) {
|
||||||
|
this.setCurrentValue(this.model.value, true);
|
||||||
|
}
|
||||||
|
|
||||||
this.updatePageInfo(
|
this.updatePageInfo(
|
||||||
list.pageInfo.elementsPerPage,
|
list.pageInfo.elementsPerPage,
|
||||||
list.pageInfo.currentPage,
|
list.pageInfo.currentPage,
|
||||||
@@ -88,6 +92,11 @@ export class DsDynamicScrollableDropdownComponent extends DsDynamicVocabularyCom
|
|||||||
this.selectedIndex = 0;
|
this.selectedIndex = 0;
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.group.get(this.model.id).valueChanges.pipe(distinctUntilChanged())
|
||||||
|
.subscribe((value) => {
|
||||||
|
this.setCurrentValue(value);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user