From f3d98f5ea63db7f7b2155e7efb0812f025c5bcf3 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sat, 23 Sep 2023 20:35:57 -0300 Subject: data, test: collate update description from composition inputs --- src/data/things/composite.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/data') diff --git a/src/data/things/composite.js b/src/data/things/composite.js index c0f0ab0b..34e550a1 100644 --- a/src/data/things/composite.js +++ b/src/data/things/composite.js @@ -837,6 +837,16 @@ export function compositeFrom(description) { .filter(dependency => isInputToken(dependency)) .some(token => getInputTokenShape(token) === 'input.updateValue'); + // Update descriptions passed as the value in an input.updateValue() token, + // as provided as inputs for this composition. + const inputUpdateDescriptions = + Object.values(description.inputs ?? {}) + .map(token => + (getInputTokenShape(token) === 'input.updateValue' + ? getInputTokenValue(token) + : null)) + .filter(Boolean); + const base = composition.at(-1); const steps = composition.slice(); @@ -1396,6 +1406,7 @@ export function compositeFrom(description) { constructedDescriptor.update = Object.assign( {...description.update ?? {}}, + ...inputUpdateDescriptions, ...stepUpdateDescriptions.flat()); } -- cgit 1.3.0-6-gf8a5