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


##########
config-ui/src/components/blueprints/create-workflow/DataTransformations.jsx:
##########
@@ -93,65 +78,35 @@ const DataTransformations = (props) => {
     () =>
       [Providers.TAPD].includes(configuredConnection?.provider) ||
       ([Providers.GITLAB].includes(configuredConnection?.provider) &&
-        dataEntities[configuredConnection?.id].every(
-          (e) => e.value !== DataEntityTypes.DEVOPS
+        dataDomainsGroup[configuredConnection?.id].every(
+          (e) => e.value !== DataDomainTypes.DEVOPS
         )),
     [
       configuredConnection?.provider,
       configuredConnection?.id,
-      dataEntities,
+      dataDomainsGroup,
       Providers.TAPD,
       Providers.GITLAB
     ]
   )
 
-  const boardsAndProjects = useMemo(
+  const scopeEntities = useMemo(
     () => [
-      ...(Array.isArray(boards[configuredConnection?.id])
-        ? boards[configuredConnection?.id]
-        : []),
-      ...(Array.isArray(projects[configuredConnection?.id])
-        ? projects[configuredConnection?.id]
+      ...(Array.isArray(scopeEntitiesGroup[configuredConnection?.id])
+        ? scopeEntitiesGroup[configuredConnection?.id]
         : [])
     ],
-    [projects, boards, configuredConnection?.id]
+    [scopeEntitiesGroup, configuredConnection?.id]
   )
 
-  const [entityList, setEntityList] = useState(
-    boardsAndProjects?.map((e, eIdx) => ({
-      id: eIdx,
-      value: e?.value,
-      title: e?.title,
-      entity: e,
-      type: e.variant
-    }))
-  )
-  const [activeEntity, setActiveEntity] = useState()
-
-  useEffect(() => {
-    console.log('>>> PROJECT/BOARD SELECT LIST DATA...', entityList)
-    setActiveEntity(Array.isArray(entityList) ? entityList[0] : null)
-  }, [entityList])
-
   useEffect(() => {
+    console.log('>>> SCOPE ENTITIES SELECT LIST DATA...', scopeEntities)
     if (useDropdownSelector) {
-      console.log('>>>>> PROJECT / BOARD ENTITY SELECTED!', activeEntity)
-      switch (activeEntity?.type) {
-        case Variants.BOARD:
-          addBoardTransformation(activeEntity?.entity)
-          break
-        case Variants.PROJECT:
-        default:
-          addProjectTransformation(activeEntity?.entity)
-          break
-      }
+      setConfiguredScopeEntity(
+        Array.isArray(scopeEntities) ? scopeEntities[0] : null

Review Comment:
   If you Edit a blueprint's Data Connection with multiple projects/boards, is 
the project dropdown selector's initial rendering correctly? If so this comment 
can be resolved/dismissed.



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