-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b2f8cd4
commit 8771def
Showing
12 changed files
with
151 additions
and
5 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
apps/builder/src/features/settings/components/SecurityForm.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,50 @@ | ||
import { FormControl, FormLabel, Stack } from '@chakra-ui/react' | ||
import { Settings } from '@typebot.io/schemas' | ||
import React from 'react' | ||
import { isDefined } from '@typebot.io/lib' | ||
import { TextInput } from '@/components/inputs' | ||
import { env } from '@typebot.io/env' | ||
import { MoreInfoTooltip } from '@/components/MoreInfoTooltip' | ||
import { PrimitiveList } from '@/components/PrimitiveList' | ||
|
||
type Props = { | ||
security: Settings['security'] | ||
onUpdate: (security: Settings['security']) => void | ||
} | ||
|
||
export const SecurityForm = ({ security, onUpdate }: Props) => { | ||
const updateItems = (items: string[]) => { | ||
if (items.length === 0) onUpdate(undefined) | ||
onUpdate({ | ||
allowedOrigins: items.filter(isDefined), | ||
}) | ||
} | ||
|
||
return ( | ||
<Stack spacing={6}> | ||
<FormControl> | ||
<FormLabel display="flex" flexShrink={0} gap="1" mr="0" mb="4"> | ||
Allowed origins | ||
<MoreInfoTooltip> | ||
Restrict the execution of your typebot to specific website origins. | ||
By default your bot can be executed on any website. | ||
</MoreInfoTooltip> | ||
</FormLabel> | ||
<PrimitiveList | ||
initialItems={security?.allowedOrigins} | ||
onItemsChange={updateItems} | ||
addLabel="Add URL" | ||
> | ||
{({ item, onItemChange }) => ( | ||
<TextInput | ||
width="full" | ||
defaultValue={item} | ||
onChange={onItemChange} | ||
placeholder={env.NEXT_PUBLIC_VIEWER_URL[0]} | ||
/> | ||
)} | ||
</PrimitiveList> | ||
</FormControl> | ||
</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
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
8771def
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
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
app.typebot.io
8771def
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
landing-page-v2-typebot-io.vercel.app
landing-page-v2-git-main-typebot-io.vercel.app
home.typebot.io