This is an automated email from the ASF dual-hosted git repository.

pvillard pushed a commit to branch support/nifi-1.13
in repository https://gitbox.apache.org/repos/asf/nifi.git


The following commit(s) were added to refs/heads/support/nifi-1.13 by this push:
     new a6d613f  NIFI-8270: Fixed issue to show property dependent on default 
value of another
a6d613f is described below

commit a6d613f880daa6575b88bd59b1b75b96f9ab043f
Author: Matthew Burgess <[email protected]>
AuthorDate: Mon Mar 1 14:32:12 2021 -0500

    NIFI-8270: Fixed issue to show property dependent on default value of 
another
    
    Signed-off-by: Pierre Villard <[email protected]>
    
    This closes #4860.
---
 .../main/java/org/apache/nifi/web/api/dto/DtoFactory.java    | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
index 5437d44..792e06c 100644
--- 
a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
+++ 
b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-web/nifi-web-api/src/main/java/org/apache/nifi/web/api/dto/DtoFactory.java
@@ -1556,8 +1556,8 @@ public final class DtoFactory {
         orderedProperties.putAll(sortedProperties);
 
         // build the descriptor and property dtos
-        dto.setDescriptors(new LinkedHashMap<String, PropertyDescriptorDTO>());
-        dto.setProperties(new LinkedHashMap<String, String>());
+        dto.setDescriptors(new LinkedHashMap<>());
+        dto.setProperties(new LinkedHashMap<>());
         for (final Map.Entry<PropertyDescriptor, String> entry : 
orderedProperties.entrySet()) {
             final PropertyDescriptor descriptor = entry.getKey();
 
@@ -1568,6 +1568,8 @@ public final class DtoFactory {
             String propertyValue = entry.getValue();
             if (propertyValue != null && descriptor.isSensitive()) {
                 propertyValue = SENSITIVE_VALUE_MASK;
+            } else if (propertyValue == null && descriptor.getDefaultValue() 
!= null) {
+                propertyValue = descriptor.getDefaultValue();
             }
 
             // set the property value
@@ -1636,8 +1638,8 @@ public final class DtoFactory {
         orderedProperties.putAll(sortedProperties);
 
         // build the descriptor and property dtos
-        dto.setDescriptors(new LinkedHashMap<String, PropertyDescriptorDTO>());
-        dto.setProperties(new LinkedHashMap<String, String>());
+        dto.setDescriptors(new LinkedHashMap<>());
+        dto.setProperties(new LinkedHashMap<>());
         for (final Map.Entry<PropertyDescriptor, String> entry : 
orderedProperties.entrySet()) {
             final PropertyDescriptor descriptor = entry.getKey();
 
@@ -1649,6 +1651,8 @@ public final class DtoFactory {
             String propertyValue = entry.getValue();
             if (propertyValue != null && descriptor.isSensitive()) {
                 propertyValue = SENSITIVE_VALUE_MASK;
+            } else if (propertyValue == null && descriptor.getDefaultValue() 
!= null) {
+                propertyValue = descriptor.getDefaultValue();
             }
 
             // set the property value

Reply via email to