2
0

(settings) Add a "disable responses saving" option

Closes #164
This commit is contained in:
Baptiste Arnaud
2022-11-16 16:17:42 +01:00
parent 0c3dcc522e
commit 473d315e0f
4 changed files with 31 additions and 2 deletions

View File

@ -46,6 +46,12 @@ export const GeneralSettingsForm = ({
isHideQueryParamsEnabled,
})
const handleDisableResultsSavingChange = (isResultSavingEnabled: boolean) =>
onGeneralSettingsChange({
...generalSettings,
isResultSavingEnabled: !isResultSavingEnabled,
})
return (
<Stack spacing={6}>
<ChangePlanModal
@ -90,6 +96,16 @@ 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

@ -23,6 +23,11 @@ test.describe.parallel('Settings page', () => {
).toBeHidden()
await page.click('text="Remember session"')
await expect(
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', '')