Skip to content

Commit

Permalink
[Uptime] Report uptime overview metrics (elastic#191708)
Browse files Browse the repository at this point in the history
## Summary

 Report uptime overview metrics !!

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit 9ea0f06)

# Conflicts:
#	x-pack/plugins/observability_solution/uptime/tsconfig.json
  • Loading branch information
shahzad31 committed Sep 5, 2024
1 parent 7ae51a5 commit 7a41a39
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -133,19 +134,21 @@ const Application = (props: UptimeAppProps) => {
<UptimeThemeContextProvider darkMode={darkMode}>
<UptimeStartupPluginsContextProvider {...startPlugins}>
<UptimeDataViewContextProvider dataViews={startPlugins.dataViews}>
<div className={APP_WRAPPER_CLASS} data-test-subj="uptimeApp">
<RedirectAppLinks
coreStart={{
application: core.application,
}}
>
<InspectorContextProvider>
<UptimeAlertsFlyoutWrapper />
<PageRouter />
<ActionMenu appMountParameters={appMountParameters} />
</InspectorContextProvider>
</RedirectAppLinks>
</div>
<PerformanceContextProvider>
<div className={APP_WRAPPER_CLASS} data-test-subj="uptimeApp">
<RedirectAppLinks
coreStart={{
application: core.application,
}}
>
<InspectorContextProvider>
<UptimeAlertsFlyoutWrapper />
<PageRouter />
<ActionMenu appMountParameters={appMountParameters} />
</InspectorContextProvider>
</RedirectAppLinks>
</div>
</PerformanceContextProvider>
</UptimeDataViewContextProvider>
</UptimeStartupPluginsContextProvider>
</UptimeThemeContextProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -46,6 +47,8 @@ export const MonitorList: React.FC<MonitorListProps> = (props) => {
const monitorList = useSelector(monitorListSelector);
useMappingCheck(monitorList.error);

usePageReady({ isReady: Boolean(monitorList.isLoaded) });

useEffect(() => {
filterCheck(() =>
dispatch(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(<OverviewPageComponent />);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/observability_solution/uptime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,8 @@
"@kbn/react-kibana-context-render",
"@kbn/react-kibana-context-theme",
"@kbn/react-kibana-mount",
"@kbn/deeplinks-observability"
"@kbn/deeplinks-observability",
"@kbn/ebt-tools",
],
"exclude": ["target/**/*"]
}

0 comments on commit 7a41a39

Please sign in to comment.