-
Notifications
You must be signed in to change notification settings - Fork 841
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
[EuiFormRow] Add support for warning and success messages #1200
Comments
@cjcenizal Do you think that these alerts should show in addition or in replacement of anything in the help prop? Generally the way you're doing it seems like the way I'd handle it (changing the content of help based on context).
Can you explain this one a bit more? Are you looking to pre-validate as they type? I think we'd rather not have messaging stack, so replacing help still seems like the proper place for this stuff. Only other option I could think is that we formalize some sort of EuiTipIcon to the side when these sorts of dynamic bits appear, but I'd be worried people would use them in addition to the current error validation. We'd likely want one or the other. |
I can think of cases where we might want the
There's a particular input in the rollup wizard for specifying an interval. Due to the quirks of rollups, an interval of
I agree with you that having a messaging stack is suboptimal. But if we let the person building the UI be responsible for making those choices then I think the benefits outweigh the risks. I've been building a lot of these forms recently and the components we have in EUI are really easy to use, and every time they let me do something unexpected I breathe a sigh of relief and every time they fight me I head-desk (which is rare!). The flexibility is great when you run into edge/corner cases and need to wrangle a solution to something weird, like these interval validation rules. |
I think this will be super-useful for tight spots where we can't use a |
@snide Here's an example of what I mean: As an aside, that's using the I couldn't tell the two apart... and I know we run into problems in terms of color contrast against the white background if we start moving the warning color more into the yellow part of the spectrum. Catch 22. |
Thanks for the context. Very helpful. |
I would assume that any validation style help messages should also contain a [customizable] icon as to not rely solely on text color alone. |
👋 Hey there. This issue hasn't had any activity for 180 days. We'll automatically close it if that trend continues for another week. If you feel this issue is still valid and needs attention please let us know with a comment. |
Due to the age of this feature request and the lack of requests from others for this functionality, we won't be implementing this OOTB in EUI. Using the workaround mentioned in the issue description (using the |
@elastic/kibana-management has recently run into scenarios where we need to surface these types of messages next to the input. For example, here's a success message which we show when our async validation returns success when an index pattern matches indices:
We also would like to show warnings (yellow/orange text) for another input when the user enters input which is technically acceptable but suboptimal or has known gotchas.
In the example above, I've hacked this by using
EuiTextColor
and passing it to thehelp
prop. Ideally I think it would be great if we addedwarning
andsuccess
props toEuiFormRow
which accept the same values as theerror
prop. We could then createEuiFormWarningText
andEuiFormSuccessText
components whichEuiFormRow
would use internally.In terms of implementation, I'd suggest showing errors first, then warnings below that, and success below that. It's very unlikely anyone will want to use all of them together at once but you never know! I think this order makes sense since it orders the information from most important to least important.
The text was updated successfully, but these errors were encountered: