[8.x] [ML] Transforms: Pagination in the source documents data grid fix (#196119) (#196163)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ML] Transforms: Pagination in the source documents data grid fix
(#196119)](https://github.com/elastic/kibana/pull/196119)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Robert
Jaszczurek","email":"92210485+rbrtj@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-10-14T15:01:36Z","message":"[ML]
Transforms: Pagination in the source documents data grid fix
(#196119)\n\n## Summary\r\n\r\nFix for:
[#195881](https://github.com/elastic/kibana/issues/195881)\r\n\r\nAfter:\r\nIt's
hardly visible in the recording, but if you look at the\r\n`@timestamp`
column, you can see that the values are changing correctly\r\nwhile
navigating to a previous page, which was not the case before
the\r\nfix.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/33be9e8c-e558-4f48-994a-562c4e3788de","sha":"1489396c84356fb6226290438ce805c209ef650a","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","backport
pending",":ml","Feature:Transforms","v9.0.0","Team:ML","v8.16.0","backport:version"],"title":"[ML]
Transforms: Pagination in the source documents data grid
fix","number":196119,"url":"https://github.com/elastic/kibana/pull/196119","mergeCommit":{"message":"[ML]
Transforms: Pagination in the source documents data grid fix
(#196119)\n\n## Summary\r\n\r\nFix for:
[#195881](https://github.com/elastic/kibana/issues/195881)\r\n\r\nAfter:\r\nIt's
hardly visible in the recording, but if you look at the\r\n`@timestamp`
column, you can see that the values are changing correctly\r\nwhile
navigating to a previous page, which was not the case before
the\r\nfix.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/33be9e8c-e558-4f48-994a-562c4e3788de","sha":"1489396c84356fb6226290438ce805c209ef650a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/196119","number":196119,"mergeCommit":{"message":"[ML]
Transforms: Pagination in the source documents data grid fix
(#196119)\n\n## Summary\r\n\r\nFix for:
[#195881](https://github.com/elastic/kibana/issues/195881)\r\n\r\nAfter:\r\nIt's
hardly visible in the recording, but if you look at the\r\n`@timestamp`
column, you can see that the values are changing correctly\r\nwhile
navigating to a previous page, which was not the case before
the\r\nfix.\r\n\r\n\r\nhttps://github.com/user-attachments/assets/33be9e8c-e558-4f48-994a-562c4e3788de","sha":"1489396c84356fb6226290438ce805c209ef650a"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Jaszczurek <92210485+rbrtj@users.noreply.github.com>
This commit is contained in:
Kibana Machine 2024-10-15 04:00:51 +11:00 committed by GitHub
parent 2240eb45bf
commit 828133d7ed
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -196,7 +196,7 @@ export const useIndexData = (options: UseIndexDataOptions): UseIndexDataReturnTy
setStatus(INDEX_STATUS.LOADED);
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [dataGridDataError, dataGridDataIsError, dataGridDataIsLoading]);
}, [dataGridDataError, dataGridDataIsError, dataGridDataIsLoading, dataGridData]);
const allDataViewFieldNames = new Set(dataView.fields.map((f) => f.name));
const { error: histogramsForFieldsError, data: histogramsForFieldsData } =