Fixes: bug on multiple get calls

This commit is contained in:
apapachristou 2019-06-03 16:13:17 +03:00
parent 2f139471dc
commit 11a00ec26a
2 changed files with 6 additions and 9 deletions

View File

@ -55,7 +55,7 @@
<mat-form-field class="col-md-6">
<mat-select placeholder=" {{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}"
[required]="true" formControlName="profile">
<mat-option *ngFor="let profile of availableProfiles" [value]="profile.id" (onSelectionChange)="selctionChanged()">
<mat-option *ngFor="let profile of availableProfiles" [value]="profile.id">
{{profile.label}}
</mat-option>
</mat-select>

View File

@ -163,6 +163,11 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
.subscribe( () => {
this.dmpValueChanged(this.formGroup.get('dmp').value);
});
this.formGroup.get('profile').valueChanges
.pipe(takeUntil(this._destroyed))
.subscribe(x => {
this.datasetProfileValueChanged(x);
});
});
} else if (dmpId != null) {
this.isNew = true;
@ -364,14 +369,6 @@ export class DatasetWizardComponent extends BaseComponent implements OnInit, IBr
}
}
selctionChanged() {
this.formGroup.get('profile').valueChanges
.pipe(takeUntil(this._destroyed))
.subscribe(x => {
this.datasetProfileValueChanged(x);
});
}
searchDmp(query: string): Observable<DmpListingModel[]> {
const fields: Array<string> = new Array<string>();
fields.push('asc');