From e428e8a5df548a43dca7bc95cb004776a45a6250 Mon Sep 17 00:00:00 2001 From: George Kalampokis Date: Wed, 8 Jul 2020 18:26:07 +0300 Subject: [PATCH] When creating new DMPs pre-set the visibility (restricted) and the contact (creator). They can be changed later in the draft phase. --- .../eu/eudat/models/data/quickwizard/DmpQuickWizardModel.java | 2 ++ dmp-frontend/src/app/ui/dmp/editor/dmp-editor.component.ts | 2 ++ 2 files changed, 4 insertions(+) diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/quickwizard/DmpQuickWizardModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/quickwizard/DmpQuickWizardModel.java index 93aa43722..d67f9724b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/quickwizard/DmpQuickWizardModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/quickwizard/DmpQuickWizardModel.java @@ -101,6 +101,8 @@ public class DmpQuickWizardModel { dataManagementPlanEntity.setAssociatedUsers(user); dataManagementPlanEntity.setExtraProperties(new HashMap<>()); dataManagementPlanEntity.getExtraProperties().put("language", this.language); + dataManagementPlanEntity.getExtraProperties().put("visible", false); + dataManagementPlanEntity.getExtraProperties().put("contact", principal.getId().toString()); return dataManagementPlanEntity; } 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 25f661180..74de57de3 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 @@ -228,6 +228,8 @@ export class DmpEditorComponent extends BaseComponent implements OnInit, IBreadC this.dmp.project = new ProjectFormModel(); this.dmp.funder = new FunderFormModel(); this.dmp.extraProperties = new ExtraPropertiesFormModel(); + this.dmp.extraProperties.visible = false; + this.dmp.extraProperties.contact = this.authService.current().id; this.formGroup = this.dmp.buildForm(); this.registerFormEventsForNewItem(); if (this.isAuthenticated) {