Skip to content

Commit

Permalink
Move investigate app behind feature flag
Browse files Browse the repository at this point in the history
  • Loading branch information
kdelemme committed Jul 26, 2024
1 parent 9bc5741 commit 19ae164
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import { css } from '@emotion/css';
import {
AppMountParameters,
AppStatus,
APP_WRAPPER_CLASS,
CoreSetup,
CoreStart,
Expand Down Expand Up @@ -41,28 +42,32 @@ export class InvestigateAppPlugin
>
{
logger: Logger;
config: ConfigSchema;

constructor(context: PluginInitializerContext<ConfigSchema>) {
this.logger = context.logger.get();
this.config = context.config.get();
}

setup(
coreSetup: CoreSetup<InvestigateAppStartDependencies, InvestigateAppPublicStart>,
pluginsSetup: InvestigateAppSetupDependencies
): InvestigateAppPublicSetup {
coreSetup.application.register({
id: INVESTIGATE_APP_ID,
title: i18n.translate('xpack.investigateApp.appTitle', {
defaultMessage: 'Observability AI Assistant',
defaultMessage: 'Observability Investigate',
}),
euiIconType: 'logoObservability',
appRoute: '/app/investigate',
category: DEFAULT_APP_CATEGORIES.observability,
status: this.config.enabled ? AppStatus.accessible : AppStatus.inaccessible,
visibleIn: [],
deepLinks: [
{
id: 'investigate',
title: i18n.translate('xpack.investigateApp.investigateDeepLinkTitle', {
defaultMessage: 'Investigate',
title: i18n.translate('xpack.investigateApp.newInvestigateDeepLinkTitle', {
defaultMessage: 'New investigation',
}),
path: '/new',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ import type { UnifiedSearchPublicPluginStart } from '@kbn/unified-search-plugin/

/* eslint-disable @typescript-eslint/no-empty-interface*/

export interface ConfigSchema {}
export interface ConfigSchema {
enabled: boolean;
}

export interface InvestigateAppSetupDependencies {
investigate: InvestigatePublicSetup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import { schema, type TypeOf } from '@kbn/config-schema';

export const config = schema.object({
enabled: schema.boolean({ defaultValue: true }),
enabled: schema.boolean({ defaultValue: false }),
});

export type InvestigateAppConfig = TypeOf<typeof config>;
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,32 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import type { PluginInitializer, PluginInitializerContext } from '@kbn/core/server';
import { InvestigateAppConfig } from './config';

import type {
PluginConfigDescriptor,
PluginInitializer,
PluginInitializerContext,
} from '@kbn/core/server';
import type { InvestigateAppConfig } from './config';
import { InvestigateAppPlugin } from './plugin';
import type {
InvestigateAppServerSetup,
InvestigateAppServerStart,
InvestigateAppSetupDependencies,
InvestigateAppStartDependencies,
} from './types';
import { config as configSchema } from './config';

export type { InvestigateAppServerRouteRepository } from './routes/get_global_investigate_app_server_route_repository';

export type { InvestigateAppServerSetup, InvestigateAppServerStart };

export const config: PluginConfigDescriptor<InvestigateAppConfig> = {
schema: configSchema,
exposeToBrowser: {
enabled: true,
},
};

export const plugin: PluginInitializer<
InvestigateAppServerSetup,
InvestigateAppServerStart,
Expand Down

0 comments on commit 19ae164

Please sign in to comment.