-
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
[RAC] EuiDataGrid pagination #109269
[RAC] EuiDataGrid pagination #109269
Conversation
d7222cc
to
c38b421
Compare
* It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height.
c38b421
to
f8aa22e
Compare
@@ -311,81 +301,56 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({ | |||
)} | |||
</UpdatedFlexGroup> | |||
|
|||
<FullWidthFlexGroup | |||
$visible={!graphEventId && graphOverlay == 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.
How to test graphOverlay
and graphEventId
? It was always undefined when I implemented this feature. But I see that it was recently introduced on master.
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.
@stephmilovic is that correct?
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.
graphOverlay you can do analyze event from alerts, not sure the other?
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.
@semd we need to add this back, can you do your magic here?
* Be careful with array out of bounds. `pageRowIndex` can be bigger or equal to `data.length` | ||
* in the scenario where the user changes the event status (Open, Acknowledged, Closed). | ||
*/ | ||
export const getPageRowIndex = (rowIndex: number, itemsPerPage: number) => rowIndex % itemsPerPage; |
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.
This function is defined twice (timelines and security solutions). Where can we move it to reuse on both places?
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.
since this is already importing from the timeslines plugin, i think we can import it from there
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.
okay I exported it from timeline public, it is imported by both o11y and securitySol.
@@ -86,16 +80,6 @@ const EventsContainerLoading = styled.div.attrs(({ className = '' }) => ({ | |||
flex-direction: column; | |||
`; | |||
|
|||
const FullWidthFlexGroup = styled(EuiFlexGroup)<{ $visible: boolean }>` |
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.
It was useless. should we reintroduce it because $visible
could be defined?
HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed.
f8aa22e
to
091b592
Compare
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
Pinging @elastic/security-solution (Team: SecuritySolution) |
@semd and @spong and I investigate your first problem, we know why. It is because now we are using an alias |
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 didn't get a chance to get this running locally to test, but I've see you run through and it LGTM. My only question was whether we should default to more alerts by default in the view.
itemsPerPageOptions: [], | ||
loadingEventIds: [], | ||
loadPage: jest.fn(), | ||
querySize: 25, | ||
pageSize: 25, |
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 this the initial amount shown in the table? Would it make sense to have this be at least 50?
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.
Hi @mdefazio , Yes the default size is 50 items in security solutions and observability. This is just a test, we are good 👍
const TIME_INTERVAL = 50; | ||
|
||
/** | ||
* You are probably asking yourself "Why 3?". But that is the wrong mindset. You should be asking yourself "why not 3?". |
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.
😂
Note, this technically is possible via the |
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.
Looks like that last bug is Eui related. Code looks good and I didn't surface any other issues testing locally. LGTM thank you @semd 🐎 🏁 🏎️
Thanks @stephmilovic for testing it. And @machadoum! he did the hardest part 📐 |
* Update T-Grid to use DataGrid pagination * It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height. * Add DataGrid height hack to t-grid HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed. * Apply DataGrid laoding and pagination changes to observability * Fix cypress tests * Fix t-grid page render bug on Observability * some pagination fixes * hide table when analyzer active * isolate exported function Co-authored-by: semd <sergi.massaneda@elastic.co>
💔 Backport failed
Successful backport PRs will be merged automatically after passing CI. To backport manually run: |
* Update T-Grid to use DataGrid pagination * It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height. * Add DataGrid height hack to t-grid HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed. * Apply DataGrid laoding and pagination changes to observability * Fix cypress tests * Fix t-grid page render bug on Observability * some pagination fixes * hide table when analyzer active * isolate exported function Co-authored-by: semd <sergi.massaneda@elastic.co> Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co> Co-authored-by: semd <sergi.massaneda@elastic.co>
* Update T-Grid to use DataGrid pagination * It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height. * Add DataGrid height hack to t-grid HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed. * Apply DataGrid laoding and pagination changes to observability * Fix cypress tests * Fix t-grid page render bug on Observability * some pagination fixes * hide table when analyzer active * isolate exported function Co-authored-by: semd <sergi.massaneda@elastic.co> # Conflicts: # x-pack/plugins/timelines/public/components/t_grid/body/index.tsx
💛 Build succeeded, but was flaky
Metrics [docs]Public APIs missing comments
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: cc @machadoum |
* Update T-Grid to use DataGrid pagination * It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height. * Add DataGrid height hack to t-grid HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed. * Apply DataGrid laoding and pagination changes to observability * Fix cypress tests * Fix t-grid page render bug on Observability * some pagination fixes * hide table when analyzer active * isolate exported function Co-authored-by: semd <sergi.massaneda@elastic.co>
* Update T-Grid to use DataGrid pagination * It also improves the Gtid loading state * DataGrid pagination makes sure that we display the grid with the proper height. * Add DataGrid height hack to t-grid HUGE HACK!!! DataGrtid height isn't properly calculated when the grid has horizontal scroll. elastic/eui#5030 In order to get around this bug we are calculating `DataGrid` height here and setting it as a prop. Please revert this commit and allow DataGrid to calculate its height when the bug is fixed. * Apply DataGrid laoding and pagination changes to observability * Fix cypress tests * Fix t-grid page render bug on Observability * some pagination fixes * hide table when analyzer active * isolate exported function Co-authored-by: semd <sergi.massaneda@elastic.co> Co-authored-by: Pablo Machado <pablo.nevesmachado@elastic.co>
Summary
rowIndex
to userowIndex % itemsPerPage
because we only load the current page in memory