likyh commented on code in PR #3496:
URL:
https://github.com/apache/incubator-devlake/pull/3496#discussion_r1013022150
##########
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:
Yes. I test that situation. I have a blueprint with 4 plugins and 2 scopes.
Each plugin have a scope with all transformation and another scope without any
transformation. They can display, edit and submit success.

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