Skip to content

Commit

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

This will backport the following commits from `main` to `8.15`:
- [[Uptime] Report uptime overview metrics
(#191708)](#191708)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-08-30T06:14:05Z","message":"[Uptime]
Report uptime overview metrics (#191708)\n\n## Summary\r\n\r\n Report
uptime overview metrics !!\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"9ea0f06a8ec5d504c0d1096d0cef551572730601","branchLabelMapping":{"^v8.16.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.16.0"],"number":191708,"url":"https://github.com/elastic/kibana/pull/191708","mergeCommit":{"message":"[Uptime]
Report uptime overview metrics (#191708)\n\n## Summary\r\n\r\n Report
uptime overview metrics !!\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"9ea0f06a8ec5d504c0d1096d0cef551572730601"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.16.0","labelRegex":"^v8.16.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/191708","number":191708,"mergeCommit":{"message":"[Uptime]
Report uptime overview metrics (#191708)\n\n## Summary\r\n\r\n Report
uptime overview metrics !!\r\n\r\n---------\r\n\r\nCo-authored-by:
kibanamachine
<[email protected]>","sha":"9ea0f06a8ec5d504c0d1096d0cef551572730601"}}]}]
BACKPORT-->
  • Loading branch information
shahzad31 authored Sep 5, 2024
1 parent 7ae51a5 commit 65b4555
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 65b4555

Please sign in to comment.