fix: displayOptions not getting value of RLC (#4460)

* fix: use `value` of RLC in `displayOptions`

* fix: add `__rl` to RLC default value if it doesn't have it
This commit is contained in:
Valya 2022-11-02 09:37:49 +00:00 committed by GitHub
parent 41e6489b75
commit 3a1fa09108
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -292,6 +292,10 @@ export function displayParameter(
value = get(nodeValues, propertyName);
}
if (value && typeof value === 'object' && '__rl' in value && value.__rl) {
value = value.value;
}
values.length = 0;
if (!Array.isArray(value)) {
values.push(value);
@ -325,6 +329,10 @@ export function displayParameter(
value = get(nodeValues, propertyName);
}
if (value && typeof value === 'object' && '__rl' in value && value.__rl) {
value = value.value;
}
values.length = 0;
if (!Array.isArray(value)) {
values.push(value);
@ -620,6 +628,14 @@ export function getNodeParameters(
nodeValues[nodeProperties.name] !== undefined
? nodeValues[nodeProperties.name]
: nodeProperties.default;
} else if (
nodeProperties.type === 'resourceLocator' &&
typeof nodeProperties.default === 'object'
) {
nodeParameters[nodeProperties.name] =
nodeValues[nodeProperties.name] !== undefined
? nodeValues[nodeProperties.name]
: { __rl: true, ...nodeProperties.default };
} else {
nodeParameters[nodeProperties.name] =
nodeValues[nodeProperties.name] || nodeProperties.default;