Skip to content

Commit

Permalink
Revert "initialize licensing plugin during start instead of setup (de…
Browse files Browse the repository at this point in the history
…precated)"

This reverts commit b5a2197.
  • Loading branch information
miloszmarcinkowski committed Nov 27, 2024
1 parent b5a2197 commit 03bfc4a
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const renderApp = ({
observabilityAIAssistant: pluginsStart.observabilityAIAssistant,
share: pluginsSetup.share,
kibanaEnvironment,
licensing: pluginsStart.licensing,
};

// render APM feedback link in global help menu
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import type { DataPublicPluginStart } from '@kbn/data-plugin/public';
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import type { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public';
import { SharePluginSetup } from '@kbn/share-plugin/public';
import type { LicensingPluginStart } from '@kbn/licensing-plugin/public';
import type { ApmPluginSetupDeps } from '../../plugin';
import type { ConfigSchema } from '../..';
import type { KibanaEnvContext } from '../kibana_environment_context/kibana_environment_context';
Expand All @@ -41,7 +40,6 @@ export interface ApmPluginContextValue {
share: SharePluginSetup;
kibanaEnvironment: KibanaEnvContext;
lens: LensPublicStart;
licensing: LicensingPluginStart;
}

export const ApmPluginContext = createContext({} as ApmPluginContextValue);
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { InvalidLicenseNotification } from './invalid_license_notification';
export const LicenseContext = React.createContext<ILicense | undefined>(undefined);

export function LicenseProvider({ children }: { children: React.ReactChild }) {
const { licensing } = useApmPluginContext();
const { plugins } = useApmPluginContext();
const { licensing } = plugins;
const license = useObservable(licensing.license$);
// if license is not loaded yet, consider it valid
const hasInvalidLicense = license?.isActive === false;
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/observability_solution/apm/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import { Start as InspectorPluginStart } from '@kbn/inspector-plugin/public';
import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
import { LensPublicStart } from '@kbn/lens-plugin/public';
import { LicenseManagementUIPluginSetup } from '@kbn/license-management-plugin/public';
import type { LicensingPluginSetup } from '@kbn/licensing-plugin/public';
import type { MapsStartApi } from '@kbn/maps-plugin/public';
import type { MlPluginSetup, MlPluginStart } from '@kbn/ml-plugin/public';
import type {
Expand Down Expand Up @@ -69,7 +70,6 @@ import { map } from 'rxjs';
import type { CloudSetup } from '@kbn/cloud-plugin/public';
import type { ServerlessPluginStart } from '@kbn/serverless/public';
import { LogsSharedClientStartExports } from '@kbn/logs-shared-plugin/public';
import type { LicensingPluginStart } from '@kbn/licensing-plugin/public';
import type { ConfigSchema } from '.';
import { registerApmRuleTypes } from './components/alerting/rule_types/register_apm_rule_types';
import { registerEmbeddables } from './embeddable/register_embeddables';
Expand All @@ -96,6 +96,7 @@ export interface ApmPluginSetupDeps {
unifiedSearch: UnifiedSearchPublicPluginStart;
features: FeaturesPluginSetup;
home?: HomePublicPluginSetup;
licensing: LicensingPluginSetup;
licenseManagement?: LicenseManagementUIPluginSetup;
ml?: MlPluginSetup;
observability: ObservabilityPublicSetup;
Expand All @@ -121,7 +122,7 @@ export interface ApmPluginStartDeps {
embeddable: EmbeddableStart;
home: void;
inspector: InspectorPluginStart;
licensing: LicensingPluginStart;
licensing: void;
maps?: MapsStartApi;
ml?: MlPluginStart;
triggersActionsUi: TriggersAndActionsUIPublicPluginStart;
Expand Down

0 comments on commit 03bfc4a

Please sign in to comment.