fix(editor): Resolve expressions for grandparent nodes (#5859)

* fix(editor): Resolve expressions for grandparent nodes

* test: add tests

* test: add tests for bug

* test: add todos

* test: lintfix

* test: add small waits

* test: add linking tests

* test: add test for branch mapping

* test: update workflow values

* test: comment out test

* test: fix up tests with new values

* chore: remove todos

* test: add ticket number for broken test

* test: refactor a bit

* test: uncomment

* test: fix mapping test

* fix: lint issue

* test: split tests

* Revert "test: split tests"

0290d51d7c983320a718346ccb80fbad93894c6e

* test: update mousedown

* test: split up tests

* test: fix test

* test: fix test

* test: make less flaky

* test: make less flaky

* test: enable teset
This commit is contained in:
Mutasem Aldmour
2023-04-21 14:08:51 +02:00
committed by GitHub
parent d17d050a16
commit a19d4447ac
13 changed files with 759 additions and 100 deletions

View File

@@ -28,7 +28,7 @@
:class="$style.hint"
data-test-id="parameter-expression-preview"
class="ph-no-capture"
:highlight="!!(expressionOutput && targetItem)"
:highlight="!!(expressionOutput && targetItem) && isInputParentOfActiveNode"
:hint="expressionOutput"
:singleLine="true"
/>
@@ -153,25 +153,29 @@ export default mixins(showMessage, workflowHelpers).extend({
targetItem(): TargetItem | null {
return this.ndvStore.hoveringItem;
},
isInputParentOfActiveNode(): boolean {
return this.ndvStore.isInputParentOfActiveNode;
},
expressionValueComputed(): string | null {
const inputNodeName: string | undefined = this.ndvStore.ndvInputNodeName;
const value = isResourceLocatorValue(this.value) ? this.value.value : this.value;
if (this.activeNode === null || !this.isValueExpression || typeof value !== 'string') {
if (!this.activeNode || !this.isValueExpression || typeof value !== 'string') {
return null;
}
const inputRunIndex: number | undefined = this.ndvStore.ndvInputRunIndex;
const inputBranchIndex: number | undefined = this.ndvStore.ndvInputBranchIndex;
let computedValue: NodeParameterValue;
try {
const targetItem = this.targetItem ?? undefined;
computedValue = this.resolveExpression(value, undefined, {
targetItem,
inputNodeName,
inputRunIndex,
inputBranchIndex,
});
let opts;
if (this.ndvStore.isInputParentOfActiveNode) {
opts = {
targetItem: this.targetItem ?? undefined,
inputNodeName: this.ndvStore.ndvInputNodeName,
inputRunIndex: this.ndvStore.ndvInputRunIndex,
inputBranchIndex: this.ndvStore.ndvInputBranchIndex,
};
}
computedValue = this.resolveExpression(value, undefined, opts);
if (computedValue === null) {
return null;
}