From 4bfd4a1be2bd247f5b0deab946d209d10997ca2a Mon Sep 17 00:00:00 2001 From: Flaminia Cavallo Date: Wed, 26 Jun 2024 16:36:07 +0200 Subject: [PATCH] feat(DHIS2-17506): enable configuring a section display options --- .../src/main/java/org/hisp/dhis/dataset/DataSet.java | 12 ++++++++++++ .../org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml | 2 ++ .../V2_42_8__Add_dataset_diplayoptions_field.sql | 1 + 3 files changed, 15 insertions(+) create mode 100644 dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_8__Add_dataset_diplayoptions_field.sql diff --git a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java index 877663eb8ad9..a4accba6b933 100644 --- a/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java +++ b/dhis-2/dhis-api/src/main/java/org/hisp/dhis/dataset/DataSet.java @@ -194,6 +194,8 @@ public class DataSet extends BaseDimensionalItemObject private ObjectStyle style; + private String displayOptions; + // ------------------------------------------------------------------------- // Constructors // ------------------------------------------------------------------------- @@ -778,6 +780,16 @@ public void setStyle(ObjectStyle style) { this.style = style; } + @JsonProperty + @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0) + public String getDisplayOptions() { + return displayOptions; + } + + public void setDisplayOptions(String displayOptions) { + this.displayOptions = displayOptions; + } + @Override @JsonProperty @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0) diff --git a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml index 3144aa89faf9..2dad9217f907 100644 --- a/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml +++ b/dhis-2/dhis-services/dhis-service-core/src/main/resources/org/hisp/dhis/dataset/hibernate/DataSet.hbm.xml @@ -25,6 +25,8 @@ + + diff --git a/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_8__Add_dataset_diplayoptions_field.sql b/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_8__Add_dataset_diplayoptions_field.sql new file mode 100644 index 000000000000..9abb5e910fef --- /dev/null +++ b/dhis-2/dhis-support/dhis-support-db-migration/src/main/resources/org/hisp/dhis/db/migration/2.42/V2_42_8__Add_dataset_diplayoptions_field.sql @@ -0,0 +1 @@ +ALTER TABLE dataset ADD COLUMN IF NOT EXISTS displayoptions jsonb default '{}'::jsonb;