From ab8ba1170356fed090647a78d583e05750ef392e Mon Sep 17 00:00:00 2001 From: gkolokythas Date: Wed, 8 Jan 2020 13:06:15 +0200 Subject: [PATCH] Fixes "New Version" DMP editor so user cannot edit "Funder", "Grant" or "Project". --- .../app/ui/dmp/editor/grant-tab/grant-tab.component.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts index bf703b3d0..9a9e08f34 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/grant-tab/grant-tab.component.ts @@ -27,7 +27,7 @@ export class GrantTabComponent extends BaseComponent implements OnInit { @Input() isNewVersion: boolean; @Input() isNew: boolean; @Input() isUserOwner: boolean; - @Input() isClone: boolean; + @Input() isClone: boolean = false; isCreateNew = false; isCreateNewProject = false; @@ -145,7 +145,7 @@ export class GrantTabComponent extends BaseComponent implements OnInit { this.grantformGroup.get('existGrant').disable(); this.grantformGroup.get('label').enable(); this.grantformGroup.get('description').enable(); - } else if (this.isClone) { + } else if (this.isClone && !this.isNewVersion) { this.grantformGroup.get('existGrant').enable(); this.grantformGroup.get('label').disable(); this.grantformGroup.get('label').reset(); @@ -169,7 +169,7 @@ export class GrantTabComponent extends BaseComponent implements OnInit { this.projectFormGroup.get('existProject').disable(); this.projectFormGroup.get('label').enable(); this.projectFormGroup.get('description').enable(); - } else if (this.isClone) { + } else if (this.isClone && !this.isNewVersion) { this.projectFormGroup.get('existProject').enable(); this.projectFormGroup.get('label').disable() this.projectFormGroup.get('label').reset(); @@ -192,7 +192,7 @@ export class GrantTabComponent extends BaseComponent implements OnInit { if (this.isCreateNewFunder) { this.funderFormGroup.get('existFunder').disable(); this.funderFormGroup.get('label').enable(); - } else if (this.isClone) { + } else if (this.isClone && !this.isNewVersion) { if (this.funderFormGroup.get('existFunder')) { this.funderFormGroup.get('existFunder').enable(); this.funderFormGroup.get('label').disable();