From 8d2db608b3a5bd438bec4ef85ac89920671ff904 Mon Sep 17 00:00:00 2001 From: Pierre Villard Date: Sat, 14 Dec 2024 15:13:46 +0100 Subject: [PATCH] NIFI-14072 Restored support for partial updates of Labels (#9575) Signed-off-by: David Handermann --- .../java/org/apache/nifi/web/dao/impl/StandardLabelDAO.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardLabelDAO.java b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardLabelDAO.java index 696f691c1f3f..f1d0f80bf018 100644 --- a/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardLabelDAO.java +++ b/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/dao/impl/StandardLabelDAO.java @@ -27,6 +27,8 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; +import java.util.HashMap; +import java.util.Map; import java.util.Set; @Repository @@ -99,7 +101,9 @@ public Label updateLabel(LabelDTO labelDTO) { label.setPosition(new Position(labelDTO.getPosition().getX(), labelDTO.getPosition().getY())); } if (labelDTO.getStyle() != null) { - label.setStyle(labelDTO.getStyle()); + final Map updatedStyles = new HashMap<>(label.getStyle()); + updatedStyles.putAll(labelDTO.getStyle()); + label.setStyle(updatedStyles); } if (labelDTO.getLabel() != null) { label.setValue(labelDTO.getLabel());