Browse Source

[Bug][UI Next]Fix global variable validation condition for save button in workflow definition. (#9454)

3.0.0/version-upgrade
labbomb 3 years ago committed by GitHub
parent
commit
8440baa5e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx

11
dolphinscheduler-ui-next/src/views/projects/workflow/components/dag/dag-save-modal.tsx

@ -114,16 +114,19 @@ export default defineComponent({
globalParams: {
validator() {
const props = new Set()
const keys = formValue.value.globalParams.map(item => item.key)
const keysSet = new Set(keys)
if (keysSet.size !== keys.length) {
return new Error(t('project.dag.prop_repeat'))
}
for (const param of formValue.value.globalParams) {
const prop = param.value
if (!prop) {
return new Error(t('project.dag.prop_empty'))
}
if (props.has(prop)) {
return new Error(t('project.dag.prop_repeat'))
}
props.add(prop)
}
}

Loading…
Cancel
Save