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


##########
config-ui/src/components/blueprints/transformations/CICD/Deployment.jsx:
##########
@@ -40,17 +40,25 @@ const Deployment = (props) => {
   useEffect(() => {
     setSelectValue(
       transformation?.deploymentPattern ||
-        transformation?.deploymentPattern === ''
+        transformation?.deploymentPattern === '' ||
+        transformation?.productionPattern ||
+        transformation?.productionPattern === ''
         ? 1
         : 0
     )
-  }, [transformation?.deploymentPattern])
+  }, [transformation?.deploymentPattern, transformation?.productionPattern])
 
   const handleChangeSelectValue = (sv) => {
     if (entityIdKey && sv === 0) {
-      onSettingsChange({ deploymentPattern: undefined }, entityIdKey)
+      onSettingsChange(
+        { deploymentPattern: undefined, productionPattern: undefined },

Review Comment:
   Alternatively, we could use `onSettingsChange` to create an unofficial prop 
in the transform object that is not directly bound to an input component, for 
the configured entity, called `useDeployment` that is a boolean or something, 
that you could even set to `undefined`. This way we can check 
`transformation?.useDeployment` to dictate the _selected_ state of the radio 
element.
   
   If this field is useful to the backend as well, we could make it a formal 
property in the default transformations init setup.



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