From 218595c35827ff4d5aa80e56dfec1d77bd03dc0d Mon Sep 17 00:00:00 2001 From: apapachristou Date: Thu, 22 Aug 2019 13:32:43 +0300 Subject: [PATCH] Fixes bug on dmp-editor action "save changes" --- .../src/app/ui/dmp/editor/dmp-editor.component.html | 8 ++++---- .../src/app/ui/dmp/editor/dmp-editor.component.ts | 5 ++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html index e4344cbc4..35cc45433 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.html @@ -76,7 +76,7 @@ settings {{ 'DMP-LISTING.ACTIONS.SETTINGS' | translate }} - --> + -->
@@ -91,15 +91,15 @@
- -
-
diff --git a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts index df8154172..133fe8903 100644 --- a/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts @@ -1,5 +1,5 @@ import { Component, OnInit, ViewContainerRef } from '@angular/core'; -import { FormGroup, FormControl, FormArray } from '@angular/forms'; +import { FormGroup, FormControl, FormArray, AbstractControl } from '@angular/forms'; import { MatDialog, MatSnackBar } from '@angular/material'; import { ActivatedRoute, Params, Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; @@ -170,7 +170,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC // } }); } else { - console.log('4'); this.dmp = new DmpEditorModel(); this.dmp.grant = new GrantTabModel(); this.dmp.project = new ProjectFormModel(); @@ -239,7 +238,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC } public isFormValid() { - return this.formGroup.valid; + return this.formGroup.get('label').valid && this.formGroup.get('profiles').valid && this.formGroup.get('grant').valid; } onSubmit(showAddDatasetDialog?: boolean): void {