Skip to content

Commit 6c5af9c

Browse files
authored
[Improvement-17957][UI] Improvement of Spark parameters validation (#17958)
1 parent e355cc1 commit 6c5af9c

3 files changed

Lines changed: 6 additions & 19 deletions

File tree

‎dolphinscheduler-ui/src/locales/en_US/project.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export default {
437437
script: 'Script',
438438
script_tips: 'Please enter script(required)',
439439
master: 'Master',
440-
master_tips: 'Please enter master url(required)',
440+
master_tips: 'Please enter master url(optional)',
441441
init_script: 'Initialization script',
442442
init_script_tips: 'Please enter initialization script',
443443
resources: 'Resources',
@@ -462,7 +462,7 @@ export default {
462462
pre_tasks: 'Pre tasks',
463463
program_type: 'Program Type',
464464
main_class: 'Main Class Name',
465-
main_class_tips: 'Please enter the full main class name (optional)',
465+
main_class_tips: 'Please enter the full main class name (required)',
466466
main_class_invalid: 'Invalid main class name',
467467
main_package: 'Main Package',
468468
main_package_tips: 'Please enter main package',

‎dolphinscheduler-ui/src/locales/zh_CN/project.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ export default {
425425
script: '脚本',
426426
script_tips: '请输入脚本(必填)',
427427
master: 'Master',
428-
master_tips: '请输入master url(必填)',
428+
master_tips: '请输入master url(选填)',
429429
init_script: '初始化脚本',
430430
init_script_tips: '请输入初始化脚本',
431431
resources: '资源',
@@ -449,7 +449,7 @@ export default {
449449
pre_tasks: '前置任务',
450450
program_type: '程序类型',
451451
main_class: '主类名',
452-
main_class_tips: '请填写完整主类名(可选)',
452+
main_class_tips: '请填写完整主类名(必填)',
453453
main_class_invalid: '主类名不合法',
454454
main_package: '主程序包',
455455
main_package_tips: '请选择主程序包',

‎dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-spark.ts‎

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,6 @@ export function useSpark(model: { [field: string]: any }): IJsonItem[] {
3737
model.programType === 'PYTHON' || model.programType === 'SQL' ? 0 : 24
3838
)
3939

40-
const masterSpan = computed(() =>
41-
model.programType === 'PYTHON' || model.programType === 'SQL' ? 0 : 24
42-
)
43-
4440
const mainArgsSpan = computed(() => (model.programType === 'SQL' ? 0 : 24))
4541

4642
const rawScriptSpan = computed(() =>
@@ -145,23 +141,14 @@ export function useSpark(model: { [field: string]: any }): IJsonItem[] {
145141
{
146142
type: 'input',
147143
field: 'master',
148-
span: masterSpan,
144+
span: 24,
149145
name: t('project.node.master'),
150146
props: {
151147
placeholder: t('project.node.master_tips')
152148
},
153149
validate: {
154150
trigger: ['input', 'blur'],
155-
required: false,
156-
validator(validate: any, value: string) {
157-
if (
158-
model.programType !== 'PYTHON' &&
159-
!value &&
160-
model.programType !== 'SQL'
161-
) {
162-
return new Error(t('project.node.master_tips'))
163-
}
164-
}
151+
required: false
165152
}
166153
},
167154
useDeployMode(24, ref(true), showCluster),

0 commit comments

Comments
 (0)