Skip to content

Commit

Permalink
[Kibana utils] Remove setVersion() util (#174064)
Browse files Browse the repository at this point in the history
## Summary

Removes unused `setVersion()` utility.

---------

Co-authored-by: Kibana Machine <[email protected]>
  • Loading branch information
vadimkibana and kibanamachine authored Jan 2, 2024
1 parent da0370e commit a7380e8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 105 deletions.
5 changes: 2 additions & 3 deletions src/plugins/kibana_utils/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
* Side Public License, v 1.
*/

import { PluginInitializerContext } from '@kbn/core/public';
import { KibanaUtilsPublicPlugin } from './plugin';

export type { Get, Set } from '../common';
Expand Down Expand Up @@ -114,6 +113,6 @@ export { applyDiff } from './state_management/utils/diff_object';

export type { KibanaUtilsPublicSetup as KibanaUtilsSetup, KibanaUtilsPublicStart } from './plugin';

export function plugin(initializerContext: PluginInitializerContext) {
return new KibanaUtilsPublicPlugin(initializerContext);
export function plugin() {
return new KibanaUtilsPublicPlugin();
}
4 changes: 1 addition & 3 deletions src/plugins/kibana_utils/public/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export type Setup = jest.Mocked<KibanaUtilsPublicSetup>;
export type Start = jest.Mocked<KibanaUtilsPublicStart>;

const createSetupContract = (): Setup => {
return {
setVersion: jest.fn(),
};
return undefined;
};

const createStartContract = (): Start => {
Expand Down
22 changes: 3 additions & 19 deletions src/plugins/kibana_utils/public/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
* Side Public License, v 1.
*/

import { PluginInitializerContext, CoreSetup, CoreStart, Plugin } from '@kbn/core/public';
import { History } from 'history';
import { setVersion } from './set_version';
import { CoreSetup, CoreStart, Plugin } from '@kbn/core/public';

export interface KibanaUtilsPublicSetup {
setVersion: (history: Pick<History, 'location' | 'replace'>) => void;
}
export type KibanaUtilsPublicSetup = undefined;

export type KibanaUtilsPublicStart = undefined;

Expand All @@ -31,25 +27,13 @@ export class KibanaUtilsPublicPlugin
KibanaUtilsPublicStartDependencies
>
{
private readonly version: string;

constructor(initializerContext: PluginInitializerContext) {
this.version = initializerContext.env.packageInfo.version;
}

public setup(_core: CoreSetup): KibanaUtilsPublicSetup {
return {
setVersion: this.setVersion,
};
return undefined;
}

public start(_core: CoreStart): KibanaUtilsPublicStart {
return undefined;
}

public stop() {}

private setVersion = (history: Pick<History, 'location' | 'replace'>) => {
setVersion(history, this.version);
};
}
59 changes: 0 additions & 59 deletions src/plugins/kibana_utils/public/set_version.test.ts

This file was deleted.

21 changes: 0 additions & 21 deletions src/plugins/kibana_utils/public/set_version.ts

This file was deleted.

0 comments on commit a7380e8

Please sign in to comment.