-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(surveys): allow to stop surveys once reached enough responses #21528
Conversation
@@ -516,13 +516,18 @@ export default function SurveyEdit(): JSX.Element { | |||
type="number" | |||
size="small" | |||
min={0} | |||
value={value?.seenSurveyWaitPeriodInDays} | |||
value={value?.seenSurveyWaitPeriodInDays || NaN} |
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.
This cleans the input field when the value is null
onChange={(val) => { | ||
if (val !== undefined && val > 0) { | ||
onChange({ | ||
...value, | ||
seenSurveyWaitPeriodInDays: val, | ||
}) | ||
} else { |
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.
This allows one to actually clean the input field
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.
Hey @nikitaevg - excellent work so far! Great job improving the survey wait period component. Some comments on things to fix.
Also, we want some indication on the UI when the survey is running: A dismissible info banner saying the survey will be stopped when X responses are reached.
Thanks for the comments @neilkakkar
Yeah, it makes sense. I'm not sure if it should be dismissible though. WDYT about this place at the bottom, in the Overview? IMO it's pretty suitable there. I see the storybook tests fail here. I tried updating the screenshots, but storybook fails for chromium on my laptop with an error |
nice, agree not dismissible like you have is much better 👍 . I think I was thinking of dismissible banner after the celery task runs and ends the survey. But we don't have a good way to detect this currently. Hmm. |
Haven't seen that storybook error before, so unsure, but for the CI failure, it seems like updating snapshots from a fork PR isn't possible, hmm, let me try pushing to see if that makes a difference. |
You can copy the snapshot updates from my PR above if you prefer, or I can merge your changes into that PR and merge that. Upto you :) |
Co-authored-by: Neil Kakkar <neilkakkar@gmail.com>
I agree it would be nice. Let's see if users get confused about this and if so I could add a banner. My current idea is that we would need to persist the responses_limit until the survey is relaunched, so that when a user sees a finished survey we could determine if it was finished due to the responses_limit and show such a banner. That would complicate the solution in a sense that responses_limit should now be updated in the survey launch.
Thank you! Will transfer the screenshots to my PR once it's ready to be submitted |
Seriously great work here, I'm impressed how you managed to sort this really big chunk of work mostly autonomously, and had great suggestions on how to do things 🚀 🙌 |
Thank you:) I'm pleased to hear that! |
@neilkakkar I added a cypress test and transferred the screenshots, could you please have another look? |
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.
looks good thanks!
* master: (28 commits) fix: refactor update animation to do less (#21901) fix(plugin-server): add time component to person.force_upgrade (#21899) fix(dashboards): Indicate 404/400/500 properly (#21853) fix: recording exports (#21900) feat: Update SLAs, remove GitHub buttons (#21818) chore: Removed feature flag for heatmaps (#21886) fix(data-warehouse): Added an error message for empty data source files (#21843) feat(surveys): allow to stop surveys once reached enough responses (#21528) fix: patch missing pause method in rrweb (#21898) fix(hogql): make funnels fast again (#21890) fix: Explicitly call out readonly user fields (#21889) chore(dev): Allow mypy to run in VS Code extension (#21891) feat: Small heatmap UI fixes (#21849) feat: Improve Heatmaps UI and notices (#21887) fix: Redirection to keep query params (#21881) fix: hot path is cooler now (#21888) feat(data-warehouse): Moved the table model creation to the data pipeline activity (#21817) fix: snapshot response timings (#21885) chore(deps): Update posthog-js to 1.130.0 (#21884) feat(debug): tabs + better view for non-hogql-query nodes (#21867) ...
Problem
Fixes #21179
Changes
Does this work well for both Cloud and self-hosted?
Yes
How did you test this code?
Manually: