- Using displayName where appropriate.
- Ensuring descriptor exists before attempting to use a default value.
This commit is contained in:
Matt Gilman 2014-12-09 15:58:32 -05:00
parent 63e80d3fdc
commit 3861446958
2 changed files with 15 additions and 11 deletions

View File

@ -475,11 +475,11 @@ nf.ProcessorPropertyTable = (function () {
// use the display name if possible // use the display name if possible
displayName = descriptor.displayName; displayName = descriptor.displayName;
}
// determine the value // determine the value
if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) { if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) {
value = descriptor.defaultValue; value = descriptor.defaultValue;
}
} }
// add the row // add the row

View File

@ -462,6 +462,7 @@ nf.ProcessorDetails = (function () {
// determine the property type // determine the property type
var type = 'userDefined'; var type = 'userDefined';
var displayName = name;
if (nf.Common.isDefinedAndNotNull(descriptor)) { if (nf.Common.isDefinedAndNotNull(descriptor)) {
if (descriptor.required === true) { if (descriptor.required === true) {
type = 'required'; type = 'required';
@ -470,17 +471,20 @@ nf.ProcessorDetails = (function () {
} else { } else {
type = 'optional'; type = 'optional';
} }
}
// determine the value // use the display name if possible
if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) { displayName = descriptor.displayName;
value = descriptor.defaultValue;
// determine the value
if (nf.Common.isUndefined(value) || nf.Common.isNull(value)) {
value = descriptor.defaultValue;
}
} }
// add the row // add the row
propertyData.addItem({ propertyData.addItem({
id: i++, id: i++,
property: name, property: displayName,
value: value, value: value,
type: type type: type
}); });