2
0

🔥 Remove disable response saving option

Doesn't work properly when it comes to keep tracking storage usage
This commit is contained in:
Baptiste Arnaud
2023-03-07 14:41:57 +01:00
parent 0c19ea20f8
commit b77e2c8d2c
26 changed files with 194 additions and 182 deletions

View File

@ -54,7 +54,7 @@ export const Graph = ({
} = useGraph()
const { updateGroupCoordinates } = useGroupsCoordinates()
const [graphPosition, setGraphPosition] = useState(
graphPositionDefaultValue(typebot.groups[0].graphCoordinates)
graphPositionDefaultValue(typebot.groups[0]?.graphCoordinates)
)
const [debouncedGraphPosition] = useDebounce(graphPosition, 200)
const transform = useMemo(

View File

@ -40,7 +40,7 @@ export const ItemNodesList = ({
const isLastBlock =
isDefined(typebot) &&
typebot.groups[groupIndex].blocks[blockIndex + 1] === undefined
typebot.groups[groupIndex]?.blocks?.[blockIndex + 1] === undefined
const [position, setPosition] = useState({
x: 0,

View File

@ -46,12 +46,6 @@ export const GeneralSettingsForm = ({
isHideQueryParamsEnabled,
})
const handleDisableResultsSavingChange = (isResultSavingEnabled: boolean) =>
onGeneralSettingsChange({
...generalSettings,
isResultSavingEnabled: !isResultSavingEnabled,
})
return (
<Stack spacing={6}>
<ChangePlanModal
@ -96,16 +90,6 @@ export const GeneralSettingsForm = ({
onCheckChange={handleHideQueryParamsChange}
moreInfoContent="If your URL contains query params, they will be automatically hidden when the bot starts."
/>
<SwitchWithLabel
label="Disable responses saving"
initialValue={
isDefined(generalSettings.isResultSavingEnabled)
? !generalSettings.isResultSavingEnabled
: false
}
onCheckChange={handleDisableResultsSavingChange}
moreInfoContent="Prevent responses from being saved on Typebot. Chats limit usage will still be tracked."
/>
</Stack>
)
}

View File

@ -24,11 +24,6 @@ test.describe.parallel('Settings page', () => {
page.locator('input[type="checkbox"] >> nth=-3')
).toHaveAttribute('checked', '')
await page.click('text="Disable responses saving"')
await expect(
page.locator('input[type="checkbox"] >> nth=-1')
).toHaveAttribute('checked', '')
await expect(page.getByPlaceholder('Type your answer...')).toHaveValue(
'Baptiste'
)