Skip to content

Commit

Permalink
Use Observability Page Template from Observability Shared in Infra (#…
Browse files Browse the repository at this point in the history
…154778)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
CoenWarmer and kibanamachine authored Apr 17, 2023
1 parent dcfff4f commit 5464614
Show file tree
Hide file tree
Showing 12 changed files with 23 additions and 24 deletions.
16 changes: 4 additions & 12 deletions x-pack/plugins/infra/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
"id": "infra",
"server": true,
"browser": true,
"configPath": [
"xpack",
"infra"
],
"configPath": ["xpack", "infra"],
"requiredPlugins": [
"alerting",
"cases",
Expand All @@ -21,21 +18,16 @@
"features",
"lens",
"observability",
"observabilityShared",
"ruleRegistry",
"security",
"share",
"triggersActionsUi",
"unifiedSearch",
"usageCollection",
"visTypeTimeseries",
],
"optionalPlugins": [
"spaces",
"ml",
"home",
"embeddable",
"osquery"
"visTypeTimeseries"
],
"optionalPlugins": ["spaces", "ml", "home", "embeddable", "osquery"],
"requiredBundles": [
"unifiedSearch",
"observability",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import React from 'react';
import { EuiButton } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { EuiEmptyPrompt } from '@elastic/eui';
import { EuiText } from '@elastic/eui';
import { PageTemplate } from '../page_template';
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/components/page_template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
*/

import React from 'react';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { useKibanaContextForPlugin } from '../hooks/use_kibana';

export const PageTemplate: React.FC<LazyObservabilityPageTemplateProps> = (pageTemplateProps) => {
const {
services: {
observability: {
observabilityShared: {
navigation: { PageTemplate: Template },
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { EuiText, EuiButton, EuiEmptyPrompt } from '@elastic/eui';
import { FormattedMessage } from '@kbn/i18n-react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { HttpStart } from '@kbn/core/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { useTrialStatus } from '../hooks/use_trial_status';
import { LoadingPrompt } from './loading_page';
import { PageTemplate } from './page_template';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const renderRoutes = (routes: React.ReactElement) => {
logViews: {
client: {},
},
observability: {
observabilityShared: {
navigation: {
PageTemplate: KibanaPageTemplate,
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import React, { useCallback, useEffect } from 'react';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { isJobStatusWithResults } from '../../../../common/log_analysis';
import { LoadingPage } from '../../../components/loading_page';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { i18n } from '@kbn/i18n';
import React, { memo, useCallback, useEffect } from 'react';
import useInterval from 'react-use/lib/useInterval';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { isJobStatusWithResults } from '../../../../common/log_analysis';
import { LoadingPage } from '../../../components/loading_page';
import {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React from 'react';
import { i18n } from '@kbn/i18n';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { NoDataConfig } from '@kbn/shared-ux-page-kibana-template';
import { useKibanaContextForPlugin } from '../../../hooks/use_kibana';
Expand All @@ -25,7 +25,7 @@ export const LogsPageTemplate: React.FC<LogsPageTemplateProps> = ({
}) => {
const {
services: {
observability: {
observabilityShared: {
navigation: { PageTemplate },
},
docLinks,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/pages/metrics/page_template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import type { NoDataConfig } from '@kbn/shared-ux-page-kibana-template';
import React from 'react';
import {
Expand All @@ -26,7 +26,7 @@ export const MetricsPageTemplate: React.FC<MetricsPageTemplateProps> = ({
}) => {
const {
services: {
observability: {
observabilityShared: {
navigation: { PageTemplate },
},
docLinks,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/infra/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class Plugin implements InfraClientPluginClass {
{ label: 'Metrics Explorer', app: 'metrics', path: '/explorer' },
{ label: 'Hosts', isTechnicalPreview: true, app: 'metrics', path: '/hosts' },
];
pluginsSetup.observability.navigation.registerSections(
pluginsSetup.observabilityShared.navigation.registerSections(
startDep$AndHostViewFlag$.pipe(
map(
([
Expand Down
6 changes: 6 additions & 0 deletions x-pack/plugins/infra/public/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ import type {
ObservabilityPublicSetup,
ObservabilityPublicStart,
} from '@kbn/observability-plugin/public';
import type {
ObservabilitySharedPluginSetup,
ObservabilitySharedPluginStart,
} from '@kbn/observability-shared-plugin/public';
// import type { OsqueryPluginStart } from '../../osquery/public';
import type { SpacesPluginStart } from '@kbn/spaces-plugin/public';
import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
Expand Down Expand Up @@ -61,6 +65,7 @@ export interface InfraClientStartExports {
export interface InfraClientSetupDeps {
home?: HomePublicPluginSetup;
observability: ObservabilityPublicSetup;
observabilityShared: ObservabilitySharedPluginSetup;
triggersActionsUi: TriggersAndActionsUIPublicPluginSetup;
usageCollection: UsageCollectionSetup;
ml: MlPluginSetup;
Expand All @@ -78,6 +83,7 @@ export interface InfraClientStartDeps {
lens: LensPublicStart;
ml: MlPluginStart;
observability: ObservabilityPublicStart;
observabilityShared: ObservabilitySharedPluginStart;
osquery?: unknown; // OsqueryPluginStart;
share: SharePluginStart;
spaces: SpacesPluginStart;
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugins/infra/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@kbn/shared-ux-router",
"@kbn/shared-ux-link-redirect-app",
"@kbn/observability-alert-details",
"@kbn/observability-shared-plugin",
"@kbn/ui-theme"
],
"exclude": ["target/**/*"]
Expand Down

0 comments on commit 5464614

Please sign in to comment.