You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by ma...@apache.org on 2014/12/11 19:41:19 UTC
[17/25] incubator-nifi git commit: NIFI-159: - Allowing optional
properties to be reset. - Used null to represent an unset value as previously
it was considered undefined. When undefined,
the property was not being included in the serialized configuratio
NIFI-159:
- Allowing optional properties to be reset.
- Used null to represent an unset value as previously it was considered undefined. When undefined, the property was not being included in the serialized configuration.
Project: http://git-wip-us.apache.org/repos/asf/incubator-nifi/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-nifi/commit/fe2a3318
Tree: http://git-wip-us.apache.org/repos/asf/incubator-nifi/tree/fe2a3318
Diff: http://git-wip-us.apache.org/repos/asf/incubator-nifi/diff/fe2a3318
Branch: refs/heads/bootstrap
Commit: fe2a331820ea75e88891a5888365be6eb281c783
Parents: cb2e855
Author: Matt Gilman <ma...@gmail.com>
Authored: Wed Dec 10 14:27:11 2014 -0500
Committer: Matt Gilman <ma...@gmail.com>
Committed: Wed Dec 10 14:27:11 2014 -0500
----------------------------------------------------------------------
.../nf/canvas/nf-processor-property-combo-editor.js | 14 ++++++++------
.../js/nf/canvas/nf-processor-property-nfel-editor.js | 9 ++-------
.../js/nf/canvas/nf-processor-property-table.js | 6 +++---
.../js/nf/canvas/nf-processor-property-text-editor.js | 9 ++-------
.../src/main/webapp/js/nf/nf-processor-details.js | 2 +-
5 files changed, 16 insertions(+), 24 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/fe2a3318/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
index ceaa529..a7c488c 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-combo-editor.js
@@ -51,13 +51,15 @@ nf.ProcessorPropertyComboEditor = function (args) {
optionClass: 'unset'
});
}
- $.each(allowableValues, function (i, allowableValue) {
- options.push({
- text: allowableValue.displayName,
- value: allowableValue.value,
- description: nf.Common.escapeHtml(allowableValue.description)
+ if ($.isArray(allowableValues)) {
+ $.each(allowableValues, function (i, allowableValue) {
+ options.push({
+ text: allowableValue.displayName,
+ value: allowableValue.value,
+ description: nf.Common.escapeHtml(allowableValue.description)
+ });
});
- });
+ }
// ensure the options there is at least one option
if (options.length === 0) {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/fe2a3318/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
index f19a001..0dc945a 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-nfel-editor.js
@@ -160,18 +160,13 @@ nf.ProcessorPropertyNfelEditor = function (args) {
// otherwise if the property is required
if (nf.ProcessorPropertyTable.isRequiredProperty(propertyDescriptor)) {
if (nf.Common.isBlank(propertyDescriptor.defaultValue)) {
- // reset to the previous value if available
- if (nf.Common.isDefinedAndNotNull(previousValue)) {
- return previousValue;
- } else {
- return undefined;
- }
+ return previousValue;
} else {
return propertyDescriptor.defaultValue;
}
} else {
// if the property is not required, clear the value
- return undefined;
+ return null;
}
}
} else {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/fe2a3318/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
index d5ff1c4..486ded6 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-table.js
@@ -40,7 +40,7 @@ nf.ProcessorPropertyTable = (function () {
hidden: false,
property: propertyName,
displayName: propertyName,
- previousValue: undefined,
+ previousValue: null,
value: propertyValue,
type: 'userDefined'
});
@@ -377,7 +377,7 @@ nf.ProcessorPropertyTable = (function () {
if (nf.Common.isDefinedAndNotNull(propertyDescriptor)) {
return propertyDescriptor.allowableValues;
} else {
- return undefined;
+ return null;
}
},
/**
@@ -477,7 +477,7 @@ nf.ProcessorPropertyTable = (function () {
displayName = descriptor.displayName;
// determine the value
- if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) {
+ if (nf.Common.isNull(value) && nf.Common.isDefinedAndNotNull(descriptor.defaultValue)) {
value = descriptor.defaultValue;
}
}
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/fe2a3318/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-text-editor.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-text-editor.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-text-editor.js
index 04bd652..7eb562a 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-text-editor.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/canvas/nf-processor-property-text-editor.js
@@ -169,18 +169,13 @@ nf.ProcessorPropertyTextEditor = function (args) {
// otherwise if the property is required
if (nf.ProcessorPropertyTable.isRequiredProperty(propertyDescriptor)) {
if (nf.Common.isBlank(propertyDescriptor.defaultValue)) {
- // reset to the previous value if available
- if (nf.Common.isDefinedAndNotNull(previousValue)) {
- return previousValue;
- } else {
- return undefined;
- }
+ return previousValue;
} else {
return propertyDescriptor.defaultValue;
}
} else {
// if the property is not required, clear the value
- return undefined;
+ return null;
}
}
} else {
http://git-wip-us.apache.org/repos/asf/incubator-nifi/blob/fe2a3318/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
----------------------------------------------------------------------
diff --git a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
index 8daff9a..b4c1da9 100644
--- a/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
+++ b/nar-bundles/framework-bundle/framework/web/nifi-web-ui/src/main/webapp/js/nf/nf-processor-details.js
@@ -476,7 +476,7 @@ nf.ProcessorDetails = (function () {
displayName = descriptor.displayName;
// determine the value
- if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) {
+ if (nf.Common.isNull(value) && nf.Common.isDefinedAndNotNull(descriptor.defaultValue)) {
value = descriptor.defaultValue;
}
}