Skip to content

Commit 8d62898

Browse files
committed
Merge branch 'main' into internal/add-vercel-functions-whatsapp-webhook
2 parents c45ea00 + 75cd141 commit 8d62898

File tree

77 files changed

+2338
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

77 files changed

+2338
-630
lines changed

.env.dev.example

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# Make sure to change this to your own random string of 32 characters (https://docs.typebot.io/self-hosting/docker#2-add-the-required-configuration)
21
ENCRYPTION_SECRET=H+KbL/OFrqbEuDy/1zX8bsPG+spXri3S
32

43
DATABASE_URL=postgresql://postgres:typebot@localhost:5432/typebot

.vscode/settings.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
"editor.tabSize": 2,
1313
"typescript.updateImportsOnFileMove.enabled": "always",
1414
"playwright.env": {
15-
"DATABASE_URL": "postgresql://postgres:typebot@localhost:5432/typebot",
15+
"DATABASE_URL": "postgresql://postgres:typebot@127.0.0.1:5432/typebot",
1616
"NEXT_PUBLIC_VIEWER_URL": "http://localhost:3001",
17-
"NEXTAUTH_URL": "http://localhost:3000"
17+
"NEXTAUTH_URL": "http://localhost:3000",
18+
"ENCRYPTION_SECRET": "H+KbL/OFrqbEuDy/1zX8bsPG+spXri3S"
1819
},
1920
"[prisma]": {
2021
"editor.defaultFormatter": "Prisma.prisma"

apps/builder/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"format:check": "prettier --check ./src --ignore-path ../../.prettierignore"
1414
},
1515
"dependencies": {
16+
"@typebot.io/theme": "workspace:*",
1617
"@braintree/sanitize-url": "7.0.1",
1718
"@chakra-ui/anatomy": "2.1.1",
1819
"@chakra-ui/react": "2.7.1",

apps/builder/src/components/ColorPicker.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,16 @@ const colorsSelection: `#${string}`[] = [
3535
type Props = {
3636
value?: string
3737
defaultValue?: string
38+
isDisabled?: boolean
3839
onColorChange: (color: string) => void
3940
}
4041

41-
export const ColorPicker = ({ value, defaultValue, onColorChange }: Props) => {
42+
export const ColorPicker = ({
43+
value,
44+
defaultValue,
45+
isDisabled,
46+
onColorChange,
47+
}: Props) => {
4248
const { t } = useTranslate()
4349
const [color, setColor] = useState(defaultValue ?? '')
4450
const displayedValue = value ?? color
@@ -63,6 +69,7 @@ export const ColorPicker = ({ value, defaultValue, onColorChange }: Props) => {
6369
padding={0}
6470
borderRadius={3}
6571
borderWidth={1}
72+
isDisabled={isDisabled}
6673
>
6774
<Box rounded="full" boxSize="14px" bgColor={displayedValue} />
6875
</Button>

apps/builder/src/components/ImageUploadContent/UnsplashPicker.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ export const UnsplashPicker = ({ imageSize, onImageSelect }: Props) => {
141141
fetchNewImages(query, 0)
142142
}}
143143
withVariableButton={false}
144+
debounceTimeout={500}
145+
forceDebounce
144146
/>
145147
<Link
146148
isExternal

apps/builder/src/components/inputs/TextInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { env } from '@typebot.io/env'
2424
import { MoreInfoTooltip } from '../MoreInfoTooltip'
2525

2626
export type TextInputProps = {
27+
forceDebounce?: boolean
2728
defaultValue?: string
2829
onChange?: (value: string) => void
2930
debounceTimeout?: number
@@ -62,6 +63,7 @@ export const TextInput = forwardRef(function TextInput(
6263
autoComplete,
6364
isDisabled,
6465
autoFocus,
66+
forceDebounce,
6567
onChange: _onChange,
6668
onFocus,
6769
onKeyUp,
@@ -83,7 +85,7 @@ export const TextInput = forwardRef(function TextInput(
8385
const onChange = useDebouncedCallback(
8486
// eslint-disable-next-line @typescript-eslint/no-empty-function
8587
_onChange ?? (() => {}),
86-
env.NEXT_PUBLIC_E2E_TEST ? 0 : debounceTimeout
88+
env.NEXT_PUBLIC_E2E_TEST && !forceDebounce ? 0 : debounceTimeout
8789
)
8890

8991
useEffect(() => {
Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Text } from '@chakra-ui/react'
22
import { useTranslate } from '@tolgee/react'
33
import { PaymentInputBlock } from '@typebot.io/schemas'
4+
import { defaultPaymentInputOptions } from '@typebot.io/schemas/features/blocks/inputs/payment/constants'
45

56
type Props = {
67
block: PaymentInputBlock
@@ -9,11 +10,7 @@ type Props = {
910
export const PaymentInputContent = ({ block }: Props) => {
1011
const { t } = useTranslate()
1112

12-
if (
13-
!block.options?.amount ||
14-
!block.options.credentialsId ||
15-
!block.options.currency
16-
)
13+
if (!block.options?.amount || !block.options.credentialsId)
1714
return (
1815
<Text color="gray.500">
1916
{t('blocks.inputs.payment.placeholder.label')}
@@ -22,7 +19,7 @@ export const PaymentInputContent = ({ block }: Props) => {
2219
return (
2320
<Text noOfLines={1} pr="6">
2421
{t('blocks.inputs.payment.collect.label')} {block.options.amount}{' '}
25-
{block.options.currency}
22+
{block.options.currency ?? defaultPaymentInputOptions.currency}
2623
</Text>
2724
)
2825
}

apps/builder/src/features/blocks/inputs/payment/components/StripeConfigModal.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ export const StripeConfigModal = ({
163163
placeholder="sk_test_..."
164164
withVariableButton={false}
165165
debounceTimeout={0}
166+
type="password"
166167
/>
167168
</HStack>
168169
</Stack>
@@ -187,6 +188,7 @@ export const StripeConfigModal = ({
187188
placeholder="sk_live_..."
188189
withVariableButton={false}
189190
debounceTimeout={0}
191+
type="password"
190192
/>
191193
</FormControl>
192194
</HStack>

apps/builder/src/features/blocks/inputs/phone/components/CountryCodeSelect.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export const CountryCodeSelect = ({ countryCode, onSelect }: Props) => {
7070
<option value="DK">Denmark (+45)</option>
7171
<option value="DJ">Djibouti (+253)</option>
7272
<option value="DM">Dominica (+1809)</option>
73-
<option value="DO">Dominican Republic (+1809)</option>
73+
<option value="DO">Dominican Republic (+18XX)</option>
7474
<option value="EC">Ecuador (+593)</option>
7575
<option value="EG">Egypt (+20)</option>
7676
<option value="SV">El Salvador (+503)</option>
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import { Text } from '@chakra-ui/react'
22
import { MakeComBlock } from '@typebot.io/schemas'
3-
import { isNotDefined } from '@typebot.io/lib'
43

54
type Props = {
65
block: MakeComBlock
76
}
87

98
export const MakeComContent = ({ block }: Props) => {
10-
const webhook = block.options?.webhook
11-
12-
if (isNotDefined(webhook?.body))
9+
if (!block.options?.webhook?.url)
1310
return <Text color="gray.500">Configure...</Text>
1411
return (
1512
<Text noOfLines={1} pr="6">
16-
{webhook?.url ? 'Trigger scenario' : 'Disabled'}
13+
Trigger scenario
1714
</Text>
1815
)
1916
}

0 commit comments

Comments
 (0)