-
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
Allowing more status options for EuiSteps
#1088
Conversation
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.
Small comment about docs, naming. I checked code and tested this locally. I also verified this would be a non-breaking change based upon our previous interface.
} | ||
|
||
&--complete { | ||
.euiStepNumber__icon path { |
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.
Might wanna comment this one to explain why you're targeting the innards of the svg.
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.
@snide So that's how I had to do it because the icon itself uses the <defs>
and <use>
that really aren't necessary. Are you ok with me modifying the svg itself?
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.
Oh, yeah. I know why you're doing it and its fine to do it this way. Just think it's a little off pattern so you should probably comment the markup to explain why you're doing it.
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.
Yeah but I'm thinking it's bad to be doing it this way and the svg itself should be written correctly versus hacking it here.
src-docs/src/views/steps/status.js
Outdated
}); | ||
} | ||
|
||
handleUncomplete() { |
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.
handleIncomplete? I guess it's "un" completing it. Words are hard.
EuiIcon, | ||
} from '../icon'; | ||
|
||
const statusToClassNameMap = { |
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.
Know a lot of this is baked into not wanting this to be a breaking change (meaning I should have named complete
as success
...etc), but i wish this map read a little more as a set. Tempted to say warning / danger here should instead be "alert" and "error" so they all read the same and it doesn't feel tied to our coloring system (since this forces the actual icon usage as well).
I don't think it matters much, but just something I noticed when looking at the code.
In either case, can you update the doc description to make it more readible what it accepts. Can do that either by including the new component in the prop docs and referencing it, or just writing them in in the description.
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.
Yeah I wish the auto-doc props list would be able to list imported constants here.
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.
Changes LGTM; pulled branch and played with the docs; I echo Dave's thoughts about that status
prop, but know you guys talked about it and are trying to avoid breaking changes with it 👍
Fixes #994
A while back we added the option for a "completion" step, but it had only one option which was "complete" with a checkmark. I've noticed in some implementations of
EuiSteps
the last step can have an error or warning like so:I separated the actual step number render from both
EuiStep
andEuiStepHorizontal
intoEuiStepNumber
which allows for these status options: 'incomplete', 'complete', 'disabled', 'danger', 'warning'.I purposefully did not add this new
EuiStepNumber
component to the index.js manifest as it's just a dependency ofEuiSteps
andEuiStepsHorizontal
and should not be used on it's own.Also, there is some odd-ish logic happening in
EuiStepHorizontal
because of the way the component was already handling it's own status and I didn't want to cause any breaking changes.