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 7db5fa890..6d3aed63c 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 @@ -12,12 +12,12 @@
-
+
-
+
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 f2b72cf57..10e45e768 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 @@ -39,6 +39,7 @@ import { AddResearcherComponent } from './add-researcher/add-researcher.componen import { AvailableProfilesComponent } from './available-profiles/available-profiles.component'; import { DmpEditorModel } from './dmp-editor.model'; import { DmpFinalizeDialogComponent } from './dmp-finalize-dialog/dmp-finalize-dialog.component'; +import { DmpProfileStatus } from '../../../core/common/enum/dmp-profile-status'; @Component({ selector: 'app-dmp-editor-component', @@ -65,7 +66,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC profilesAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; organisationsAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; researchersAutoCompleteConfiguration: MultipleAutoCompleteConfiguration; - dmpProfileAutoCompleteConfiguration:SingleAutoCompleteConfiguration; + dmpProfileAutoCompleteConfiguration: SingleAutoCompleteConfiguration; createNewVersion; associatedUsers: Array; @@ -110,7 +111,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC titleFn: (item) => item['label'] }; - this.dmpProfileAutoCompleteConfiguration= { + this.dmpProfileAutoCompleteConfiguration = { filterFn: this.dmpProfileSearch.bind(this), initialItems: (extraData) => this.dmpProfileSearch(''), displayFn: (item) => item['label'], @@ -185,9 +186,6 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC .subscribe(params => { this.createNewVersion = params['clone']; }); - - - } registerFormEventsForDmpProfile(): void { @@ -217,7 +215,7 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC ]); } - dmpProfileSearch(query: string){ + dmpProfileSearch(query: string) { let fields: Array = new Array(); var request = new DataTableRequest(0, 10, { fields: fields }); request.criteria = new DmpProfileCriteria(); @@ -435,15 +433,16 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC if (this.formGroup.get('status').value !== DmpStatus.Finalized) { this.editMode = true; this.formGroup.enable(); - } else { - this.dmpService.unlock(this.formGroup.get('id').value) - .pipe(takeUntil(this._destroyed)) - .subscribe(x => { - this.editMode = true; - this.formGroup.get('status').patchValue(DmpStatus.Draft); - this.formGroup.enable(); - }); } + //else { + // this.dmpService.unlock(this.formGroup.get('id').value) + // .pipe(takeUntil(this._destroyed)) + // .subscribe(x => { + // this.editMode = true; + // this.formGroup.get('status').patchValue(DmpStatus.Draft); + // this.formGroup.enable(); + // }); + // } } public disableForm() { diff --git a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts index 622a13b7f..f57e65a3c 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts +++ b/dmp-frontend/src/app/ui/dmp/wizard/dmp-wizard.component.ts @@ -46,15 +46,16 @@ export class DmpWizardComponent extends BaseComponent implements OnInit, IBreadC .pipe(takeUntil(this._destroyed)) .subscribe(data => { this.dmp = new DmpWizardEditorModel().fromModel(data); - this.isClone = this.route.snapshot.data.clone; this.formGroup = this.dmp.buildForm(); if (this.route.routeConfig.path.startsWith('new_version/')) { - this.formGroup.get('version').setValue(this.dmp.version + 1); + this.formGroup.get('version').setValue(this.formGroup.get('version').value + 1); this.formGroup.controls['label'].disable(); this.formGroup.controls['project'].disable(); + this.isClone = false; } else if (this.route.routeConfig.path.startsWith('clone/')) { - this.formGroup.get('label').setValue(this.dmp.label + "New"); + this.formGroup.get('label').setValue(this.dmp.label + " New"); + this.isClone = true; } }); }); diff --git a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html index 7c386518a..768d1df14 100644 --- a/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/wizard/editor/dmp-wizard-editor.component.html @@ -4,42 +4,65 @@
- - {{formGroup.get('label').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + + {{formGroup.get('label').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + - {{formGroup.get('project').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + {{formGroup.get('project').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - - {{formGroup.get('description').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + + {{formGroup.get('description').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + - {{formGroup.get('profiles').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + {{formGroup.get('profiles').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + - {{formGroup.get('organisations').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + {{formGroup.get('organisations').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} - + - {{formGroup.get('researchers').getError('backendError').message}} - {{'GENERAL.VALIDATION.REQUIRED' | translate}} + + {{formGroup.get('researchers').getError('backendError').message}} + + {{'GENERAL.VALIDATION.REQUIRED' | translate}} @@ -60,4 +83,4 @@ -
+
\ No newline at end of file