-
Notifications
You must be signed in to change notification settings - Fork 422
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: format-create-segment-errors-from-payload #5082
base: main
Are you sure you want to change the base?
fix: format-create-segment-errors-from-payload #5082
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
@Zaimwa9 is attempting to deploy a commit to the Flagsmith Team on Vercel. A member of the Team first needs to authorize it. |
Uffizzi Ephemeral Environment
|
@@ -430,6 +441,26 @@ const CreateSegment: FC<CreateSegmentType> = ({ | |||
</FormGroup> | |||
) | |||
|
|||
const formatError = (error: CreateSegmentError): string | string[] => { |
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.
Hmm, if we're receiving the errors in the same order as the current rules, I wonder if it's better to highlight the inputs with a tooltip of the error and have a generic error underneath.
If this is not feasible we should at least indicate which rule it is
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.
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.
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.
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.
Alright, I have limited access to my computer for the next weeks, i'll rework it this way when back
Thanks for submitting a PR! Please check the boxes below:
docs/
if required so people know about the feature!Changes
Issue: #5071
Fixes #5071
Please describe.
The payload was passed as of from the request response.
CreateSegment
value/property
Rules: XXXXX
), if multiple errors, returns an array that is natively handled by the error component (but displays them as indexed list)Also please let me know if you have a better solution to handle multiple errors, the best would be something like the following but maybe you have other plans/prio:
How did you test this code?
Single error case

Multiple error case (to be improved)

Please describe.