Amy0104 commented on code in PR #9454:
URL: https://github.com/apache/dolphinscheduler/pull/9454#discussion_r848140233


##########
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) {

Review Comment:
   It seems to be better that one loop is enough.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to