From b463bca39d1531042ea654ed6008dd8164b2b0f9 Mon Sep 17 00:00:00 2001 From: elias Date: Wed, 25 Sep 2024 14:05:00 +0200 Subject: [PATCH 1/3] added @JsonProperty Annotations to fields in Requirements-class, because Jackson ObjectMapper adjusted filednames while deserializing (isDataPackagesRequired --> dataPackagesRequired) --- .../projectmanagement/domain/Requirements.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/Requirements.java b/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/Requirements.java index f779202583..33d8a4c3b7 100644 --- a/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/Requirements.java +++ b/src/main/java/eu/dzhw/fdz/metadatamanagement/projectmanagement/domain/Requirements.java @@ -2,6 +2,7 @@ import java.io.Serializable; +import com.fasterxml.jackson.annotation.JsonProperty; import org.javers.core.metamodel.annotation.ValueObject; import eu.dzhw.fdz.metadatamanagement.projectmanagement.domain.validation.EitherDataPackagesOrAnalysisPackagesRequired; @@ -36,46 +37,55 @@ public class Requirements implements Serializable { * Defines if dataPackage data is required for a release (either this object type is mandatory or * analysis packages). */ + @JsonProperty("isDataPackagesRequired") private boolean isDataPackagesRequired; /** * Defines if analysis package data is required for a release (either this object type is * mandatory or data packages). */ + @JsonProperty("isAnalysisPackagesRequired") private boolean isAnalysisPackagesRequired; /** * Defines if survey data is required for a release. */ + @JsonProperty("isSurveysRequired") private boolean isSurveysRequired; /** * Defines if instrument data is required for a release. */ + @JsonProperty("isInstrumentsRequired") private boolean isInstrumentsRequired; /** * Defines if question data is required for a release. */ + @JsonProperty("isQuestionsRequired") private boolean isQuestionsRequired; /** * Defines if data set data is required for a release. */ + @JsonProperty("isDataSetsRequired") private boolean isDataSetsRequired; /** * Defines if variable data is required for a release. */ + @JsonProperty("isVariablesRequired") private boolean isVariablesRequired; /** * Defines if publication data is required for a release. */ + @JsonProperty("isPublicationsRequired") private boolean isPublicationsRequired; /** * Defines if concept data is required for a release. */ + @JsonProperty("isConceptsRequired") private boolean isConceptsRequired; } From 72a9a78764332ca7e0db19328f0851f888ab4f79 Mon Sep 17 00:00:00 2001 From: theresa Date: Thu, 17 Oct 2024 10:33:50 +0200 Subject: [PATCH 2/3] #3233 updated all project cockpit requirements requests to use new ES field 'is[type]Required' --- .../metadata-type-state-card.directive.js | 8 ++++---- .../metadata-type-state-card.html.tmpl | 6 +++--- .../project-cockpit-config.html.tmpl | 18 +++++++++--------- .../project-cockpit-status.directive.js | 2 +- .../project-cockpit-status.html.tmpl | 4 ++-- .../project-cockpit-versions.html.tmpl | 4 ++-- .../services/projectUpdateAccessService.js | 4 ++-- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.directive.js b/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.directive.js index 778ac977a0..a26c936794 100644 --- a/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.directive.js +++ b/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.directive.js @@ -152,8 +152,8 @@ angular.module('metadatamanagementApp') }; ctrl.isRequired = function() { - return _.get(ctrl, 'project.configuration.requirements.' + - ctrl.type + 'Required'); + return _.get(ctrl, 'project.configuration.requirements.' + 'is' + + ctrl.type.charAt(0).toUpperCase() + ctrl.type.slice(1) + 'Required'); }; ctrl.getModifyButtonLabel = function(group) { @@ -182,8 +182,8 @@ angular.module('metadatamanagementApp') }; ctrl.isUpdateAllowed = function(type) { - return !_.get(ctrl, 'project.configuration.requirements.' + - type + 'Required'); + return !_.get(ctrl, 'project.configuration.requirements.is' + + type.charAt(0).toUpperCase() + type.slice(1) + 'Required'); }; ctrl.isUploadAllowed = function(type) { diff --git a/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.html.tmpl b/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.html.tmpl index 064913c272..a647bfc623 100644 --- a/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.html.tmpl +++ b/mdm-frontend/src/app/legacy/dataacquisitionprojectmanagement/directives/metadata-type-state-card.html.tmpl @@ -1,4 +1,4 @@ -