mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Dataset quality] Adding execution context to data quality page within management app (#189272)
This PR aims to improve `context.page_name` within stack telemetry. After the changes we will start seeing information about dataset quality in `application:management:data_quality` rather than just a generic pageName such as `application:management`. <img width="1728" alt="image" src="https://github.com/user-attachments/assets/d172353a-824d-46f7-8d5e-7c564375827a">
This commit is contained in:
parent
218146ee69
commit
7bb17aefc3
1 changed files with 30 additions and 9 deletions
|
@ -12,10 +12,12 @@ import ReactDOM from 'react-dom';
|
|||
import { KibanaRenderContextProvider } from '@kbn/react-kibana-context-render';
|
||||
import { Route, Router, Routes } from '@kbn/shared-ux-router';
|
||||
import { PerformanceContextProvider } from '@kbn/ebt-tools';
|
||||
import { useExecutionContext } from '@kbn/kibana-react-plugin/public';
|
||||
import { KbnUrlStateStorageFromRouterProvider } from './utils/kbn_url_state_context';
|
||||
import { useKibanaContextForPluginProvider } from './utils/use_kibana';
|
||||
import { AppPluginStartDependencies, DataQualityPluginStart } from './types';
|
||||
import { DatasetQualityRoute } from './routes';
|
||||
import { PLUGIN_ID } from '../common';
|
||||
|
||||
export const renderApp = (
|
||||
core: CoreStart,
|
||||
|
@ -33,6 +35,33 @@ export const renderApp = (
|
|||
};
|
||||
};
|
||||
|
||||
const AppWithExecutionContext = ({
|
||||
core,
|
||||
params,
|
||||
}: {
|
||||
core: CoreStart;
|
||||
params: ManagementAppMountParams;
|
||||
}) => {
|
||||
const { executionContext } = core;
|
||||
|
||||
useExecutionContext(executionContext, {
|
||||
type: 'application',
|
||||
page: PLUGIN_ID,
|
||||
});
|
||||
|
||||
return (
|
||||
<KbnUrlStateStorageFromRouterProvider>
|
||||
<Router history={params.history}>
|
||||
<PerformanceContextProvider>
|
||||
<Routes>
|
||||
<Route path="/" exact={true} render={() => <DatasetQualityRoute />} />
|
||||
</Routes>
|
||||
</PerformanceContextProvider>
|
||||
</Router>
|
||||
</KbnUrlStateStorageFromRouterProvider>
|
||||
);
|
||||
};
|
||||
|
||||
interface AppProps {
|
||||
core: CoreStart;
|
||||
plugins: AppPluginStartDependencies;
|
||||
|
@ -51,15 +80,7 @@ const App = ({ core, plugins, pluginStart, params }: AppProps) => {
|
|||
return (
|
||||
<KibanaRenderContextProvider {...core} {...params}>
|
||||
<KibanaContextProviderForPlugin>
|
||||
<KbnUrlStateStorageFromRouterProvider>
|
||||
<Router history={params.history}>
|
||||
<PerformanceContextProvider>
|
||||
<Routes>
|
||||
<Route path="/" exact={true} render={() => <DatasetQualityRoute />} />
|
||||
</Routes>
|
||||
</PerformanceContextProvider>
|
||||
</Router>
|
||||
</KbnUrlStateStorageFromRouterProvider>
|
||||
<AppWithExecutionContext core={core} params={params} />
|
||||
</KibanaContextProviderForPlugin>
|
||||
</KibanaRenderContextProvider>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue