[Serverless Search] Disable Grok debugger & Painless Lab (#165772)

## Summary

Updated the grok debugger and painless lab plugins to handle the
`enabled` config flag so they can easily be disabled for serverless
search.

### Screenshots
Before:

![image](7552954b-11f1-4c6f-9007-148a8c765c3f)

After:
<img width="1914" alt="image"
src="ad48ba1b-0f1d-4da3-aeac-4868781f6832">
This commit is contained in:
Rodney Norris 2023-09-07 17:26:23 -05:00 committed by GitHub
parent 4eb45e67c0
commit 2490b5dec6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 8 deletions

View file

@ -31,3 +31,7 @@ xpack.actions.enabledActionTypes: ['.email', '.index', '.slack', '.jira', '.webh
# Customize empty page state for analytics apps
no_data_page.analyticsNoDataPageFlavor: 'serverless_search'
# Disable Dev tools
xpack.grokdebugger.enabled: false
xpack.painless_lab.enabled: false

View file

@ -5,8 +5,10 @@
* 2.0.
*/
import { Plugin } from './plugin';
import { Plugin, config } from './plugin';
export function plugin(initializerContext) {
return new Plugin(initializerContext);
export function plugin() {
return new Plugin();
}
export { config };

View file

@ -5,13 +5,15 @@
* 2.0.
*/
import { schema } from '@kbn/config-schema';
import { offeringBasedSchema, schema } from '@kbn/config-schema';
import { KibanaFramework } from './lib/kibana_framework';
import { registerGrokdebuggerRoutes } from './routes/api/grokdebugger';
export const config = {
schema: schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: true }),
}),
}),
};

View file

@ -5,9 +5,21 @@
* 2.0.
*/
import { PluginInitializerContext } from '@kbn/core/server';
import { offeringBasedSchema, schema, TypeOf } from '@kbn/config-schema';
import { PluginInitializerContext, PluginConfigDescriptor } from '@kbn/core/server';
import { PainlessLabServerPlugin } from './plugin';
export const configSchema = schema.object({
enabled: offeringBasedSchema({
serverless: schema.boolean({ defaultValue: true }),
}),
});
export type ConfigType = TypeOf<typeof configSchema>;
export const config: PluginConfigDescriptor<ConfigType> = {
schema: configSchema,
};
export const plugin = (ctx: PluginInitializerContext) => {
return new PainlessLabServerPlugin(ctx);
};

View file

@ -18,10 +18,8 @@
"dashboard",
"devTools",
"discover",
"grokdebugger",
"management",
"ml",
"painlessLab",
"searchprofiler",
"security",
"serverless",