You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by li...@apache.org on 2022/04/18 06:09:41 UTC
[dolphinscheduler] branch dev updated: [Fix][UI] Fix condition task connection failure. (#9548)
This is an automated email from the ASF dual-hosted git repository.
liudongkai pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new 491e9f84ee [Fix][UI] Fix condition task connection failure. (#9548)
491e9f84ee is described below
commit 491e9f84eea10f0b9e8dfff8316ba67dfd50ccac
Author: Amy0104 <97...@users.noreply.github.com>
AuthorDate: Mon Apr 18 14:09:32 2022 +0800
[Fix][UI] Fix condition task connection failure. (#9548)
---
.../views/projects/workflow/components/dag/use-canvas-init.ts | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts
index c83e751ac0..bc7a809b19 100644
--- a/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/use-canvas-init.ts
@@ -114,7 +114,15 @@ export function useCanvasInit(options: Options) {
const sourceData = sourceCell.getData()
if (!sourceData) return true
if (sourceData.taskType !== 'CONDITIONS') return true
- return (graph.value?.getConnectedEdges(sourceCell).length || 0) <= 2
+ const edges = graph.value?.getConnectedEdges(sourceCell)
+ if (!edges || edges.length < 2) return true
+ let len = 0
+ return !edges.some((edge) => {
+ if (edge.getSourceCellId() === sourceCell.id) {
+ len++
+ }
+ return len > 2
+ })
}
return true