From beac6be7060fb3578e908c5bd462bc4796216408 Mon Sep 17 00:00:00 2001 From: Aldo Mihasi Date: Fri, 22 Sep 2023 09:31:12 +0300 Subject: [PATCH] add missing grant checks --- .../dashboard/recent/model/RecentDatasetModel.java | 8 ++++++-- .../data/dashboard/recent/model/RecentDmpModel.java | 4 +++- .../data/dmp/DataManagementPlanEditorModel.java | 6 ++++-- .../DataManagementPlanListingModel.java | 8 +++++--- .../data/listingmodels/DatasetListingModel.java | 8 +++++--- .../eu/eudat/models/data/rda/DmpRDAExportModel.java | 4 +++- .../DataManagementPlanPublicListingModel.java | 8 +++++--- .../listingmodels/DatasetPublicListingModel.java | 12 ++++++++---- .../editor/dmp-profile-editor.component.html | 4 ++-- .../dataset/overview/dataset-overview.component.html | 8 +++++--- 10 files changed, 46 insertions(+), 24 deletions(-) diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDatasetModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDatasetModel.java index 2d4e5f553..4037b3f13 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDatasetModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dashboard/recent/model/RecentDatasetModel.java @@ -39,7 +39,9 @@ public class RecentDatasetModel extends RecentActivityModel { this.setVersion(entity.getVersion()); this.datasets = entity.getDataset().stream().map(dataset -> new DatasetUrlListing().fromDataModel(dataset)).collect(Collectors.toList()); this.setFinalizedAt(entity.getFinalizedAt()); - this.setGrant(entity.getGrant().getLabel()); + if (entity.getGrant() != null) { + this.setGrant(entity.getGrant().getLabel()); + } this.groupId = entity.getGroupId(); this.setPublic(entity.isPublic()); this.setPublishedAt(entity.getPublishedAt()); diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java index a15cd0c4f..c356d73d3 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/dmp/DataManagementPlanEditorModel.java @@ -275,8 +275,10 @@ public class DataManagementPlanEditorModel implements DataModel new UserListingModel().fromDataModel(item.getUser())).collect(Collectors.toList()); this.users = entity.getUsers().stream().map(item -> new UserInfoListingModel().fromDataModel(item)).collect(Collectors.toList()); - this.funder = new FunderDMPEditorModel(); - this.funder.getExistFunder().fromDataModel(entity.getGrant().getFunder()); + if (entity.getGrant() != null) { + this.funder = new FunderDMPEditorModel(); + this.funder.getExistFunder().fromDataModel(entity.getGrant().getFunder()); + } this.extraProperties = entity.getExtraProperties() != null ? new org.json.JSONObject(entity.getExtraProperties()).toMap() : null; return this; diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DataManagementPlanListingModel.java b/dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DataManagementPlanListingModel.java index 3268e6fdd..ade3d3918 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DataManagementPlanListingModel.java +++ b/dmp-backend/web/src/main/java/eu/eudat/models/data/listingmodels/DataManagementPlanListingModel.java @@ -174,9 +174,11 @@ public class DataManagementPlanListingModel implements DataModel Description - +
@@ -247,7 +247,7 @@
Max Multiplicity - +
diff --git a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html index 4e9f24a47..92c068c65 100644 --- a/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html +++ b/dmp-frontend/src/app/ui/dataset/overview/dataset-overview.component.html @@ -68,9 +68,11 @@ -
{{'DMP-OVERVIEW.GRANT' | translate}}
-
{{ dataset.grant.label }}
- +
+
{{'DMP-OVERVIEW.GRANT' | translate}}
+
{{ dataset.grant.label }}
+
+
{{'DMP-OVERVIEW.RESEARCHERS' | translate}}