[8.18] [Synthetics] Fixed test run logs per page (#218458) (#218524)

# Backport

This will backport the following commits from `main` to `8.18`:
- [[Synthetics] Fixed test run logs per page
(#218458)](https://github.com/elastic/kibana/pull/218458)

<!--- Backport version: 9.6.6 -->

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

<!--BACKPORT [{"author":{"name":"Francesco
Fagnani","email":"fagnani.francesco@gmail.com"},"sourceCommit":{"committedDate":"2025-04-17T05:34:38Z","message":"[Synthetics]
Fixed test run logs per page
(#218458)","sha":"e96f0566ce37c478e35c31e5a01419938062758d","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","v8.18.1","v9.0.1","v8.17.6"],"title":"[Synthetics]
Fixed test run logs per
page","number":218458,"url":"https://github.com/elastic/kibana/pull/218458","mergeCommit":{"message":"[Synthetics]
Fixed test run logs per page
(#218458)","sha":"e96f0566ce37c478e35c31e5a01419938062758d"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","8.18","9.0","8.17"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/218458","number":218458,"mergeCommit":{"message":"[Synthetics]
Fixed test run logs per page
(#218458)","sha":"e96f0566ce37c478e35c31e5a01419938062758d"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.18","label":"v8.18.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.0","label":"v9.0.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"8.17","label":"v8.17.6","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Francesco Fagnani <fagnani.francesco@gmail.com>
This commit is contained in:
Kibana Machine 2025-04-17 09:23:48 +02:00 committed by GitHub
parent 0b4badc7d1
commit ed4a8c3873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,6 +6,7 @@
*/
import {
CriteriaWithPagination,
EuiBasicTableColumn,
EuiButtonEmpty,
EuiCallOut,
@ -17,7 +18,7 @@ import {
EuiTitle,
formatDate,
} from '@elastic/eui';
import React from 'react';
import React, { useState } from 'react';
import { i18n } from '@kbn/i18n';
import { EuiInMemoryTable } from '@elastic/eui';
@ -71,6 +72,12 @@ export const StdErrorLogs = ({
const { items, loading } = useStdErrorLogs({ checkGroup });
const [pagination, setPagination] = useState({ pageIndex: 0, pageSize });
const onTableChange = ({ page }: CriteriaWithPagination<(typeof items)[number]>) => {
setPagination({ pageIndex: page.index, pageSize: page.size });
};
const { discover, exploratoryView } = useKibana<ClientPluginsStart>().services;
const { data: discoverLink } = useFetcher(async () => {
@ -139,9 +146,10 @@ export const StdErrorLogs = ({
defaultFields: ['@timestamp', 'synthetics.payload.message'],
}}
pagination={{
pageSize,
...pagination,
pageSizeOptions: [2, 5, 10, 20, 50],
}}
onTableChange={onTableChange}
/>
</>
);