e2corporation commented on code in PR #3371:
URL: https://github.com/apache/incubator-devlake/pull/3371#discussion_r992480786


##########
config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx:
##########
@@ -49,16 +48,13 @@ const Deployment = (props) => {
   }, [transformation?.deploymentPattern, transformation?.productionPattern])
 
   const handleChangeSelectValue = (sv) => {
-    if (entityIdKey && sv === 0) {
-      onSettingsChange(
-        { deploymentPattern: undefined, productionPattern: undefined },
-        entityIdKey
-      )
-    } else if (entityIdKey && sv === 1) {
-      onSettingsChange(
-        { deploymentPattern: '', productionPattern: '' },
-        entityIdKey
-      )
+    if (sv === 0) {
+      onSettingsChange({
+        deploymentPattern: undefined,

Review Comment:
   This practice of using `undefined` as a state value is not ideal and breaks 
principles of React **Controlled** Form Inputs. This area is what needs 
refactoring under this ticket 
https://github.com/apache/incubator-devlake/issues/3357



-- 
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