You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/07/05 01:27:09 UTC

[GitHub] [dolphinscheduler] rockfang commented on a diff in pull request #10731: [Fix-10730][UI] fix bug where the environment name not works well

rockfang commented on code in PR #10731:
URL: https://github.com/apache/dolphinscheduler/pull/10731#discussion_r913319432


##########
dolphinscheduler-ui/src/views/projects/task/components/node/fields/use-environment-name.ts:
##########
@@ -54,23 +53,20 @@ export function useEnvironmentName(
     return option.workerGroups.indexOf(model.workerGroup) !== -1
   }
 
-  watch(
-    () => options.value.length,
-    () => {
-      if (isCreate && options.value.length === 1 && !value.value) {
-        model.environmentCode = options.value[0].value
-      }
-      if (options.value.length === 0) model.environmentCode = null
-    }
-  )
-
   watch(
     () => model.workerGroup,
     () => {
       if (!model.workerGroup) return
       options.value = environmentList.filter((option: IEnvironmentNameOption) =>
         filterByWorkerGroup(option)
       )
+      // default environmentCode changing when workerGroup changed.
+      // if options only one. set the one as default.
+      if (options.value.length === 1) {
+        model.environmentCode = options.value[0].value
+      } else {
+        model.environmentCode = null
+      }

Review Comment:
   got it. I will try to fix it later.



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org