fix(editor): Fix opening of chat window when executing a child node (#8789)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
Co-authored-by: Michael Kret <michael.k@radency.com>
This commit is contained in:
oleg
2024-03-21 09:23:15 +01:00
committed by GitHub
parent 5e84c2ab89
commit 5f53d76e39
11 changed files with 97 additions and 25 deletions

View File

@@ -1,4 +1,5 @@
import {
CHAT_TRIGGER_NODE_TYPE,
DEFAULT_NEW_WORKFLOW_NAME,
DUPLICATE_POSTFFIX,
EnterpriseEditionFeature,
@@ -1460,5 +1461,18 @@ export const useWorkflowsStore = defineStore(STORES.WORKFLOWS, {
appendChatMessage(message: string): void {
this.chatMessages.push(message);
},
checkIfNodeHasChatParent(nodeName: string): boolean {
const workflow = this.getCurrentWorkflow();
const parents = workflow.getParentNodes(nodeName, 'main');
const matchedChatNode = parents.find((parent) => {
const parentNodeType = this.getNodeByName(parent)?.type;
return parentNodeType === CHAT_TRIGGER_NODE_TYPE;
});
return !!matchedChatNode;
},
},
});