Commit e1af4eac authored by Georgios Kolokythas's avatar Georgios Kolokythas

Fixes bug on not reseting "Grant" when changing "Funder" on "New DMP (Wizard)" view.

parent 0e8b905f
......@@ -79,25 +79,28 @@ export class GrantEditorWizardComponent extends BaseComponent implements OnInit,
this.grantformGroup.get('existGrant').disable();
}
this.funderFormGroup.statusChanges.pipe(takeUntil(this._destroyed)).subscribe(x => {
if (x == 'INVALID') {
this.grantformGroup.get('existGrant').reset();
this.grantformGroup.get('label').reset();
this.grantformGroup.get('description').reset();
this.grantformGroup.get('existGrant').disable();
this.grantformGroup.get('label').disable();
this.grantformGroup.get('description').disable();
} else if (x == 'VALID') {
if (!this.isNew) {
this.funderFormGroup.statusChanges
.pipe(takeUntil(this._destroyed))
.subscribe(x => {
this.grantformGroup.reset();
if (x == 'INVALID') {
this.grantformGroup.get('existGrant').reset();
this.grantformGroup.get('label').reset();
this.grantformGroup.get('description').reset();
this.grantformGroup.get('existGrant').disable();
this.grantformGroup.get('label').disable();
this.grantformGroup.get('description').disable();
this.grantformGroup.get('existGrant').enable();
} else if (x == 'VALID') {
if (!this.isNew) {
this.grantformGroup.get('label').reset();
this.grantformGroup.get('description').reset();
this.grantformGroup.get('label').disable();
this.grantformGroup.get('description').disable();
this.grantformGroup.get('existGrant').enable();
}
}
}
})
})
}
isFunderFormInvalid() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment