-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[ML] Job Selector - ensure relative ganttBar width set on initial render #36249
[ML] Job Selector - ensure relative ganttBar width set on initial render #36249
Conversation
Pinging @elastic/ml-ui |
💚 Build Succeeded |
@@ -1,6 +1,5 @@ | |||
.mlJobSelectorBar { | |||
padding: 10px; | |||
background-color: $euiColorLightShade | |||
padding: $euiSizeS; |
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.
At the moment the padding looks like this:
I'd like to suggest to align the padding with the elements further down (filter bar, Top Influencers) and change this to $euiSize
, with this additional change in _explorer.scss
(0px
instead of $euiSize
for top padding):
.results-container {
padding: 0px 0px $euiSize 0px;
...
const tzConfig = config.get('dateFormat:tz'); | ||
const dateFormatTz = (tzConfig !== 'Browser') ? tzConfig : moment.tz.guess(); | ||
// Give the ganttBar a little more than a 3rd of the width of the flyout | ||
const derivedWidth = Math.round(flyoutEl.current.flyout.offsetWidth / 3.6); |
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.
rather than using an estimate for the col width, the actual column width could be used by examining the table.
// get all the cols in the table header
const tableHeaderCols = flyoutEl.current.flyout.querySelectorAll('table thead th');
// get the width of the last col
const derivedWidth = tableHeaderCols[tableHeaderCols.length - 1].offsetWidth - 16;
Minus 16
because the cell has a padding of 8px
I couldn't find a numerical representation of $euiSize
for this. the values in '@elastic/eui/dist/eui_theme_light.json';
are all strings.
Could use theme.euiSize.replace('px, '')
but it's a bit hacky :)
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.
Overall LGTM, just added a comment about aligning the job badges.
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.
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.
💔 Build Failed |
@peteharverson - re: Because of the way the wrap works - you'll sometimes see this gap if badge is too long to fit and gets moved to the next row. I'm happy to change the design if you'd prefer it always be after the last badge. |
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.
Happy to go with current layout of badges. 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.
Thanks again for using EUI vars where possible!
border-left: 1px solid #d6d6d6; | ||
border-right: 1px solid #d6d6d6; | ||
margin-bottom: -16px; | ||
padding-top: 9px; | ||
margin-bottom: -14px; |
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.
Is there any way this could be a EUI sizing variable instead? Is 14px a must?
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.
Unfortunately, that's the only value I could make work for the ganttBar style.
retest |
💔 Build Failed |
retest |
💔 Build Failed |
fe25720
to
43ff7d7
Compare
💚 Build Succeeded |
…der (elastic#36249) * calc ganttBar width on first render; * Move all badges into separate components. Update css to use vars * check group not undefined * update job selector padding and base ganttBar width on columns
Summary
Addresses follow ups described in #35638
ensures a minimum ganttBar range width of 1px so that something always shows up even when jobs cover a large time range.
breaks JobSelector into smaller components
Changes Job selector bar to display badges to the left of the link, changes the copy to read
Edit job selection
and adds an edit icon to the linkFinal follow-up
I'll be breaking out the JobSelectorTable into smaller components as well and adding tests for those components so expect one last follow up 😄
Checklist
Use
strikethroughsto remove checklist items you don't feel are applicable to this PR.- [ ] Documentation was added for features that require explanation or tutorials- [ ] This was checked for keyboard-only and screenreader accessibilityFor maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately