likyh commented on code in PR #3496:
URL:
https://github.com/apache/incubator-devlake/pull/3496#discussion_r1013006336
##########
config-ui/src/components/blueprints/create-workflow/DataScopes.jsx:
##########
@@ -67,22 +65,20 @@ const DataScopes = (props) => {
cardStyle = {}
} = props
- const selectedBoards = useMemo(
- () => boards[configuredConnection.id],
- [boards, configuredConnection?.id]
+ const selectedScopeEntities = useMemo(
+ () => scopeEntitiesGroup[configuredConnection.id],
+ [scopeEntitiesGroup, configuredConnection?.id]
)
- const selectedProjects = useMemo(
- () => projects[configuredConnection.id],
- [projects, configuredConnection?.id]
- )
-
- useEffect(() => {
- console.log('>> OVER HERE!!!', selectedBoards)
- }, [selectedBoards])
- useEffect(() => {
- console.log('>> OVER HERE FOR Projects!!!', selectedProjects)
- }, [selectedProjects])
+ const setScopeEntities = useCallback(
+ (scopeEntities) => {
+ setScopeEntitiesGroup((g) => ({
+ ...g,
+ [configuredConnection.id]: scopeEntities
Review Comment:
Emm, `configuredConnection.id` is index instead of `connection.id`. So I
haven't found it.
https://github.com/apache/incubator-devlake/blob/3b24e450ed2a56d905b6b66c11e520894d47ea10/config-ui/src/hooks/useConnectionManager.jsx#L622-L628
I also think it's not a good practice. Let's tidy up these models in next
refactor PR. (next milestone)
--
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]