Fix DMP's funder tab

This commit is contained in:
George Kalampokis 2023-10-18 18:14:02 +03:00
parent 093837c395
commit 5885e3ae5c
1 changed files with 12 additions and 4 deletions

View File

@ -435,9 +435,17 @@ export class FundingInfoComponent extends BaseComponent implements OnInit {
} }
} }
private hasNewFunder(funder: any) {
return funder.label !== null && funder.label !== undefined && funder.label !== '' && funder.reference !== undefined && funder.reference !== undefined && funder.reference !== '';
}
private hasExistingFunder(funder: any) {
return funder.existFunder !== null && funder.existFunder !== undefined && funder.existFunder.reference !== null && funder.existFunder.reference !== undefined;
}
funderValueChanged(funder: any) { funderValueChanged(funder: any) {
if ((funder.label !== "" && funder.label !== null && funder.label !== undefined && !isNullOrUndefined(funder.reference) && funder.reference.length )
|| (funder.existFunder !== null && funder.existFunder !== undefined && funder.existFunder.id !== undefined)) { if (this.hasNewFunder(funder) || this.hasExistingFunder(funder)) {
//this.grantformGroup.reset(); //this.grantformGroup.reset();
this.grantformGroup.enable(); this.grantformGroup.enable();
this.setGrantValidators(); this.setGrantValidators();