dmp profile bug fixes: 1) dmp profile was not saved 2) if you select external autocomplete field and change it to another type, the external field was saved
This commit is contained in:
parent
34e4761811
commit
3630727fed
|
@ -477,6 +477,10 @@ public class DataManagementPlanManager {
|
|||
}
|
||||
|
||||
DMP newDmp = dataManagementPlan.toDataModel();
|
||||
if(dataManagementPlan.getProfile() != null){
|
||||
DMPProfile dmpProfile = apiContext.getOperationsContext().getDatabaseRepository().getDmpProfileDao().find(dataManagementPlan.getProfile().getId());
|
||||
newDmp.setProfile(dmpProfile);
|
||||
}
|
||||
if (newDmp.getStatus() == (int) DMP.DMPStatus.FINALISED.getValue()) {
|
||||
checkDmpValidationRules(newDmp);
|
||||
}
|
||||
|
|
|
@ -245,6 +245,7 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
|||
this.addControl(formGroup);
|
||||
return true;
|
||||
} else {
|
||||
this.removeControl(formGroup);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -253,4 +254,9 @@ export class DmpProfileEditorComponent extends BaseComponent implements AfterVie
|
|||
if (formGroup.get('dataType').value == 3)
|
||||
formGroup.addControl('externalAutocomplete', new DmpProfileExternalAutoCompleteFieldDataEditorModel().buildForm());
|
||||
}
|
||||
|
||||
removeControl(formGroup: FormGroup) {
|
||||
if (formGroup.get('dataType').value != 3)
|
||||
formGroup.removeControl('externalAutocomplete');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue