mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Console] Remove unused function (#159041)
## Summary
While working on https://github.com/elastic/kibana/issues/159410, I
noticed that there are some unused functions in the Console server side
plugin contracts. This PR removes the function `addProcessorDefinition`
from the `start` contract. I was not able to find any uses of this
function in the Kibana code. I believe it might have been planned to be
used for ingest processors but currently we use the `_processor`
endpoint for that (see
[here](6f94e42a32/src/plugins/console/server/lib/spec_definitions/js/ingest.ts (LL605C15-L605C37)
)).
And since the tests also pass I think it's safe to remove this function.
I'm using the label `release_note:breaking` because the plugin's
contracts are public and theoretically it's possible that there are some
external plugins that use that function.
### Release note
The function `addProcessorDefinition` is removed from the Console plugin
start contract (server side).
This commit is contained in:
parent
863f6bdb8b
commit
87e31ce7b6
2 changed files with 1 additions and 15 deletions
|
@ -83,9 +83,7 @@ export class ConsoleServerPlugin implements Plugin<ConsoleSetup, ConsoleStart> {
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start() {
|
||||||
return {
|
this.specDefinitionsService.start();
|
||||||
...this.specDefinitionsService.start(),
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop() {
|
||||||
|
|
|
@ -87,15 +87,6 @@ export class SpecDefinitionsService {
|
||||||
this.extensionSpecFilePaths.push(path);
|
this.extensionSpecFilePaths.push(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
public addProcessorDefinition(processor: unknown) {
|
|
||||||
if (!this.hasLoadedSpec) {
|
|
||||||
throw new Error(
|
|
||||||
'Cannot add a processor definition because spec definitions have not loaded!'
|
|
||||||
);
|
|
||||||
}
|
|
||||||
this.endpoints._processor!.data_autocomplete_rules.__one_of.push(processor);
|
|
||||||
}
|
|
||||||
|
|
||||||
public setup() {
|
public setup() {
|
||||||
return {
|
return {
|
||||||
addExtensionSpecFilePath: this.addExtensionSpecFilePath.bind(this),
|
addExtensionSpecFilePath: this.addExtensionSpecFilePath.bind(this),
|
||||||
|
@ -107,9 +98,6 @@ export class SpecDefinitionsService {
|
||||||
this.loadJsonSpec();
|
this.loadJsonSpec();
|
||||||
this.loadJSSpec();
|
this.loadJSSpec();
|
||||||
this.hasLoadedSpec = true;
|
this.hasLoadedSpec = true;
|
||||||
return {
|
|
||||||
addProcessorDefinition: this.addProcessorDefinition.bind(this),
|
|
||||||
};
|
|
||||||
} else {
|
} else {
|
||||||
throw new Error('Service has already started!');
|
throw new Error('Service has already started!');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue