From 1715e8629f66b71d528144f196c09fa7a85c691c Mon Sep 17 00:00:00 2001 From: annampak Date: Wed, 28 Feb 2018 16:59:41 +0200 Subject: [PATCH] name & version field diasabled in new version dmp --- .../src/app/dmps/editor/dmp-editor.component.html | 8 ++++---- dmp-frontend/src/app/dmps/wizard/dmp-wizard.component.ts | 4 +++- .../dmps/wizard/editor/dmp-wizard-editor.component.html | 6 +++++- .../app/dmps/wizard/editor/dmp-wizard-editor.component.ts | 7 +++++++ .../wizard/listing/dataset-wizard-listing.component.ts | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) diff --git a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html index 6aec95f72..a9dee3ca7 100644 --- a/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html +++ b/dmp-frontend/src/app/dmps/editor/dmp-editor.component.html @@ -44,7 +44,7 @@ - + @@ -80,9 +80,9 @@ - - - + + + diff --git a/dmp-frontend/src/app/dmps/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/dmps/wizard/dmp-wizard.component.ts index c9266b487..7436d30ea 100644 --- a/dmp-frontend/src/app/dmps/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/dmps/wizard/dmp-wizard.component.ts @@ -34,8 +34,10 @@ export class DataManagementPlanWizardComponent implements OnInit { this.dataManagementPlanService.getSingle(this.itemId).map(data => data as DataManagementPlanModel) .subscribe(data => { this.dataManagementPlan = JsonSerializer.fromJSONObject(data, DataManagementPlanModel); - this.formGroup = this.dataManagementPlan.buildForm(); this.isClone = this.route.snapshot.data.clone; + if(this.isClone == false) this.dataManagementPlan.version = this.dataManagementPlan.version + 1; + this.formGroup = this.dataManagementPlan.buildForm(); + }); }) } diff --git a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html index 1b55b943f..8dcaa29f8 100644 --- a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html +++ b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.html @@ -3,7 +3,7 @@ - + {{baseErrorModel.label}} {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -66,6 +66,10 @@ + + + +

Associated Users

diff --git a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts index 6896ddf03..708a05cdf 100644 --- a/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts +++ b/dmp-frontend/src/app/dmps/wizard/editor/dmp-wizard-editor.component.ts @@ -47,6 +47,7 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { organisationsAutoCompleteConfiguration: AutoCompleteChipConfiguration; createNewVersion; associatedUsers: Array + labelDisabled: boolean =false; constructor( private dataManagementPlanService: DataManagementPlanService, @@ -71,6 +72,12 @@ export class DataManagementPlanWizardEditorComponent implements AfterViewInit { organisationRequestItem.criteria = new BaseCriteria(); this.organisationsAutoCompleteConfiguration = new AutoCompleteChipConfiguration(this.externalSourcesService.searchDMPOrganizations.bind(this.externalSourcesService), organisationRequestItem); + this.route.data.subscribe(value=>{ + if (value.clone==false && this.formGroup.get("label").value){ + this.labelDisabled = true; + } + this.formGroup.controls["version"].disable(); + }) } formSubmit(): void { diff --git a/dmp-frontend/src/app/dmps/wizard/listing/dataset-wizard-listing.component.ts b/dmp-frontend/src/app/dmps/wizard/listing/dataset-wizard-listing.component.ts index a03e4de83..b9a2a74d4 100644 --- a/dmp-frontend/src/app/dmps/wizard/listing/dataset-wizard-listing.component.ts +++ b/dmp-frontend/src/app/dmps/wizard/listing/dataset-wizard-listing.component.ts @@ -56,7 +56,7 @@ export class DatasetWizardListingComponent implements OnInit { ngOnInit() { - this.route.params.subscribe((params: Params) => {debugger; + this.route.params.subscribe((params: Params) => { if (this.dmpId != null) if(params['dmpLabel']!=undefined) this.titlePrefix ="for " + params['dmpLabel'];