Fixes DMP editor's Funder updating mechanics.
This commit is contained in:
parent
3d3963f5c1
commit
71aea010a9
|
@ -293,10 +293,14 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.funder != null && this.funder.getExistFunder() != null) {
|
if(this.funder == null && this.funder.getExistFunder() == null && this.funder.getLabel() == null) {
|
||||||
if (this.funder.getExistFunder() != null && this.funder.getLabel() == null)
|
dataManagementPlanEntity.getGrant().setFunder(null);
|
||||||
dataManagementPlanEntity.getGrant().setFunder(this.funder.getExistFunder().toDataModel());
|
}
|
||||||
|
else if (this.funder != null && this.funder.getExistFunder() == null && this.funder.getLabel() == null) {
|
||||||
|
dataManagementPlanEntity.getGrant().setFunder(null);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
if (this.funder.getLabel() != null) {
|
||||||
Funder funder = new Funder();
|
Funder funder = new Funder();
|
||||||
funder.setLabel(this.funder.getLabel());
|
funder.setLabel(this.funder.getLabel());
|
||||||
funder.setType(Funder.FunderType.INTERNAL.getValue());
|
funder.setType(Funder.FunderType.INTERNAL.getValue());
|
||||||
|
@ -308,9 +312,9 @@ public class DataManagementPlanEditorModel implements DataModel<DMP, DataManagem
|
||||||
|
|
||||||
dataManagementPlanEntity.getGrant().setFunder(funder);
|
dataManagementPlanEntity.getGrant().setFunder(funder);
|
||||||
}
|
}
|
||||||
|
else if (this.funder.getExistFunder() != null && this.funder.getLabel() == null){
|
||||||
|
dataManagementPlanEntity.getGrant().setFunder(this.funder.getExistFunder().toDataModel());
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
dataManagementPlanEntity.getGrant().setFunder(null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.project != null) {
|
if (this.project != null) {
|
||||||
|
|
Loading…
Reference in New Issue