-
Notifications
You must be signed in to change notification settings - Fork 843
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
Convert EuiStat to TSX, add isLoading prop, add tests #1848
Conversation
👍 Nice, simple solution. |
// @ts-ignore | ||
<EuiI18n token="euiStat.loadingText" default="Statistic is loading"> | ||
{/* // @ts-ignore */} | ||
{(loadingText: string) => <p aria-label={loadingText}>--</p>} |
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.
re: TS error around EuiI18n
usage.
K, went ahead and converted this component to TS. Had a minor hiccup with our 18n service, but otherwise should be reviewable. |
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.
TypeScript & code changes LGTM
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.
I like the simplicity and it's not an overwhelming animation when there are a lot of them on the screen at once.
Checked Chrome, FF and IE 👍
Renders well, just had some code comments.
We should also think about beefing up the tests https://github.com/elastic/eui/blob/aec7577e20036f998981ca8fdbc0e3267ec36b5a/src/components/stat/stat.test.js and adding some snippets. |
Co-Authored-By: snide <dave.snider@gmail.com>
Co-Authored-By: snide <dave.snider@gmail.com>
"Oh, I'll just add a prop" somehow turned into "Let me rewrite this in typescript, add tests and fix a bunch of accessibility and docs issues". I think I got to all the requests though 😉 |
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.
I just saw a couple of things, the only blocking one being the aria label, but feel free to merge when fixed.
const statLoadingSnippet = `<EuiStat | ||
title={someNumber} | ||
description="Total people" | ||
isLoading={someNumber == undefined} |
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.
nice!
…ough she doesn't like it. she's a good person.
Summary
WIP, but feel free to comment on the actual solution. I'm wanna see if I can convert this to TS quickly while I'm in here.
cc @angorayc since she had some need for something like this and we discussed it in her earlier PR.
Checklist
This was checked in mobileThis was checked for breaking changes and labeled appropriatelyThis required updates to Framer X components