🐛 (editor) Fix AB test items not connectable
This commit is contained in:
@@ -25,7 +25,7 @@ export const BlockSourceEndpoint = ({
|
||||
...props
|
||||
}: BoxProps & {
|
||||
source: BlockSource
|
||||
groupId?: string
|
||||
groupId: string
|
||||
isHidden?: boolean
|
||||
}) => {
|
||||
const id = source.itemId ?? source.blockId
|
||||
|
||||
@@ -239,7 +239,13 @@ export const BlockNode = ({
|
||||
mt="1"
|
||||
data-testid={`${block.id}-icon`}
|
||||
/>
|
||||
<BlockNodeContent block={block} indices={indices} />
|
||||
{typebot?.groups[indices.groupIndex].id && (
|
||||
<BlockNodeContent
|
||||
block={block}
|
||||
indices={indices}
|
||||
groupId={typebot.groups[indices.groupIndex].id}
|
||||
/>
|
||||
)}
|
||||
{(hasIcomingEdge || isDefined(connectingIds)) && (
|
||||
<TargetEndpoint
|
||||
pos="absolute"
|
||||
@@ -252,6 +258,7 @@ export const BlockNode = ({
|
||||
{(isConnectable ||
|
||||
(pathname.endsWith('analytics') && isInputBlock(block))) &&
|
||||
hasDefaultConnector(block) &&
|
||||
groupId &&
|
||||
block.type !== LogicBlockType.JUMP && (
|
||||
<BlockSourceEndpoint
|
||||
source={{
|
||||
|
||||
@@ -41,9 +41,14 @@ import { IntegrationBlockType } from '@typebot.io/schemas/features/blocks/integr
|
||||
|
||||
type Props = {
|
||||
block: BlockV6
|
||||
groupId: string
|
||||
indices: BlockIndices
|
||||
}
|
||||
export const BlockNodeContent = ({ block, indices }: Props): JSX.Element => {
|
||||
export const BlockNodeContent = ({
|
||||
block,
|
||||
indices,
|
||||
groupId,
|
||||
}: Props): JSX.Element => {
|
||||
switch (block.type) {
|
||||
case BubbleBlockType.TEXT: {
|
||||
return <TextBubbleContent block={block} />
|
||||
@@ -109,7 +114,7 @@ export const BlockNodeContent = ({ block, indices }: Props): JSX.Element => {
|
||||
return <JumpNodeBody options={block.options} />
|
||||
}
|
||||
case LogicBlockType.AB_TEST: {
|
||||
return <AbTestNodeBody block={block} />
|
||||
return <AbTestNodeBody block={block} groupId={groupId} />
|
||||
}
|
||||
case LogicBlockType.TYPEBOT_LINK:
|
||||
return <TypebotLinkNode block={block} />
|
||||
|
||||
@@ -22,7 +22,7 @@ export const BlockNodeOverlay = ({
|
||||
{...props}
|
||||
>
|
||||
<BlockIcon type={block.type} />
|
||||
<BlockNodeContent block={block} indices={indices} />
|
||||
<BlockNodeContent block={block} indices={indices} groupId="" />
|
||||
</HStack>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user