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

[EuiBadge] : Handle invalid color entry #4481

Merged
merged 4 commits into from
Feb 5, 2021

Conversation

akashgp09
Copy link
Contributor

Signed-off-by: Akash Gupta akashgp9@gmail.com

Summary

This PR Fixes #3765
Handling invalid color entry passed to EuiBadge color prop

Checklist

  • Check against all themes for compatibility in both light and dark modes
  • Checked in mobile
  • Checked in Chrome, Edge, and Firefox
    - [ ] Props have proper autodocs and playground toggles
  • Added documentation
  • Checked Code Sandbox works for the any docs examples
  • Added or updated jest tests
  • Checked for breaking changes and labeled appropriately
  • Checked for accessibility including keyboard-only and screenreader modes
  • A changelog entry exists and is marked appropriately

Signed-off-by: Akash Gupta <akashgp9@gmail.com>
@kibanamachine
Copy link

Since this is a community submitted pull request, a Jenkins build has not been kicked off automatically. Can an Elastic organization member please verify the contents of this patch and then kick off a build manually?

Signed-off-by: Akash Gupta <akashgp9@gmail.com>
@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4481/

@thompsongl
Copy link
Contributor

jenkins test this

Error: Timed out waiting for: http-get://localhost:9999

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4481/

@thompsongl
Copy link
Contributor

Hey @akashgp09

This looks great! It does, however, highlight the fact that our chromaValid function does not see rgba() strings as valid colors. You can see this in the snapshot change in this branch, where the test should've pass unchanged and without warning.
Previously, (apparently) the warning still occurred, but the color would still be used correctly.
We'll need to accept rgba() to avoid a breaking change.
If you want to attempt the change, great! If not, no problem; I can push a commit to this branch.

@akashgp09
Copy link
Contributor Author

akashgp09 commented Feb 4, 2021

@thompsongl I have fixed it. Now it's accepting rgb string (as previously).
Let me know if anything missed out :‑P

Copy link
Contributor

@thompsongl thompsongl left a comment

Choose a reason for hiding this comment

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

LGTM! I think we will eventually want to update the validator util function(s) to accept strings withrgb(a) in the string, but this solves the more immediate problem.

I'm going to push one commit (I had it locally) to update the CL entry location. Will merge after CI passes.

@thompsongl
Copy link
Contributor

jenkins test this

@kibanamachine
Copy link

Preview documentation changes for this PR: https://eui.elastic.co/pr_4481/

@thompsongl thompsongl merged commit 9bcf6b4 into elastic:master Feb 5, 2021
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.

[EuiBadge] Handle invalid color entry
3 participants