diff --git a/src/plugins/kibana_overview/public/components/overview/overview.tsx b/src/plugins/kibana_overview/public/components/overview/overview.tsx index 0f42fff9d6a7d..8685fed341269 100644 --- a/src/plugins/kibana_overview/public/components/overview/overview.tsx +++ b/src/plugins/kibana_overview/public/components/overview/overview.tsx @@ -93,6 +93,8 @@ export const Overview: FC = ({ newsFetchResult, solutions, features }) => }, }, docsLink: docLinks.links.kibana, + addBasePath, + isDarkMode: IS_DARK_THEME, }; // Show card for console if none of the manage data plugins are available, most likely in OSS diff --git a/src/plugins/kibana_react/public/table_list_view/index.tsx b/src/plugins/kibana_react/public/table_list_view/index.tsx index 2c19a14a72ac2..4242ee131b02d 100644 --- a/src/plugins/kibana_react/public/table_list_view/index.tsx +++ b/src/plugins/kibana_react/public/table_list_view/index.tsx @@ -6,14 +6,14 @@ * Side Public License, v 1. */ -import React from 'react'; +import React, { PropsWithChildren } from 'react'; export type { TableListViewProps } from './table_list_view'; import type { TableListViewProps } from './table_list_view'; const LazyTableListView = React.lazy(() => import('./table_list_view')); -export const TableListView = (props: TableListViewProps) => { +export const TableListView = (props: PropsWithChildren>) => { // Type '{}' is not assignable to type 'V'. // '{}' is assignable to the constraint of type 'V', // but 'V' could be instantiated with a different subtype of constraint '{}'. diff --git a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx index 41fa2744397c7..ade44b3a4ddec 100644 --- a/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx +++ b/x-pack/plugins/observability/public/pages/cases/cases.stories.tsx @@ -7,11 +7,9 @@ import React, { ComponentType } from 'react'; import { MemoryRouter } from 'react-router-dom'; +import { KibanaPageTemplate } from '@kbn/react-page-template'; import { CoreStart } from '../../../../../../src/core/public'; -import { - createKibanaReactContext, - KibanaPageTemplate, -} from '../../../../../../src/plugins/kibana_react/public'; +import { createKibanaReactContext } from '../../../../../../src/plugins/kibana_react/public'; import { casesFeatureId } from '../../../common'; import { PluginContext, PluginContextValue } from '../../context/plugin_context'; import { AllCasesPage } from './all_cases'; diff --git a/x-pack/plugins/observability/public/pages/landing/index.tsx b/x-pack/plugins/observability/public/pages/landing/index.tsx index 98b0b128b49d0..d06f4dc40d5d7 100644 --- a/x-pack/plugins/observability/public/pages/landing/index.tsx +++ b/x-pack/plugins/observability/public/pages/landing/index.tsx @@ -31,6 +31,7 @@ export function LandingPage() { hasData: false, basePath: core.http.basePath, docsLink: core.docLinks.links.observability.guide, + isDarkMode: core.uiSettings.get('theme:darkMode'), }); return ( diff --git a/x-pack/plugins/observability/public/pages/overview/index.tsx b/x-pack/plugins/observability/public/pages/overview/index.tsx index b817a83d59e0d..10f8f933d0894 100644 --- a/x-pack/plugins/observability/public/pages/overview/index.tsx +++ b/x-pack/plugins/observability/public/pages/overview/index.tsx @@ -70,6 +70,7 @@ export function OverviewPage({ routeParams }: Props) { hasData, basePath: core.http.basePath, docsLink: core.docLinks.links.observability.guide, + isDarkMode: core.uiSettings.get('theme:darkMode'), }); const alerts = (hasDataMap.alert?.hasData as Alert[]) || []; diff --git a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx index 506b919b16416..d9ccbaa36a93a 100644 --- a/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx +++ b/x-pack/plugins/observability/public/pages/overview/overview.stories.tsx @@ -10,6 +10,7 @@ import { storiesOf } from '@storybook/react'; import { AppMountParameters, CoreStart } from 'kibana/public'; import React from 'react'; import { MemoryRouter } from 'react-router-dom'; +import { KibanaPageTemplate } from '@kbn/react-page-template'; import { UI_SETTINGS } from '../../../../../../src/plugins/data/public'; import { HasDataContextProvider } from '../../context/has_data_context'; import { PluginContext } from '../../context/plugin_context'; @@ -23,10 +24,7 @@ import { emptyResponse as emptyMetricsResponse, fetchMetricsData } from './mock/ import { newsFeedFetchData } from './mock/news_feed.mock'; import { emptyResponse as emptyUptimeResponse, fetchUptimeData } from './mock/uptime.mock'; import { createObservabilityRuleTypeRegistryMock } from '../../rules/observability_rule_type_registry_mock'; -import { - createKibanaReactContext, - KibanaPageTemplate, -} from '../../../../../../src/plugins/kibana_react/public'; +import { createKibanaReactContext } from '../../../../../../src/plugins/kibana_react/public'; import { ApmIndicesConfig } from '../../../common/typings'; function unregisterAll() { diff --git a/x-pack/plugins/observability/public/utils/no_data_config.ts b/x-pack/plugins/observability/public/utils/no_data_config.ts index 1e16fb145bdce..2b28695770961 100644 --- a/x-pack/plugins/observability/public/utils/no_data_config.ts +++ b/x-pack/plugins/observability/public/utils/no_data_config.ts @@ -6,15 +6,17 @@ */ import { i18n } from '@kbn/i18n'; +import type { KibanaPageTemplateProps } from '@kbn/react-page-template'; import { IBasePath } from '../../../../../src/core/public'; -import { KibanaPageTemplateProps } from '../../../../../src/plugins/kibana_react/public'; export function getNoDataConfig({ docsLink, basePath, hasData, + isDarkMode, }: { docsLink: string; + isDarkMode: boolean; basePath: IBasePath; hasData?: boolean; }): KibanaPageTemplateProps['noDataConfig'] { @@ -33,6 +35,8 @@ export function getNoDataConfig({ }, }, docsLink, + addBasePath: basePath.prepend, + isDarkMode, }; } } diff --git a/x-pack/plugins/observability/public/utils/test_helper.tsx b/x-pack/plugins/observability/public/utils/test_helper.tsx index eb7efbd90c6ba..2453cd7b003a6 100644 --- a/x-pack/plugins/observability/public/utils/test_helper.tsx +++ b/x-pack/plugins/observability/public/utils/test_helper.tsx @@ -9,11 +9,9 @@ import { render as testLibRender } from '@testing-library/react'; import { AppMountParameters, CoreStart } from 'kibana/public'; import React from 'react'; import { __IntlProvider as IntlProvider } from '@kbn/i18n/react'; +import { KibanaPageTemplate } from '@kbn/react-page-template'; import { of } from 'rxjs'; -import { - KibanaContextProvider, - KibanaPageTemplate, -} from '../../../../../src/plugins/kibana_react/public'; +import { KibanaContextProvider } from '../../../../../src/plugins/kibana_react/public'; import translations from '../../../translations/translations/ja-JP.json'; import { PluginContext } from '../context/plugin_context'; import { ObservabilityPublicPluginsStart } from '../plugin'; diff --git a/x-pack/plugins/uptime/public/apps/use_no_data_config.ts b/x-pack/plugins/uptime/public/apps/use_no_data_config.ts index dc00a25e3a111..25226be9758de 100644 --- a/x-pack/plugins/uptime/public/apps/use_no_data_config.ts +++ b/x-pack/plugins/uptime/public/apps/use_no_data_config.ts @@ -8,7 +8,8 @@ import { i18n } from '@kbn/i18n'; import { useContext } from 'react'; import { useSelector } from 'react-redux'; -import { KibanaPageTemplateProps, useKibana } from '../../../../../src/plugins/kibana_react/public'; +import type { KibanaPageTemplateProps } from '@kbn/react-page-template'; +import { useKibana } from '../../../../../src/plugins/kibana_react/public'; import { UptimeSettingsContext } from '../contexts'; import { ClientPluginsStart } from './plugin'; import { indexStatusSelector } from '../state/selectors'; @@ -17,7 +18,7 @@ export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { const { basePath } = useContext(UptimeSettingsContext); const { - services: { docLinks }, + services: { docLinks, http, uiSettings }, } = useKibana(); const { data } = useSelector(indexStatusSelector); @@ -41,6 +42,8 @@ export function useNoDataConfig(): KibanaPageTemplateProps['noDataConfig'] { }, }, docsLink: docLinks!.links.observability.guide, + addBasePath: http!.basePath.prepend, + isDarkMode: uiSettings!.get('theme:darkMode'), }; } }