Browse Source

[ISSUE 6444]Optimize task node helper document in workflow toolbar (#7226)

* [ISSUE 6444]Optimize task node helper document in workflow toolbar

* fix some review issue than submit by DS

* refact by add guard judgement when type is undefined

* move method helpUrlEnable and helpUrl nest in 'methods' body
3.0.0/version-upgrade
百岁 3 years ago committed by GitHub
parent
commit
f21eb8f9fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 12
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js
  2. 5
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.scss
  3. 19
      dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue
  4. 2
      dolphinscheduler-ui/src/js/module/i18n/config.js

12
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/config.js

@ -280,7 +280,8 @@ const tasksType = {
}, },
PROCEDURE: { PROCEDURE: {
desc: 'PROCEDURE', desc: 'PROCEDURE',
color: '#525CCD' color: '#525CCD',
helperLinkDisable: true
}, },
SQL: { SQL: {
desc: 'SQL', desc: 'SQL',
@ -296,7 +297,8 @@ const tasksType = {
}, },
MR: { MR: {
desc: 'MapReduce', desc: 'MapReduce',
color: '#A0A5CC' color: '#A0A5CC',
helperLinkDisable: true
}, },
PYTHON: { PYTHON: {
desc: 'PYTHON', desc: 'PYTHON',
@ -320,7 +322,8 @@ const tasksType = {
}, },
SQOOP: { SQOOP: {
desc: 'SQOOP', desc: 'SQOOP',
color: '#E46F13' color: '#E46F13',
helperLinkDisable: true
}, },
CONDITIONS: { CONDITIONS: {
desc: 'CONDITIONS', desc: 'CONDITIONS',
@ -332,7 +335,8 @@ const tasksType = {
}, },
WATERDROP: { WATERDROP: {
desc: 'WATERDROP', desc: 'WATERDROP',
color: '#646465' color: '#646465',
helperLinkDisable: true
} }
} }

5
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.scss

@ -27,6 +27,11 @@
left: 24px; left: 24px;
top: 18px; top: 18px;
font-size: 16px; font-size: 16px;
.helper-link {
font-size: 12px;
display: inline-block;
margin-left: 10px;
}
} }
.go-subtask { .go-subtask {
position: absolute; position: absolute;

19
dolphinscheduler-ui/src/js/conf/home/pages/dag/_source/formModel/formModel.vue

@ -17,7 +17,12 @@
<template> <template>
<div class="form-model-wrapper" v-clickoutside="_handleClose"> <div class="form-model-wrapper" v-clickoutside="_handleClose">
<div class="title-box"> <div class="title-box">
<span class="name">{{ $t("Current node settings") }}</span> <span class="name">{{ $t("Current node settings") }}
<a v-if="helpUrlEnable(nodeData.taskType)" class="helper-link" target="_blank"
:href="helpUrl(nodeData.taskType)">
<i class="el-icon-question" />
{{nodeData.taskType}} {{ $t('Instructions') }}</a>
</span>
<span class="go-subtask"> <span class="go-subtask">
<!-- Component can't pop up box to do component processing --> <!-- Component can't pop up box to do component processing -->
<m-log <m-log
@ -452,6 +457,7 @@
import mMr from './tasks/mr' import mMr from './tasks/mr'
import mSql from './tasks/sql' import mSql from './tasks/sql'
import i18n from '@/module/i18n' import i18n from '@/module/i18n'
import { findLocale } from '@/module/i18n/config'
import mListBox from './tasks/_source/listBox' import mListBox from './tasks/_source/listBox'
import mShell from './tasks/shell' import mShell from './tasks/shell'
import mWaterdrop from './tasks/waterdrop' import mWaterdrop from './tasks/waterdrop'
@ -574,6 +580,17 @@
inject: ['dagChart'], inject: ['dagChart'],
methods: { methods: {
...mapActions('dag', ['getTaskInstanceList']), ...mapActions('dag', ['getTaskInstanceList']),
helpUrlEnable (typekey) {
const type = tasksType[typekey]
if (!type) return false
if (!type.helperLinkDisable) return true
return !type.helperLinkDisable
},
helpUrl (tasktype) {
return 'https://dolphinscheduler.apache.org/' +
findLocale(i18n.globalScope.LOCALE).helperContext +
'/docs/latest/user_doc/guide/task/' + tasktype.toLowerCase() + '.html'
},
taskToBackfillItem (task) { taskToBackfillItem (task) {
return { return {
code: task.code, code: task.code,

2
dolphinscheduler-ui/src/js/module/i18n/config.js

@ -23,11 +23,13 @@ import en_US from './locale/en_US'
export function localeList () { export function localeList () {
return [ return [
{ {
helperContext:'zh-cn',
code: 'zh_CN', code: 'zh_CN',
name: '中文', name: '中文',
locale: zh_CN locale: zh_CN
}, },
{ {
helperContext:'en-us',
code: 'en_US', code: 'en_US',
name: 'English', name: 'English',
locale: en_US locale: en_US

Loading…
Cancel
Save