[Stack Monitoring] fix useTable sorting and pagination#113563
[Stack Monitoring] fix useTable sorting and pagination#113563neptunian merged 2 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/logs-metrics-ui (Team:logs-metrics-ui) |
|
|
||
| // get initial state from localStorage | ||
| const [sorting, setSorting] = useState<Sorting>(storageData.sort || { sort: {} }); | ||
| const cleanSortingData = (sortData: Sorting) => { |
There was a problem hiding this comment.
this new function was causing the sorting to store itself incorrectly. it doesn't exist in the angular version and after removal it stopped breaking
| sorting, | ||
| pagination, | ||
| onTableChange, | ||
| fetchMoreData: ({ |
There was a problem hiding this comment.
This used to have the async updateData function in here (https://github.com/elastic/kibana/blob/master/x-pack/plugins/monitoring/public/views/base_eui_table_controller.js#L131). Now it does not and this already happens onTableChange
| }} | ||
| onTableChange={onTableChange} | ||
| fetchMoreData={fetchMoreData} | ||
| {...props} |
There was a problem hiding this comment.
don't look for fetchMoreData explicitly because its removed in the react version now
| sorting={sortingOptions} | ||
| message={upgradeMessage} | ||
| pagination={pagination} | ||
| fetchMoreData={fetchMoreData} |
There was a problem hiding this comment.
don't look for fetchMoreData explicitly because its removed in the react version now
| } | ||
| // react version | ||
| else { | ||
| onTableChange({ page, sort, queryText }); |
There was a problem hiding this comment.
fetchMoreData isn't needed in React version because we get data in the ElasticsearchTemplate
| items={items} | ||
| pagination={pagination} | ||
| onChange={onChange} | ||
| loading={isLoading} |
There was a problem hiding this comment.
No loading visual was happening in Angular version so I removed it. Would need to pass this down from parent component at some point.
|
@elasticmachine merge upstream |
testingusing monitoring-olbt, edge-olbt didn't seem to have any monitoring data
|
|
I noticed that the filter got lost after refresh, but sorting remained. Angular master and even 7.15.0 do this so seems intended. Just mentioning incase anyone flags it as a bug. |
matschaffer
left a comment
There was a problem hiding this comment.
Looks solid. Thanks for posting the recommended test steps!
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
⏳ Build in-progress, with failures
Failed CI StepsHistory
To update your PR or re-run it, just comment with: cc @neptunian |
Test