-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
N8N-2586 Improve Waiting Webhook call state in WF Canvas #2430
N8N-2586 Improve Waiting Webhook call state in WF Canvas #2430
Conversation
…, it is a trigger node, if it is only one trigger node in WF
…ctveTriggerNodesInWokrflow, Add style to trigger node's tooltip, remove comments
…nterface, Updated Logic for TriggerNode Tooltip based on the new prop
@mutdmour Added the new changes for Node-specific overrides (https://www.notion.so/n8n/Improve-Waiting-for-Webhook-Call-state-aa3579a128454e0280dbc93fb8161843) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for making all the fixes. I think we are almost there.
handler(isWorkflowRunning) { | ||
if (isWorkflowRunning && this.isTriggerNode && this.isSingleActiveTriggerNode && !this.isTriggerNodeTooltipEmpty) { | ||
setTimeout(() => { | ||
this.showWebhookNodeTooltip = isWorkflowRunning; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This three scenarios are fixed with the latest push.
-If node runs successfully before timeout, it would not show the tooltip.
-Also if node hasIssues will not show the tooltip.
-Also if Paused node is paused before the tooltip is shown.
And one more scenario. If one of the nodes are paused during execution, the watcher update the prop.
… has issues, if paused, if wokrlfow is running, Refactor Getter
@SchnapsterDog one more scenario that just came to me to reproduce:
|
…it is Draged&Droped on the WF
This is also fixed. |
…8n-2586-improve-waiting-for-webhook-call-state
getTriggerNodeTooltip (): string | undefined { | ||
if (this.nodeType !== null && this.nodeType.hasOwnProperty('eventTriggerDescription')) { | ||
return this.nodeType.eventTriggerDescription; | ||
} else { | ||
return `Waiting for you to create an event in ${this.getTrimmedTriggerNodeTypeName()}`; | ||
} | ||
}, | ||
getTrimmedTriggerNodeTypeName() { | ||
return this.nodeType && this.nodeType.displayName.replace(/Trigger/, ""); | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you make these into one computed property.. it does not need to be a method...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done into one computed property.
nodeType (): INodeTypeDescription | null { | ||
return this.$store.getters.nodeType(this.data.type); | ||
}, | ||
node (): INodeUi | undefined { | ||
return this.$store.getters.nodesByName[this.name] as INodeUi; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return this.$store.getters.nodesByName[this.name] as INodeUi; | |
return this.$store.getters.nodesByName[this.name] as INodeUi | undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
packages/editor-ui/src/store.ts
Outdated
@@ -738,6 +738,11 @@ export const store = new Vuex.Store({ | |||
return state.activeWorkflows; | |||
}, | |||
|
|||
activeWorkflowTriggerNodes: (state, getters) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe rename this to workflowTriggerNodes
.. I suggested active
before because I thought we would also check if nodes are disabled.
Otherwise update code to only return active (not disabled) nodes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Renamaed
if (this.workflowRunning) { | ||
this.showTriggerNodeTooltip = true; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should always check in the handler that we should show tooltip. otherwise we have a race condition between our two handlers.
if (this.workflowRunning) { | |
this.showTriggerNodeTooltip = true; | |
} | |
this.showTriggerNodeTooltip = this.shouldShowTooltip; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -207,13 +239,35 @@ export default mixins(externalHooks, nodeBase, nodeHelpers, workflowHelpers).ext | |||
shiftOutputCount (): boolean { | |||
return !!(this.nodeType && this.nodeType.outputs.length > 2); | |||
}, | |||
}, | |||
shouldShowTooltip () : boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick - just can be a little more clear... since we have another tooltip in nodes (error tooltip)
shouldShowTooltip () : boolean { | |
shouldShowTriggerTooltip () : boolean { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Refactored
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job 🙏
Thanks for your directions :) |
Thanks a lot. Got merged. |
Got released with |
No description provided.