mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Application Usage] Remove deprecated & unused legacy.appChanged API (#91464)
This commit is contained in:
parent
e972f5124b
commit
bc207ff2da
2 changed files with 6 additions and 22 deletions
|
@ -36,9 +36,6 @@ const createSetupContract = (): Setup => {
|
|||
allowTrackUserAgent: jest.fn(),
|
||||
reportUiCounter: jest.fn(),
|
||||
METRIC_TYPE,
|
||||
__LEGACY: {
|
||||
appChanged: jest.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
return setupContract;
|
||||
|
|
|
@ -7,17 +7,17 @@
|
|||
*/
|
||||
|
||||
import { Reporter, METRIC_TYPE, ApplicationUsageTracker } from '@kbn/analytics';
|
||||
import { Subject, merge, Subscription } from 'rxjs';
|
||||
import type { Subscription } from 'rxjs';
|
||||
import React from 'react';
|
||||
import { Storage } from '../../kibana_utils/public';
|
||||
import { createReporter, trackApplicationUsageChange } from './services';
|
||||
import {
|
||||
import type {
|
||||
PluginInitializerContext,
|
||||
Plugin,
|
||||
CoreSetup,
|
||||
CoreStart,
|
||||
HttpSetup,
|
||||
} from '../../../core/public';
|
||||
} from 'src/core/public';
|
||||
import { Storage } from '../../kibana_utils/public';
|
||||
import { createReporter, trackApplicationUsageChange } from './services';
|
||||
import { ApplicationUsageContext } from './components/track_application_view';
|
||||
|
||||
export interface PublicConfigType {
|
||||
|
@ -39,15 +39,6 @@ export interface UsageCollectionSetup {
|
|||
applicationUsageTracker: IApplicationUsageTracker;
|
||||
reportUiCounter: Reporter['reportUiCounter'];
|
||||
METRIC_TYPE: typeof METRIC_TYPE;
|
||||
__LEGACY: {
|
||||
/**
|
||||
* Legacy handler so we can report the actual app being used inside "kibana#/{appId}".
|
||||
* To be removed when we get rid of the legacy world
|
||||
*
|
||||
* @deprecated
|
||||
*/
|
||||
appChanged: (appId: string) => void;
|
||||
};
|
||||
}
|
||||
|
||||
export interface UsageCollectionStart {
|
||||
|
@ -65,7 +56,6 @@ export function isUnauthenticated(http: HttpSetup) {
|
|||
}
|
||||
|
||||
export class UsageCollectionPlugin implements Plugin<UsageCollectionSetup, UsageCollectionStart> {
|
||||
private readonly legacyAppId$ = new Subject<string>();
|
||||
private applicationUsageTracker?: ApplicationUsageTracker;
|
||||
private trackUserAgent: boolean = true;
|
||||
private subscriptions: Subscription[] = [];
|
||||
|
@ -103,9 +93,6 @@ export class UsageCollectionPlugin implements Plugin<UsageCollectionSetup, Usage
|
|||
},
|
||||
reportUiCounter: this.reporter.reportUiCounter,
|
||||
METRIC_TYPE,
|
||||
__LEGACY: {
|
||||
appChanged: (appId) => this.legacyAppId$.next(appId),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -118,7 +105,7 @@ export class UsageCollectionPlugin implements Plugin<UsageCollectionSetup, Usage
|
|||
this.reporter.start();
|
||||
this.applicationUsageTracker.start();
|
||||
this.subscriptions = trackApplicationUsageChange(
|
||||
merge(application.currentAppId$, this.legacyAppId$),
|
||||
application.currentAppId$,
|
||||
this.applicationUsageTracker
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue