Fixes bug on preview of dataset template on dmp editor, dataset editor

This commit is contained in:
apapachristou 2020-09-07 11:02:21 +03:00
parent 2eb608a897
commit b3bf7ab73d
2 changed files with 6 additions and 1 deletions

View File

@ -7,7 +7,7 @@
<div class="heading">1.0 {{'DATASET-EDITOR.FIELDS.PROFILE' | translate}}*</div>
<div class="profile-form">
<mat-form-field>
<mat-select placeholder="{{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}" [required]="true" formControlName="profile">
<mat-select placeholder="{{'DATASET-WIZARD.FIRST-STEP.PROFILE'| translate}}" [required]="true" [compareWith]="compareWith" [formControl]="formGroup.get('profile')">
<mat-option *ngFor="let profile of availableProfiles" [value]="profile">
{{profile.label}}
</mat-option>

View File

@ -323,6 +323,7 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn
request.criteria = criteria;
return this.dmpService.searchDMPProfiles(request);
}
allAvailableProfiles(event: MouseEvent) {
event.stopPropagation();
const dialogRef = this.dialog.open(AvailableProfilesComponent, {
@ -332,4 +333,8 @@ export class DatasetEditorDetailsComponent extends BaseComponent implements OnIn
});
return false;
}
public compareWith(object1: any, object2: any) {
return object1 && object2 && object1.id === object2.id;
}
}