-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(inputs): ✨ Add Set variable step
- Loading branch information
1 parent
13f72f5
commit 4ccb7bc
Showing
55 changed files
with
1,024 additions
and
223 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
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
46 changes: 46 additions & 0 deletions
46
.../board/graph/BlockNode/StepNode/SettingsPopoverContent/bodies/SetVariableSettingsBody.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,46 @@ | ||
import { FormLabel, Stack } from '@chakra-ui/react' | ||
import { DebouncedTextarea } from 'components/shared/DebouncedTextarea' | ||
import { VariableSearchInput } from 'components/shared/VariableSearchInput' | ||
import { SetVariableOptions, Variable } from 'models' | ||
import React from 'react' | ||
|
||
type Props = { | ||
options?: SetVariableOptions | ||
onOptionsChange: (options: SetVariableOptions) => void | ||
} | ||
|
||
export const SetVariableSettingsBody = ({ | ||
options, | ||
onOptionsChange, | ||
}: Props) => { | ||
const handleVariableChange = (variable: Variable) => | ||
onOptionsChange({ ...options, variableId: variable.id }) | ||
const handleExpressionChange = (expressionToEvaluate: string) => | ||
onOptionsChange({ ...options, expressionToEvaluate }) | ||
|
||
return ( | ||
<Stack spacing={4}> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="variable-search"> | ||
Search or create variable: | ||
</FormLabel> | ||
<VariableSearchInput | ||
onSelectVariable={handleVariableChange} | ||
initialVariableId={options?.variableId} | ||
id="variable-search" | ||
/> | ||
</Stack> | ||
<Stack> | ||
<FormLabel mb="0" htmlFor="expression"> | ||
Value / Expression: | ||
</FormLabel> | ||
<DebouncedTextarea | ||
id="expression" | ||
initialValue={options?.expressionToEvaluate ?? ''} | ||
delay={100} | ||
onChange={handleExpressionChange} | ||
/> | ||
</Stack> | ||
</Stack> | ||
) | ||
} |
Oops, something went wrong.
4ccb7bc
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
next.typebot.io
builder-v2-typebot-io.vercel.app
builder-v2-git-main-typebot-io.vercel.app
4ccb7bc
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
viewer-v2-typebot-io.vercel.app
viewer-v2-git-main-typebot-io.vercel.app
typebot-io.vercel.app