Display also properties with value "null" in variable selector

This commit is contained in:
Jan Oberhauser 2020-02-08 23:30:09 -08:00
parent 2238651fcd
commit 0e0f5c3e15
2 changed files with 13 additions and 3 deletions

View file

@ -258,16 +258,19 @@ export default mixins(
} else if (value.charAt(0) === '^') { } else if (value.charAt(0) === '^') {
// Is variable // Is variable
let displayValue = `{{${value.slice(1)}}}` as string | number | boolean; let displayValue = `{{${value.slice(1)}}}` as string | number | boolean | null;
if (this.resolvedValue) { if (this.resolvedValue) {
displayValue = this.resolveParameterString(displayValue.toString()) as NodeParameterValue; displayValue = [null, undefined].includes(displayValue as null | undefined) ? '' : displayValue;
displayValue = this.resolveParameterString((displayValue as string).toString()) as NodeParameterValue;
} }
displayValue = [null, undefined].includes(displayValue as null | undefined) ? '' : displayValue;
editorOperations.push({ editorOperations.push({
attributes: { attributes: {
variable: `{{${value.slice(1)}}}`, variable: `{{${value.slice(1)}}}`,
}, },
insert: displayValue.toString(), insert: (displayValue as string).toString(),
}); });
} else { } else {
// Is text // Is text

View file

@ -168,6 +168,13 @@ export default mixins(
const returnData: IVariableSelectorOption[] = []; const returnData: IVariableSelectorOption[] = [];
if (inputData === null) { if (inputData === null) {
returnData.push(
{
name: propertyName,
key: fullpath,
value: '[null]',
} as IVariableSelectorOption,
);
return returnData; return returnData;
} else if (Array.isArray(inputData)) { } else if (Array.isArray(inputData)) {
let newPropertyName = propertyName; let newPropertyName = propertyName;