Skip to content

Commit

Permalink
Make KibanaEnv optional in common providers
Browse files Browse the repository at this point in the history
  • Loading branch information
jennypavlova committed Jan 5, 2024
1 parent c576542 commit bba1419
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 16 deletions.
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/apps/common_providers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ export interface CoreProvidersProps {
pluginStart: InfraClientStartExports;
plugins: InfraClientStartDeps;
theme$: AppMountParameters['theme$'];
kibanaEnvironment: KibanaEnvContext;
kibanaEnvironment?: KibanaEnvContext;
}

export const CoreProviders: React.FC<CoreProvidersProps> = ({
children,
core,
pluginStart,
kibanaEnvironment,
plugins,
theme$,
kibanaEnvironment,
}) => {
const KibanaContextProviderForPlugin = useKibanaContextForPluginProvider(
core,
Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/infra/public/apps/metrics_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const METRICS_APP_DATA_TEST_SUBJ = 'infraMetricsPage';
export const renderApp = (
core: CoreStart,
plugins: InfraClientStartDeps,
kibanaEnvironment: KibanaEnvContext,
pluginStart: InfraClientStartExports,
pluginConfig: InfraPublicConfig,
{ element, history, setHeaderActionMenu, theme$ }: AppMountParameters
{ element, history, setHeaderActionMenu, theme$ }: AppMountParameters,
kibanaEnvironment: KibanaEnvContext
) => {
const storage = new Storage(window.localStorage);

Expand Down
17 changes: 5 additions & 12 deletions x-pack/plugins/infra/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -314,18 +314,11 @@ export class Plugin implements InfraClientPluginClass {

const isCloudEnv = !!pluginsSetup.cloud?.isCloudEnabled;
const isServerlessEnv = pluginsSetup.cloud?.isServerlessEnabled || this.isServerlessEnv;
return renderApp(
coreStart,
{ ...plugins },
{
kibanaVersion: this.kibanaVersion,
isCloudEnv,
isServerlessEnv,
},
pluginStart,
this.config,
params
);
return renderApp(coreStart, { ...plugins }, pluginStart, this.config, params, {
kibanaVersion: this.kibanaVersion,
isCloudEnv,
isServerlessEnv,
});
},
});

Expand Down

0 comments on commit bba1419

Please sign in to comment.