feat(editor): Chat Trigger tweaks (#9618)

Signed-off-by: Oleg Ivaniv <me@olegivaniv.com>
This commit is contained in:
oleg
2024-06-04 17:24:18 +02:00
committed by GitHub
parent 42ceec6879
commit 5322802992
11 changed files with 42 additions and 29 deletions

View File

@@ -725,12 +725,23 @@ export default defineComponent({
);
},
isManualChatOnly(): boolean {
return this.containsChatNodes && this.triggerNodes.length === 1;
if (!this.canvasChatNode) return false;
return this.containsChatNodes && this.triggerNodes.length === 1 && !this.pinnedChatNodeData;
},
canvasChatNode() {
return this.nodes.find((node) => node.type === CHAT_TRIGGER_NODE_TYPE);
},
pinnedChatNodeData() {
if (!this.canvasChatNode) return null;
return this.workflowsStore.pinDataByNodeName(this.canvasChatNode.name);
},
isExecutionDisabled(): boolean {
if (
this.containsChatNodes &&
this.triggerNodes.every((node) => node.disabled || node.type === CHAT_TRIGGER_NODE_TYPE)
this.triggerNodes.every((node) => node.disabled || node.type === CHAT_TRIGGER_NODE_TYPE) &&
!this.pinnedChatNodeData
) {
return true;
}