Skip to content

Commit c2d130c

Browse files
author
Alejandro Fernández Gómez
committed
Fix types after merge from master
1 parent f07a384 commit c2d130c

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

x-pack/plugins/infra/public/utils/logs_overview_fetchers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
*/
66

77
import { encode } from 'rison-node';
8+
import { i18n } from '@kbn/i18n';
89
import { DEFAULT_SOURCE_ID } from '../../common/constants';
910
import { InfraClientCoreSetup, InfraClientStartDeps } from '../types';
1011
import {
@@ -42,7 +43,7 @@ export function getLogsHasDataFetcher(
4243
return async () => {
4344
const [core] = await getStartServices();
4445
const sourceStatus = await callFetchLogSourceStatusAPI(DEFAULT_SOURCE_ID, core.http.fetch);
45-
return sourceStatus.data.logIndexNames.length > 0;
46+
return sourceStatus.data.logIndicesExist;
4647
};
4748
}
4849

@@ -71,7 +72,9 @@ export function getLogsOverviewDataFetcher(
7172
(Date.parse(params.endTime).valueOf() - Date.parse(params.startTime).valueOf()) / (1000 * 60);
7273

7374
return {
74-
title: 'Log rate',
75+
title: i18n.translate('xpack.infra.logs.logOverview.logOverviewTitle', {
76+
defaultMessage: 'Logs',
77+
}),
7578
appLink: `/app/logs/stream?logPosition=(end:${encode(params.endTime)},start:${encode(
7679
params.startTime
7780
)})`,

x-pack/plugins/infra/public/utils/logs_overview_fetches.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ describe('Logs UI Observability Homepage Functions', () => {
4141

4242
// @ts-expect-error
4343
callFetchLogSourceStatusAPI.mockResolvedValue({
44-
data: { logIndexFields: [], logIndexNames: ['filebeat'] },
44+
data: { logIndexFields: [], logIndicesExist: true },
4545
});
4646

4747
const hasData = getLogsHasDataFetcher(mockedGetStartServices);
@@ -56,7 +56,7 @@ describe('Logs UI Observability Homepage Functions', () => {
5656

5757
// @ts-expect-error
5858
callFetchLogSourceStatusAPI.mockResolvedValue({
59-
data: { logIndexFields: [], logIndexNames: [] },
59+
data: { logIndexFields: [], logIndicesExist: false },
6060
});
6161

6262
const hasData = getLogsHasDataFetcher(mockedGetStartServices);

0 commit comments

Comments
 (0)