Skip to content
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

fix(cohorts): Alerting functionality when user enters wrong details while creating cohort #18689

Merged
merged 4 commits into from
Nov 20, 2023

Conversation

sksDonni
Copy link
Contributor

Closes - #18620
At present, When a user clicks on save cohort button without properly filling details, the site feels stuck. The user has to scroll down to the highlighted error box to rectify the details.

Such a situation can be avoided by a simple toast alerting the user that the details filled out in the form has errors.

Screen.Recording.2023-11-16.at.10.35.04.PM.mov

Testing -

  1. Go to cohorts
  2. Click on add criteria group
  3. The toast with error message should appear on the bottom right corner

@@ -205,6 +206,7 @@ export const cohortEditLogic = kea<cohortEditLogicType>([
},
}),
submit: (cohort) => {
actions.submitCohort()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this action exists by default thanks to forms, you shouldn't need to add it yourself, was this not working if you remove the action and this line?

[you can check the generated cohortEditLogicType.ts file for all existing actions

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, will check the functionality after removing this line. Will update the PR accordingly if it works

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this and the line in actions for the same 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@neilkakkar, I have made the required changes. Can you please take a look!

Copy link
Collaborator

@neilkakkar neilkakkar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect, thanks @sksDonni

@neilkakkar neilkakkar changed the title Alerting functionality when user enters wrong details while creating cohort fix(cohorts): Alerting functionality when user enters wrong details while creating cohort Nov 20, 2023
@neilkakkar neilkakkar enabled auto-merge (squash) November 20, 2023 12:12
@neilkakkar neilkakkar merged commit 443fb80 into PostHog:master Nov 20, 2023
70 of 72 checks passed
@sksDonni
Copy link
Contributor Author

@neilkakkar, #18614 is very similar to the issue here. Can we solve it in a similar way?

@neilkakkar
Copy link
Collaborator

indeed! However, we also want to expand the right section in surveys, since it can be pretty hard otherwise to figure out where the error is

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants