🐛 (editor) Fix AB test items not connectable
This commit is contained in:
@ -6,9 +6,10 @@ import { defaultAbTestOptions } from '@typebot.io/schemas/features/blocks/logic/
|
||||
|
||||
type Props = {
|
||||
block: AbTestBlock
|
||||
groupId: string
|
||||
}
|
||||
|
||||
export const AbTestNodeBody = ({ block }: Props) => {
|
||||
export const AbTestNodeBody = ({ block, groupId }: Props) => {
|
||||
const borderColor = useColorModeValue('gray.200', 'gray.700')
|
||||
const bg = useColorModeValue('white', undefined)
|
||||
|
||||
@ -33,6 +34,7 @@ export const AbTestNodeBody = ({ block }: Props) => {
|
||||
blockId: block.id,
|
||||
itemId: block.items[0].id,
|
||||
}}
|
||||
groupId={groupId}
|
||||
pos="absolute"
|
||||
right="-49px"
|
||||
pointerEvents="all"
|
||||
@ -59,6 +61,7 @@ export const AbTestNodeBody = ({ block }: Props) => {
|
||||
blockId: block.id,
|
||||
itemId: block.items[1].id,
|
||||
}}
|
||||
groupId={groupId}
|
||||
pos="absolute"
|
||||
right="-49px"
|
||||
pointerEvents="all"
|
||||
|
@ -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