-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Discover] New responsive layout using EUI components #83633
[Discover] New responsive layout using EUI components #83633
Conversation
…discover-data-grid
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.
All my previous comments have been addressed, LGTM from my side.
This is probably a personal thing, but I don't really like the new style of the index pattern picker, especially along with the other elements in that area - everything looks slightly different (colors, font weights, edges, ...), the hits count is not aligned to the elements in the sidebar, the sidebar collapse button feels a little misplaced with its different color floating in between the other elements. Biggest part of that is probably me being used to the old style :)
I found one minor thing, but it's not blocking this IMHO:
If the table is scrollable horizontally, the "End of page" message at the end of the table is not taking the full width (not sure how important):
This definitely needs another pair of eyes before merging as there are so many changes going on.
/** | ||
* hits fetched from ES, displayed in the doc table | ||
*/ | ||
hits: Array<Record<string, unknown>>; |
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.
nit: Could this be ElasticSearchHit[]
?
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.
of course it could, and now it is! thx!
Thx @flash1293 for your valuable feedback!
Dear @andreadelrio & @cchaos could your eyes have another look? Many thx! |
src/plugins/discover/public/application/angular/directives/uninitialized.tsx
Show resolved
Hide resolved
src/plugins/discover/public/application/components/skip_bottom_button/skip_bottom_button.tsx
Outdated
Show resolved
Hide resolved
src/plugins/discover/public/application/components/timechart_header/timechart_header.tsx
Outdated
Show resolved
Hide resolved
I agree that there are some great inconsistencies here but most of that will be mitigated when we switch to the new K8 theme. Example: The main change here really was making the index pattern selection more prominent by making it the border-style button. This button control the entire data of this screen and it was getting lost. The second update was actually removing the And the mobile version (both being bordered buttons) is actually more consistent. |
Thanks for the explanation, @cchaos - the K8 theme mockup looks great |
@elasticmachine merge upstream |
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.
Just a few quick code comments while I'm testing this.
onRemoveColumn={onRemoveColumn} | ||
onSort={onSort} | ||
)} | ||
{resultState === 'uninitialized' && <DiscoverUninitialized onRefresh={fetch} />} |
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.
Can we use ternary statements here, I think it would improve readability?
resultState === 'uninitialized' ? <DiscoverUninitialized onRefresh={fetch} : null
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.
But I think then we should do it the same way throughout the file? for consistency. the readability is subjective, but what's an argument for ternary is, that it's explicit. issue with &&
are very well described here: https://kentcdodds.com/blog/use-ternaries-rather-than-and-and-in-jsx
However I'd prefer changes here later on (since it's not a single line)
src/plugins/discover/public/application/components/discover_legacy.tsx
Outdated
Show resolved
Hide resolved
|
||
return ( | ||
<I18nProvider> | ||
<div className="dscAppContainer" data-fetch-counter={fetchCounter}> | ||
<h1 className="euiScreenReaderOnly">{savedSearch.title}</h1> | ||
<EuiPage className="dscPage" data-fetch-counter={fetchCounter}> |
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 think we could break down the render function into smaller functions, to improve readability. Eg. renderSidebar
, renderRows
etc.
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.
If you don't mind we could do that later on ⏳
@@ -114,7 +114,7 @@ export default function ({ getService, getPageObjects }) { | |||
await PageObjects.discover.waitUntilSearchingHasFinished(); | |||
|
|||
const newDurationHours = await PageObjects.timePicker.getTimeDurationInHours(); | |||
expect(Math.round(newDurationHours)).to.be(24); | |||
expect(Math.round(newDurationHours)).to.be(26); |
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.
why this change?
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.
The layout changed, and so the width of the date histogram, but what didn't change is the width of the histogram brushing with the mouse. Because the date histogram is a bit smaller, a longer time range is selected. that's why more hours were selected. (It's a good question, also I've wondered why this test was failing initially)
…al/kibana into kertal-2020-11-18-responsive-layout
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.
Tested in Chrome on Mac OS, looks great!
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com> Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Michail Yasonik <michail.yasonik@elastic.co> Co-authored-by: Dave Snider <dave.snider@gmail.com> Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co> # Conflicts: # src/plugins/discover/public/application/angular/directives/fixed_scroll.test.js
Co-authored-by: Andrea Del Rio <delrio.andre@gmail.com> Co-authored-by: cchaos <caroline.horn@elastic.co> Co-authored-by: Michail Yasonik <michail.yasonik@elastic.co> Co-authored-by: Dave Snider <dave.snider@gmail.com> Co-authored-by: Marta Bondyra <marta.bondyra@elastic.co>
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Responsiveness of Discover was powered by Bootstrap classes, with this PR it's replaced by EUI. The ways it works is a bit different to before, there is a Flyout containing the field selector in the mobile version. This prepares Discover for #67259 aka Data Grid (Basically it's work, extracted from there).
The layout has changed, moved to EuiPage components, sidebar and results are now scrollable separately:
You can hide the date histogram to gain more vertical screen space (Histogram query is still submitted, but this will change).
And here's the new responsiveness in action:
Other changes
Doc Viewer Table action icons moved to the right side of the table.
Changes in this PR were mainly done by @andreadelrio 👍
FYI @gchaps we need to check the docs if there are screens to update
Checklist
Delete any items that are not applicable to this PR.
- [ ] Documentation was added for features that require explanation or tutorials-[x] Unit or functional tests were updated or added to match the most common scenarios
For maintainers
- [ ] This was checked for breaking API changes and was labeled appropriately