From 9ea0f06a8ec5d504c0d1096d0cef551572730601 Mon Sep 17 00:00:00 2001 From: Shahzad Date: Fri, 30 Aug 2024 08:14:05 +0200 Subject: [PATCH] [Uptime] Report uptime overview metrics (#191708) ## Summary Report uptime overview metrics !! --------- Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com> --- .../public/legacy_uptime/app/uptime_app.tsx | 29 ++++++++++--------- .../monitor_list/monitor_list_container.tsx | 3 ++ .../legacy_uptime/pages/overview.test.tsx | 4 +++ .../uptime/tsconfig.json | 1 + 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx index 1f4be8fa943f0..3ce07ac9803f7 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/app/uptime_app.tsx @@ -16,6 +16,7 @@ import { KibanaThemeProvider } from '@kbn/react-kibana-context-theme'; import { RedirectAppLinks } from '@kbn/shared-ux-link-redirect-app'; import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common'; import { InspectorContextProvider } from '@kbn/observability-shared-plugin/public'; +import { PerformanceContextProvider } from '@kbn/ebt-tools'; import { ClientPluginsSetup, ClientPluginsStart } from '../../plugin'; import { UMUpdateBadge } from '../lib/lib'; import { @@ -133,19 +134,21 @@ const Application = (props: UptimeAppProps) => { -
- - - - - - - -
+ +
+ + + + + + + +
+
diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx index 8447f1c9d3e71..78fbdc686050e 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/components/overview/monitor_list/monitor_list_container.tsx @@ -7,6 +7,7 @@ import React, { useContext, useEffect, useState } from 'react'; import { useSelector, useDispatch } from 'react-redux'; +import { usePageReady } from '@kbn/ebt-tools'; import { getMonitorList } from '../../../state/actions'; import { esKuerySelector, monitorListSelector } from '../../../state/selectors'; import { MonitorListComponent } from './monitor_list'; @@ -46,6 +47,8 @@ export const MonitorList: React.FC = (props) => { const monitorList = useSelector(monitorListSelector); useMappingCheck(monitorList.error); + usePageReady({ isReady: Boolean(monitorList.isLoaded) }); + useEffect(() => { filterCheck(() => dispatch( diff --git a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx index 57ca69c0de184..9999215d02e8f 100644 --- a/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx +++ b/x-pack/plugins/observability_solution/uptime/public/legacy_uptime/pages/overview.test.tsx @@ -9,6 +9,10 @@ import React from 'react'; import { OverviewPageComponent } from './overview'; import { render } from '../lib/helper/rtl_helpers'; +jest.mock('@kbn/ebt-tools', () => ({ + usePageReady: jest.fn(), +})); + describe('MonitorPage', () => { it('renders expected elements for valid props', async () => { const { findByText } = render(); diff --git a/x-pack/plugins/observability_solution/uptime/tsconfig.json b/x-pack/plugins/observability_solution/uptime/tsconfig.json index f797a5a7f930d..8fa4d21627252 100644 --- a/x-pack/plugins/observability_solution/uptime/tsconfig.json +++ b/x-pack/plugins/observability_solution/uptime/tsconfig.json @@ -78,6 +78,7 @@ "@kbn/react-kibana-context-theme", "@kbn/react-kibana-mount", "@kbn/deeplinks-observability", + "@kbn/ebt-tools", ], "exclude": ["target/**/*"] }