From f851163df6a17106599f675e205dd5985ca68c94 Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Fri, 25 Oct 2024 16:55:54 +0200 Subject: [PATCH 1/2] Ordering subfields while displaying dataset version differences --- .../iq/dataverse/DatasetVersionDifference.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetVersionDifference.java b/src/main/java/edu/harvard/iq/dataverse/DatasetVersionDifference.java index eca0c84ae84..c32f49e985e 100644 --- a/src/main/java/edu/harvard/iq/dataverse/DatasetVersionDifference.java +++ b/src/main/java/edu/harvard/iq/dataverse/DatasetVersionDifference.java @@ -152,8 +152,7 @@ public DatasetVersionDifference(DatasetVersion newVersion, DatasetVersion origin getReplacedFiles(); initDatasetFilesDifferencesList(); - //Sort within blocks by datasetfieldtype dispaly order then.... - //sort via metadatablock order - citation first... + //Sort within blocks by datasetfieldtype display order for (List blockList : detailDataByBlock) { Collections.sort(blockList, (DatasetField[] l1, DatasetField[] l2) -> { DatasetField dsfa = l1[0]; //(DatasetField[]) l1.get(0); @@ -163,6 +162,17 @@ public DatasetVersionDifference(DatasetVersion newVersion, DatasetVersion origin return Integer.valueOf(a).compareTo(b); }); } + //Sort existing compoundValues by datasetfieldtype display order + for (List blockList : detailDataByBlock) { + for (DatasetField[] dfarr : blockList) { + for (DatasetField df : dfarr) { + for (DatasetFieldCompoundValue dfcv : df.getDatasetFieldCompoundValues()) { + Collections.sort(dfcv.getChildDatasetFields(), DatasetField.DisplayOrder); + } + } + } + } + //Sort via metadatablock order Collections.sort(detailDataByBlock, (List l1, List l2) -> { DatasetField dsfa[] = (DatasetField[]) l1.get(0); DatasetField dsfb[] = (DatasetField[]) l2.get(0); From b3147a083d140b6a9a2feea21aa043621f692fcc Mon Sep 17 00:00:00 2001 From: Ludovic DANIEL Date: Fri, 25 Oct 2024 17:04:38 +0200 Subject: [PATCH 2/2] adding release note --- doc/release-notes/10969-order-subfields-version-difference.md | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 doc/release-notes/10969-order-subfields-version-difference.md diff --git a/doc/release-notes/10969-order-subfields-version-difference.md b/doc/release-notes/10969-order-subfields-version-difference.md new file mode 100644 index 00000000000..3f245ebe069 --- /dev/null +++ b/doc/release-notes/10969-order-subfields-version-difference.md @@ -0,0 +1,2 @@ +Bug Fix: +In order to facilitate the comparison between the draft version and the published version of a dataset, a sort on subfields has been added (#10969) \ No newline at end of file