From 80499c89f399b6ad625aa070e9a89450f89cd0ff Mon Sep 17 00:00:00 2001 From: Juraj Majerik Date: Wed, 16 Oct 2024 19:54:47 +0200 Subject: [PATCH] fix(survey): fix survey set schedule state (#25617) Fixes an issue with editing survey recurring schedules: If I set "Repeat on schedule" but don't manipulate the inputs, iteration_count and iteration_frequency_days remain at zero. Co-authored-by: Phani Raj --- frontend/src/scenes/surveys/SurveyEdit.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/frontend/src/scenes/surveys/SurveyEdit.tsx b/frontend/src/scenes/surveys/SurveyEdit.tsx index acd242061cc74..32d1636e492d9 100644 --- a/frontend/src/scenes/surveys/SurveyEdit.tsx +++ b/frontend/src/scenes/surveys/SurveyEdit.tsx @@ -889,6 +889,9 @@ export default function SurveyEdit(): JSX.Element { if (newValue === 'once') { setSurveyValue('iteration_count', 0) setSurveyValue('iteration_frequency_days', 0) + } else if (newValue === 'recurring') { + setSurveyValue('iteration_count', 1) + setSurveyValue('iteration_frequency_days', 90) } }} options={[ @@ -899,7 +902,7 @@ export default function SurveyEdit(): JSX.Element { }, { value: 'recurring', - label: 'Repeat on a Schedule', + label: 'Repeat on a schedule', 'data-attr': 'survey-iteration-frequency-days', disabledReason: surveysRecurringScheduleDisabledReason, },