Skip to content

Commit

Permalink
fix(survey): fix survey set schedule state (#25617)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
jurajmajerik and Phanatic authored Oct 16, 2024
1 parent cfb0455 commit 80499c8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion frontend/src/scenes/surveys/SurveyEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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={[
Expand All @@ -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,
},
Expand Down

0 comments on commit 80499c8

Please sign in to comment.