NIFI-8270: Fixed issue to show property dependent on default value of another

Signed-off-by: Pierre Villard <pierre.villard.fr@gmail.com>

This closes #4860.
This commit is contained in:
Matthew Burgess 2021-03-01 14:32:12 -05:00 committed by Pierre Villard
parent 7876f412fb
commit 0d473bacf6
No known key found for this signature in database
GPG Key ID: F92A93B30C07C6D5
1 changed files with 8 additions and 4 deletions

View File

@ -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