-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
28 changed files
with
443 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
apps/builder/src/features/blocks/logic/abTest/abTest.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import test, { expect } from '@playwright/test' | ||
import { importTypebotInDatabase } from '@typebot.io/lib/playwright/databaseActions' | ||
import { createId } from '@paralleldrive/cuid2' | ||
import { getTestAsset } from '@/test/utils/playwright' | ||
|
||
const typebotId = createId() | ||
|
||
test.describe('AB Test block', () => { | ||
test('its configuration should work', async ({ page }) => { | ||
await importTypebotInDatabase(getTestAsset('typebots/logic/abTest.json'), { | ||
id: typebotId, | ||
}) | ||
|
||
await page.goto(`/typebots/${typebotId}/edit`) | ||
await page.getByText('A 50%').click() | ||
await page.getByLabel('Percent of users to follow A:').fill('100') | ||
await expect(page.getByText('A 100%')).toBeVisible() | ||
await expect(page.getByText('B 0%')).toBeVisible() | ||
await page.getByRole('button', { name: 'Preview' }).click() | ||
await expect( | ||
page.locator('typebot-standard').getByText('How are you?') | ||
).toBeVisible() | ||
}) | ||
}) |
7 changes: 7 additions & 0 deletions
7
apps/builder/src/features/blocks/logic/abTest/components/AbTestIcon.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import { ShuffleIcon } from '@/components/icons' | ||
import { IconProps } from '@chakra-ui/react' | ||
import React from 'react' | ||
|
||
export const AbTestIcon = (props: IconProps) => ( | ||
<ShuffleIcon color="purple.500" {...props} /> | ||
) |
66 changes: 66 additions & 0 deletions
66
apps/builder/src/features/blocks/logic/abTest/components/AbTestNodeBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
import React from 'react' | ||
import { Flex, Stack, useColorModeValue, Text, Tag } from '@chakra-ui/react' | ||
import { AbTestBlock } from '@typebot.io/schemas' | ||
import { SourceEndpoint } from '@/features/graph/components/endpoints/SourceEndpoint' | ||
|
||
type Props = { | ||
block: AbTestBlock | ||
} | ||
|
||
export const AbTestNodeBody = ({ block }: Props) => { | ||
const borderColor = useColorModeValue('gray.200', 'gray.700') | ||
const bg = useColorModeValue('white', undefined) | ||
|
||
return ( | ||
<Stack spacing={2} w="full"> | ||
<Flex | ||
pos="relative" | ||
align="center" | ||
shadow="sm" | ||
rounded="md" | ||
bg={bg} | ||
borderWidth={'1px'} | ||
borderColor={borderColor} | ||
w="full" | ||
> | ||
<Text p="3"> | ||
A <Tag>{block.options.aPercent}%</Tag> | ||
</Text> | ||
<SourceEndpoint | ||
source={{ | ||
groupId: block.groupId, | ||
blockId: block.id, | ||
itemId: block.items[0].id, | ||
}} | ||
pos="absolute" | ||
right="-49px" | ||
pointerEvents="all" | ||
/> | ||
</Flex> | ||
<Flex | ||
pos="relative" | ||
align="center" | ||
shadow="sm" | ||
rounded="md" | ||
bg={bg} | ||
borderWidth={'1px'} | ||
borderColor={borderColor} | ||
w="full" | ||
> | ||
<Text p="3"> | ||
B <Tag>{100 - block.options.aPercent}%</Tag> | ||
</Text> | ||
<SourceEndpoint | ||
source={{ | ||
groupId: block.groupId, | ||
blockId: block.id, | ||
itemId: block.items[1].id, | ||
}} | ||
pos="absolute" | ||
right="-49px" | ||
pointerEvents="all" | ||
/> | ||
</Flex> | ||
</Stack> | ||
) | ||
} |
29 changes: 29 additions & 0 deletions
29
apps/builder/src/features/blocks/logic/abTest/components/AbTestSettings.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Stack } from '@chakra-ui/react' | ||
import React from 'react' | ||
import { isDefined } from '@typebot.io/lib' | ||
import { AbTestBlock } from '@typebot.io/schemas' | ||
import { NumberInput } from '@/components/inputs' | ||
|
||
type Props = { | ||
options: AbTestBlock['options'] | ||
onOptionsChange: (options: AbTestBlock['options']) => void | ||
} | ||
|
||
export const AbTestSettings = ({ options, onOptionsChange }: Props) => { | ||
const updateAPercent = (aPercent?: number) => | ||
isDefined(aPercent) ? onOptionsChange({ ...options, aPercent }) : null | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<NumberInput | ||
defaultValue={options.aPercent} | ||
onValueChange={updateAPercent} | ||
withVariableButton={false} | ||
label="Percent of users to follow A:" | ||
direction="column" | ||
max={100} | ||
min={0} | ||
/> | ||
</Stack> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
7e937e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
docs – ./apps/docs
docs-typebot-io.vercel.app
docs-git-main-typebot-io.vercel.app
docs.typebot.io
7e937e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
landing-page-v2 – ./apps/landing-page
www.typebot.io
typebot.io
landing-page-v2-git-main-typebot-io.vercel.app
www.get-typebot.com
get-typebot.com
landing-page-v2-typebot-io.vercel.app
7e937e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
viewer-v2 – ./apps/viewer
bii.bj
1stop.au
yobot.me
klujo.com
me.cr8.ai
wachat.io
wassep.io
247987.com
8jours.top
aginap.com
ai.mprs.in
bee.cr8.ai
bot.aws.bj
bot.bbc.bj
cat.cr8.ai
finplex.be
nepkit.com
pig.cr8.ai
sat.cr8.ai
wachap.app
wachats.me
wsapio.com
bot.aipr.kr
bot.joof.it
bull.cr8.ai
docs.cr8.ai
minipost.uk
mole.cr8.ai
team.cr8.ai
wolf.cr8.ai
ai.meant.com
bot.grace.bj
cinecorn.com
help.taxt.co
kusamint.com
rhino.cr8.ai
sheep.cr8.ai
snake.cr8.ai
svhm.mprs.in
tiger.cr8.ai
video.cr8.ai
yoda.riku.ai
zebra.cr8.ai
bergamo.store
bot.krdfy.com
bot.tvbeat.it
cgcassets.com
cnvhub.com.br
facelabko.com
filmylogy.com
goldorayo.com
rabbit.cr8.ai
signup.cr8.ai
start.taxt.co
turkey.cr8.ai
vhpage.cr8.ai
vitamyway.com
am.nigerias.io
an.nigerias.io
app.yvon.earth
ar.nigerias.io
bot.enreso.org
bot.rslabs.pro
bots.bridge.ai
chat.hayuri.id
chat.uprize.hu
chatgpt.lam.ee
chicken.cr8.ai
gollum.riku.ai
gsbulletin.com
journey.cr8.ai
panther.cr7.ai
panther.cr8.ai
pay.sifuim.com
penguin.cr8.ai
talk.gocare.io
test.bot.gives
ticketfute.com
unicorn.cr8.ai
apo.nigerias.io
apr.nigerias.io
aso.nigerias.io
blackcan.cr8.ai
bot.4display.nl
bot.ageenda.com
bot.artiweb.app
bot.devitus.com
bot.jesopizz.it
bot.reeplai.com
bot.scayver.com
bot.tc-mail.com
chat.lalmon.com
chat.sureb4.com
eventhub.com.au
fitness.riku.ai
games.klujo.com
wordsandimagery.com
88584434.therpm.club
92109660.therpm.club
abbonamento.bwell.it
7e937e1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
builder-v2 – ./apps/builder
app.typebot.io
builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app