Browse Source

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

3.0.0/version-upgrade
Amy0104 3 years ago committed by GitHub
parent
commit
e17c2bb56a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx
  2. 41
      dolphinscheduler-ui-next/src/views/projects/task/constants/task-type.ts

14
dolphinscheduler-ui-next/src/views/projects/task/components/node/detail-modal.tsx

@ -36,6 +36,7 @@ import {
QuestionCircleTwotone QuestionCircleTwotone
} from '@vicons/antd' } from '@vicons/antd'
import { NIcon } from 'naive-ui' import { NIcon } from 'naive-ui'
import { TASK_TYPES_MAP } from '../../constants/task-type'
import { Router, useRouter } from 'vue-router' import { Router, useRouter } from 'vue-router'
import { IWorkflowTaskInstance } from '@/views/projects/workflow/components/dag/types' import { IWorkflowTaskInstance } from '@/views/projects/workflow/components/dag/types'
@ -103,20 +104,20 @@ const NodeDetailModal = defineComponent({
} }
} }
const initHeaderLinks = ( const initHeaderLinks = (processInstance: any, taskType?: ITaskType) => {
processInstance: any,
taskType: ITaskType | undefined
) => {
headerLinks.value = [ headerLinks.value = [
{ {
text: t('project.node.instructions'), text: t('project.node.instructions'),
show: taskType ? true : false, show:
taskType && !TASK_TYPES_MAP[taskType]?.helperLinkDisable
? true
: false,
action: () => { action: () => {
const helpUrl = const helpUrl =
'https://dolphinscheduler.apache.org/' + 'https://dolphinscheduler.apache.org/' +
locale.value.toLowerCase().replace('_', '-') + locale.value.toLowerCase().replace('_', '-') +
'/docs/latest/user_doc/guide/task/' + '/docs/latest/user_doc/guide/task/' +
taskType?.toLowerCase() + taskType?.toLowerCase().replace('_', '-') +
'.html' '.html'
window.open(helpUrl) window.open(helpUrl)
}, },
@ -147,6 +148,7 @@ const NodeDetailModal = defineComponent({
const onTaskTypeChange = (taskType: ITaskType) => { const onTaskTypeChange = (taskType: ITaskType) => {
// eslint-disable-next-line vue/no-mutating-props // eslint-disable-next-line vue/no-mutating-props
props.data.taskType = taskType props.data.taskType = taskType
initHeaderLinks(props.processInstance, props.data.taskType)
} }
provide( provide(

41
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 * See the License for the specific language governing permissions and
* limitations under the License. * 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 = { export const TASK_TYPES_MAP = {
SHELL: { SHELL: {
@ -23,7 +42,8 @@ export const TASK_TYPES_MAP = {
alias: 'SUB_PROCESS' alias: 'SUB_PROCESS'
}, },
PROCEDURE: { PROCEDURE: {
alias: 'PROCEDURE' alias: 'PROCEDURE',
helperLinkDisable: true
}, },
SQL: { SQL: {
alias: 'SQL' alias: 'SQL'
@ -35,7 +55,8 @@ export const TASK_TYPES_MAP = {
alias: 'FLINK' alias: 'FLINK'
}, },
MR: { MR: {
alias: 'MapReduce' alias: 'MapReduce',
helperLinkDisable: true
}, },
PYTHON: { PYTHON: {
alias: 'PYTHON' alias: 'PYTHON'
@ -53,23 +74,25 @@ export const TASK_TYPES_MAP = {
alias: 'PIGEON' alias: 'PIGEON'
}, },
SQOOP: { SQOOP: {
alias: 'SQOOP' alias: 'SQOOP',
helperLinkDisable: true
}, },
CONDITIONS: { CONDITIONS: {
alias: 'CONDITIONS' alias: 'CONDITIONS'
}, },
DATA_QUALITY: { DATA_QUALITY: {
alias: 'DATA_QUALITY' alias: 'DATA_QUALITY',
helperLinkDisable: true
}, },
SWITCH: { SWITCH: {
alias: 'SWITCH' alias: 'SWITCH'
}, },
SEATUNNEL: { SEATUNNEL: {
alias: 'WATERDROP' alias: 'WATERDROP',
helperLinkDisable: true
}, },
EMR: { EMR: {
alias: 'AmazonEMR' alias: 'AmazonEMR',
helperLinkDisable: true
} }
} } as { [key in TaskType]: { alias: string; helperLinkDisable?: boolean } }
export type TaskType = keyof typeof TASK_TYPES_MAP

Loading…
Cancel
Save