Skip to content

Commit

Permalink
[Bug][UI Next]Fix global variable validation condition for save butto…
Browse files Browse the repository at this point in the history
…n in workflow definition. (#9454)
  • Loading branch information
labbomb authored Apr 12, 2022
1 parent 51c1d8f commit 8440baa
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down

0 comments on commit 8440baa

Please sign in to comment.