diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html index 023436a31..c850cda7d 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.html @@ -14,7 +14,7 @@ -
@@ -261,7 +261,6 @@
- {{formGroup.value | json}} diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts index ec110fffe..152498a55 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.component.ts @@ -199,7 +199,7 @@ export class DmpEditorComponent extends BaseEditor implemen if (this.isNew) { let route = []; - route.push('../' + id); + route.push('/plans/overview/' + id); this.router.navigate(route, { queryParams: { 'lookup': this.queryParamsService.serializeLookup(this.lookupParams), 'lv': ++this.lv }, replaceUrl: true, relativeTo: this.route }); } else { this.refreshData(); @@ -218,13 +218,6 @@ export class DmpEditorComponent extends BaseEditor implemen ); } - //Transform properties - // formData.properties.dmpBlueprintValues = []; - // for (const fieldId in (this.formGroup.get('properties').get('dmpBlueprintValues') as UntypedFormGroup).controls) { - // formData.properties.dmpBlueprintValues.push(this.formGroup.get('properties').get('dmpBlueprintValues').get(fieldId).value); - // } - - this.dmpService.persist(formData) .pipe(takeUntil(this._destroyed)).subscribe( complete => onSuccess ? onSuccess(complete) : this.onCallbackSuccess(complete), @@ -320,6 +313,7 @@ export class DmpEditorComponent extends BaseEditor implemen label: this.formGroup.get('label').value, description: this.formGroup.get('description').value, blueprint: this.selectedBlueprint, + status: DmpStatus.Draft } this.prepareForm(dmp); } diff --git a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts index 5c29afbc0..43836326e 100644 --- a/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts +++ b/dmp-frontend/src/app/ui/dmp/dmp-editor-blueprint/dmp-editor.model.ts @@ -33,7 +33,7 @@ export class DmpEditorModel extends BaseEditorModel implements DmpPersist { super.fromModel(item); this.label = item.label; this.status = item.status; - this.properties = new DmpPropertiesEditorModel(this.validationErrorModel).fromModel(item.properties, item.dmpReferences.filter(x => x.isActive === IsActive.Active), item.blueprint); + this.properties = new DmpPropertiesEditorModel(this.validationErrorModel).fromModel(item.properties, item.dmpReferences?.filter(x => x.isActive === IsActive.Active), item.blueprint); this.description = item.description; this.language = item.language; this.blueprint = item.blueprint?.id;