Skip to content

Commit

Permalink
[Synthetics][Ux][Uptime] Use Observability Page Template from Observa…
Browse files Browse the repository at this point in the history
…bility Shared (#154774)

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Shahzad <shahzad31comp@gmail.com>
  • Loading branch information
3 people authored Apr 18, 2023

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
1 parent d694a0d commit 88f4f80
Showing 43 changed files with 209 additions and 108 deletions.
2 changes: 1 addition & 1 deletion x-pack/examples/exploratory_view_example/public/app.tsx
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ export const App = (props: {
plugins: StartDependencies;
defaultIndexPattern: DataView | null;
}) => {
const ExploratoryViewComponent = props.plugins.observability.ExploratoryViewEmbeddable;
const ExploratoryViewComponent = props.plugins.exploratoryView.ExploratoryViewEmbeddable;

const seriesList: AllSeries = [
{
3 changes: 1 addition & 2 deletions x-pack/plugins/exploratory_view/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
"guidedOnboarding",
"inspector",
"lens",
"observability",
"observabilityShared",
"security",
"share",
"triggersActionsUi",
@@ -32,7 +32,6 @@
"kibanaReact",
"kibanaUtils",
"lens",
"observability",
"unifiedSearch",
"visualizations"
],
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
XYState,
} from '@kbn/lens-plugin/public';
import { ViewMode } from '@kbn/embeddable-plugin/common';
import { observabilityFeatureId } from '@kbn/observability-plugin/public';
import { observabilityFeatureId } from '@kbn/observability-shared-plugin/public';
import styled from 'styled-components';
import { useKibanaSpace } from '../../../../hooks/use_kibana_space';
import { HeatMapLensAttributes } from '../configurations/lens_attributes/heatmap_attributes';
Original file line number Diff line number Diff line change
@@ -11,11 +11,11 @@ import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import type { CoreStart } from '@kbn/core/public';
import { KibanaContextProvider } from '@kbn/kibana-react-plugin/public';
import { EuiErrorBoundary } from '@elastic/eui';
import { useFetcher } from '@kbn/observability-plugin/public';
import styled from 'styled-components';
import { DataView } from '@kbn/data-views-plugin/common';
import { FormulaPublicApi } from '@kbn/lens-plugin/public';
import { i18n } from '@kbn/i18n';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { useAppDataView } from './use_app_data_view';
import type { ExploratoryViewPublicPluginsStart } from '../../../..';
import type { ExploratoryEmbeddableProps, ExploratoryEmbeddableComponentProps } from './embeddable';
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

import { useState } from 'react';
import { DataView } from '@kbn/data-views-plugin/common';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { useLocalDataView } from './use_local_data_view';
import { ExploratoryEmbeddableProps, ExploratoryViewPublicPluginsStart } from '../../../..';
import type { DataViewState } from '../hooks/use_app_data_view';
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

import { useEffect } from 'react';
import useLocalStorage from 'react-use/lib/useLocalStorage';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { getDataTypeIndices } from '../../../../utils/observability_data_views';
import { AppDataType } from '../types';
import { ExploratoryEmbeddableProps } from '../../../..';
Original file line number Diff line number Diff line change
@@ -15,7 +15,10 @@ import {
GetAllCasesSelectorModalProps,
} from '@kbn/cases-plugin/public';
import { TypedLensByValueInput } from '@kbn/lens-plugin/public';
import { observabilityFeatureId, observabilityAppId } from '@kbn/observability-plugin/public';
import {
observabilityFeatureId,
observabilityAppId,
} from '@kbn/observability-shared-plugin/public';
import { useGetUserCasesPermissions } from '../../../../hooks/use_get_user_cases_permissions';
import { ObservabilityAppServices } from '../../../../application/types';
import { useAddToCase } from '../hooks/use_add_to_case';
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@ import { HttpSetup, MountPoint } from '@kbn/core/public';
import { Case } from '@kbn/cases-plugin/common';
import { TypedLensByValueInput } from '@kbn/lens-plugin/public';
import { CasesDeepLinkId, DRAFT_COMMENT_STORAGE_ID } from '@kbn/cases-plugin/public';
import { observabilityFeatureId } from '@kbn/observability-plugin/public';
import { observabilityFeatureId } from '@kbn/observability-shared-plugin/public';
import { useKibana } from '../../../../utils/kibana_react';
import { AddToCaseProps } from '../header/add_to_case_action';

Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@

import { useMemo } from 'react';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from '../../../../hooks/use_fetcher';
import { ExploratoryViewPublicPluginsStart } from '../../../..';

export const useLensFormulaHelper = () => {
Original file line number Diff line number Diff line change
@@ -15,7 +15,7 @@ import {
createSessionStorageStateStorage,
} from '@kbn/kibana-utils-plugin/public';
import { TypedLensByValueInput } from '@kbn/lens-plugin/public';
import { useTrackPageview } from '@kbn/observability-plugin/public';
import { useTrackPageview } from '../../../hooks/use_track_metric';
import { ExploratoryView } from './exploratory_view';
import { ExploratoryViewPublicPluginsStart } from '../../../plugin';
import { useBreadcrumbs } from '../../../hooks/use_breadcrumbs';
@@ -39,12 +39,12 @@ export function ExploratoryViewPage({
useSessionStorage = false,
}: ExploratoryViewPageProps) {
const {
services: { uiSettings, notifications, observability },
services: { uiSettings, notifications, observabilityShared },
} = useKibana<ExploratoryViewPublicPluginsStart>();

const history = useHistory();

const ObservabilityPageTemplate = observability.navigation.PageTemplate;
const ObservabilityPageTemplate = observabilityShared.navigation.PageTemplate;

useTrackPageview({ app: 'observability-overview', path: 'exploratory-view' });
useTrackPageview({
Original file line number Diff line number Diff line change
@@ -9,7 +9,7 @@ import React, { useState } from 'react';
import { EuiPopover, EuiToolTip, EuiButtonEmpty, EuiIcon } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from '../../../../../hooks/use_fetcher';
import { ExploratoryViewPublicPluginsStart } from '../../../../../plugin';
import { SeriesUrl } from '../../../../..';
import { SeriesConfig } from '../../types';
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ import { EuiFlexGroup, EuiFlexItem, EuiFormRow, EuiIcon, EuiSuperSelect } from '
import { i18n } from '@kbn/i18n';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { SeriesType } from '@kbn/lens-plugin/public';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from '../../../../../hooks/use_fetcher';
import { ExploratoryViewPublicPluginsStart } from '../../../../../plugin';
import { SeriesUrl } from '../../../../..';
import { useSeriesStorage } from '../../hooks/use_series_storage';
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@ import type { DatePickerProps } from './date_picker';
import type { FilterValueLabelProps } from './filter_value_label/filter_value_label';
import type { SelectableUrlListProps } from './exploratory_view/components/url_search/selectable_url_list';
import type { ExploratoryViewPageProps } from './exploratory_view';
export type { LazyObservabilityPageTemplateProps } from '@kbn/observability-plugin/public';
export type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';

const CoreVitalsLazy = lazy(() => import('./core_web_vitals'));

Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
*/
import type { Space } from '@kbn/spaces-plugin/common';
import { useKibana } from '@kbn/kibana-react-plugin/public';
import { useFetcher } from '@kbn/observability-plugin/public';
import { useFetcher } from './use_fetcher';
import { ExploratoryViewPublicPluginsStart } from '..';

export const useKibanaSpace = () => {
9 changes: 3 additions & 6 deletions x-pack/plugins/exploratory_view/public/plugin.ts
Original file line number Diff line number Diff line change
@@ -18,6 +18,7 @@ import {
Plugin as PluginClass,
PluginInitializerContext,
} from '@kbn/core/public';
import type { ObservabilitySharedPluginStart } from '@kbn/observability-shared-plugin/public';
import type { DataPublicPluginSetup, DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { DataViewsPublicPluginStart } from '@kbn/data-views-plugin/public';
import type { DiscoverStart } from '@kbn/discover-plugin/public';
@@ -36,10 +37,6 @@ import { GuidedOnboardingPluginStart } from '@kbn/guided-onboarding-plugin/publi
import { SpacesPluginStart } from '@kbn/spaces-plugin/public';
import { LicensingPluginStart } from '@kbn/licensing-plugin/public';
import { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/public';
import {
ObservabilityPublicSetup,
ObservabilityPublicStart,
} from '@kbn/observability-plugin/public';
import { getExploratoryViewEmbeddable } from './components/shared/exploratory_view/embeddable';
import { createExploratoryViewUrl } from './components/shared/exploratory_view/configurations/exploratory_view_url';
import getAppDataView from './utils/observability_data_views/get_app_data_view';
@@ -48,7 +45,6 @@ import { APP_ROUTE } from './constants';

export interface ExploratoryViewPublicPluginsSetup {
data: DataPublicPluginSetup;
observability: ObservabilityPublicSetup;
share: SharePluginSetup;
triggersActionsUi: TriggersAndActionsUIPublicPluginSetup;
usageCollection: UsageCollectionSetup;
@@ -62,10 +58,11 @@ export interface ExploratoryViewPublicPluginsStart {
dataViews: DataViewsPublicPluginStart;
discover: DiscoverStart;
embeddable: EmbeddableStart;

guidedOnboarding: GuidedOnboardingPluginStart;
lens: LensPublicStart;
licensing: LicensingPluginStart;
observability: ObservabilityPublicStart;
observabilityShared: ObservabilitySharedPluginStart;
security: SecurityPluginStart;
share: SharePluginStart;
spaces?: SpacesPluginStart;
2 changes: 1 addition & 1 deletion x-pack/plugins/exploratory_view/tsconfig.json
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@
"@kbn/charts-plugin",
"@kbn/shared-ux-router",
"@kbn/core-application-browser",
"@kbn/observability-plugin"
"@kbn/observability-shared-plugin"
],
"exclude": ["target/**/*"]
}
28 changes: 7 additions & 21 deletions x-pack/plugins/observability/kibana.jsonc
Original file line number Diff line number Diff line change
@@ -13,36 +13,22 @@
"charts",
"data",
"dataViews",
"embeddable",
"features",
"files",
"guidedOnboarding",
"inspector",
"lens",
"observabilityShared",
"ruleRegistry",
"triggersActionsUi",
"inspector",
"unifiedSearch",
"security",
"guidedOnboarding",
"share"
],
"optionalPlugins": [
"discover",
"embeddable",
"home",
"lens",
"licensing",
"spaces",
"usageCollection"
],
"requiredBundles": [
"share",
"unifiedSearch",
"data",
"dataViews",
"embeddable",
"kibanaReact",
"kibanaUtils",
"lens",
"visualizations"
],
"optionalPlugins": ["discover", "home", "licensing", "spaces", "usageCollection"],
"requiredBundles": ["data", "kibanaReact", "kibanaUtils", "unifiedSearch"],
"extraPublicDirs": ["common"]
}
}
2 changes: 1 addition & 1 deletion x-pack/plugins/observability/public/application/index.tsx
Original file line number Diff line number Diff line change
@@ -14,14 +14,14 @@ import { i18n } from '@kbn/i18n';
import { Route } from '@kbn/shared-ux-router';
import { AppMountParameters, APP_WRAPPER_CLASS, CoreStart } from '@kbn/core/public';
import { EuiThemeProvider } from '@kbn/kibana-react-plugin/common';
import type { LazyObservabilityPageTemplateProps } from '@kbn/observability-shared-plugin/public';
import {
KibanaContextProvider,
KibanaThemeProvider,
RedirectAppLinks,
} from '@kbn/kibana-react-plugin/public';
import { Storage } from '@kbn/kibana-utils-plugin/public';
import { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import type { LazyObservabilityPageTemplateProps } from '../components/shared/page_template/lazy_page_template';
import { HasDataContextProvider } from '../context/has_data_context';
import { PluginContext } from '../context/plugin_context';
import { ConfigSchema, ObservabilityPublicPluginsStart } from '../plugin';
Loading

0 comments on commit 88f4f80

Please sign in to comment.