You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by so...@apache.org on 2022/03/16 06:17:11 UTC

[dolphinscheduler] branch dev updated: [Fix][UI Next][V1.0.0-Alpha] Fix the instructions links error in task editor modal. (#8924)

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

songjian 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 e17c2bb  [Fix][UI Next][V1.0.0-Alpha] Fix the instructions links error in task editor modal. (#8924)
e17c2bb is described below

commit e17c2bb56a0c844cd9760518ef3fe2505d0491c0
Author: Amy0104 <97...@users.noreply.github.com>
AuthorDate: Wed Mar 16 14:17:00 2022 +0800

    [Fix][UI Next][V1.0.0-Alpha] Fix the instructions links error in task editor modal. (#8924)
---
 .../projects/task/components/node/detail-modal.tsx | 14 ++++----
 .../src/views/projects/task/constants/task-type.ts | 41 +++++++++++++++++-----
 2 files changed, 40 insertions(+), 15 deletions(-)

diff --git a/dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx
index f15e506..456d00d 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx
+++ b/dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx
@@ -36,6 +36,7 @@ import {
   QuestionCircleTwotone
 } from '@vicons/antd'
 import { NIcon } from 'naive-ui'
+import { TASK_TYPES_MAP } from '../../constants/task-type'
 import { Router, useRouter } from 'vue-router'
 import { IWorkflowTaskInstance } from '@/views/projects/workflow/components/dag/types'
 
@@ -103,20 +104,20 @@ const NodeDetailModal = defineComponent({
       }
     }
 
-    const initHeaderLinks = (
-      processInstance: any,
-      taskType: ITaskType | undefined
-    ) => {
+    const initHeaderLinks = (processInstance: any, taskType?: ITaskType) => {
       headerLinks.value = [
         {
           text: t('project.node.instructions'),
-          show: taskType ? true : false,
+          show:
+            taskType && !TASK_TYPES_MAP[taskType]?.helperLinkDisable
+              ? true
+              : false,
           action: () => {
             const helpUrl =
               'https://dolphinscheduler.apache.org/' +
               locale.value.toLowerCase().replace('_', '-') +
               '/docs/latest/user_doc/guide/task/' +
-              taskType?.toLowerCase() +
+              taskType?.toLowerCase().replace('_', '-') +
               '.html'
             window.open(helpUrl)
           },
@@ -147,6 +148,7 @@ const NodeDetailModal = defineComponent({
     const onTaskTypeChange = (taskType: ITaskType) => {
       // eslint-disable-next-line vue/no-mutating-props
       props.data.taskType = taskType
+      initHeaderLinks(props.processInstance, props.data.taskType)
     }
 
     provide(
diff --git a/dolphinscheduler-ui-next/src/views/projects/task/constants/task-type.ts b/dolphinscheduler-ui-next/src/views/projects/task/constants/task-type.ts
index 632e67e..c9a76e8 100644
--- a/dolphinscheduler-ui-next/src/views/projects/task/constants/task-type.ts
+++ b/dolphinscheduler-ui-next/src/views/projects/task/constants/task-type.ts
@@ -14,6 +14,25 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
+export type TaskType =
+  | 'SHELL'
+  | 'SUB_PROCESS'
+  | 'PROCEDURE'
+  | 'SQL'
+  | 'SPARK'
+  | 'FLINK'
+  | 'MR'
+  | 'PYTHON'
+  | 'DEPENDENT'
+  | 'HTTP'
+  | 'DATAX'
+  | 'PIGEON'
+  | 'SQOOP'
+  | 'CONDITIONS'
+  | 'DATA_QUALITY'
+  | 'SWITCH'
+  | 'SEATUNNEL'
+  | 'EMR'
 
 export const TASK_TYPES_MAP = {
   SHELL: {
@@ -23,7 +42,8 @@ export const TASK_TYPES_MAP = {
     alias: 'SUB_PROCESS'
   },
   PROCEDURE: {
-    alias: 'PROCEDURE'
+    alias: 'PROCEDURE',
+    helperLinkDisable: true
   },
   SQL: {
     alias: 'SQL'
@@ -35,7 +55,8 @@ export const TASK_TYPES_MAP = {
     alias: 'FLINK'
   },
   MR: {
-    alias: 'MapReduce'
+    alias: 'MapReduce',
+    helperLinkDisable: true
   },
   PYTHON: {
     alias: 'PYTHON'
@@ -53,23 +74,25 @@ export const TASK_TYPES_MAP = {
     alias: 'PIGEON'
   },
   SQOOP: {
-    alias: 'SQOOP'
+    alias: 'SQOOP',
+    helperLinkDisable: true
   },
   CONDITIONS: {
     alias: 'CONDITIONS'
   },
   DATA_QUALITY: {
-    alias: 'DATA_QUALITY'
+    alias: 'DATA_QUALITY',
+    helperLinkDisable: true
   },
   SWITCH: {
     alias: 'SWITCH'
   },
   SEATUNNEL: {
-    alias: 'WATERDROP'
+    alias: 'WATERDROP',
+    helperLinkDisable: true
   },
   EMR: {
-    alias: 'AmazonEMR'
+    alias: 'AmazonEMR',
+    helperLinkDisable: true
   }
-}
-
-export type TaskType = keyof typeof TASK_TYPES_MAP
+} as { [key in TaskType]: { alias: string; helperLinkDisable?: boolean } }