You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by zh...@apache.org on 2022/09/23 11:47:21 UTC

[dolphinscheduler] 02/03: [Fix] Also auto formatter workflow instance if location is null (#12080)

This is an automated email from the ASF dual-hosted git repository.

zhongjiajie pushed a commit to branch 3.1.0-prepare
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git

commit 71c51c3c3daaa9b6eb3034fa0c37e4b0ec3ac4ae
Author: Jiajie Zhong <zh...@hotmail.com>
AuthorDate: Fri Sep 23 18:20:39 2022 +0800

    [Fix] Also auto formatter workflow instance if location is null (#12080)
    
    * [fix] Also auto formatter workflow instance if location is null
    
    In #11535(096fae77) and #11681(4dca488c), we already formatter
    workflow definition, but I find out we forget formatter workflow
    instance with definition's location is null, this patch also
    formatter workflow instance.
    
    * remove console log
    
    (cherry picked from commit 2531c222de5d3707147d9372d391b87b6c1848cd)
---
 .../src/views/projects/workflow/instance/detail/index.tsx      | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx b/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx
index 88992c3c41..95f895c211 100644
--- a/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx
+++ b/dolphinscheduler-ui/src/views/projects/workflow/instance/detail/index.tsx
@@ -33,6 +33,7 @@ import {
   Location
 } from '../../components/dag/types'
 import Styles from './index.module.scss'
+import { useGraphAutoLayout } from '../../components/dag/use-graph-auto-layout'
 
 interface SaveData {
   saveForm: SaveForm
@@ -53,10 +54,18 @@ export default defineComponent({
 
     const definition = ref<WorkflowDefinition>()
     const instance = ref<WorkflowInstance>()
+    const dagInstanceRef = ref()
 
     const refresh = () => {
       queryProcessInstanceById(id, projectCode).then((res: any) => {
         instance.value = res
+        if (!res.dagData.processDefinition.locations) {
+          setTimeout(() => {
+            const graph = dagInstanceRef.value
+            const { submit } = useGraphAutoLayout({ graph })
+            submit()
+          }, 1000)
+        }
         if (res.dagData) {
           definition.value = res.dagData
         }
@@ -109,6 +118,7 @@ export default defineComponent({
         ]}
       >
         <Dag
+          ref={dagInstanceRef}
           instance={instance.value}
           definition={definition.value}
           onRefresh={refresh}