Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[Discover][Obs ai assistant] Set the index pattern on the context api to generate correct ES|QL queries etc (#181001)" #182088

Merged
merged 1 commit into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/plugins/discover/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@
"savedObjectsTaggingOss",
"lens",
"noDataPage",
"globalSearch",
"observabilityAIAssistant"
"globalSearch"
],
"requiredBundles": ["kibanaUtils", "kibanaReact", "unifiedSearch", "savedObjects"],
"extraPublicDirs": ["common"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
filterManager,
history,
spaces,
observabilityAIAssistant,
} = useDiscoverServices();
const pageBackgroundColor = useEuiBackgroundColor('plain');
const globalQueryState = data.query.getState();
Expand Down Expand Up @@ -133,16 +132,6 @@ export function DiscoverLayout({ stateContainer }: DiscoverLayoutProps) {
sort,
});

// The assistant is getting the state from the url correctly
// expect from the index pattern where we have only the dataview id
useEffect(() => {
return observabilityAIAssistant?.service.setScreenContext({
screenDescription: `The user is looking at the Discover view on the ${
isPlainRecord ? 'ES|QL' : 'dataView'
} mode. The index pattern is the ${dataView.getIndexPattern()}`,
});
}, [dataView, isPlainRecord, observabilityAIAssistant?.service]);

const onAddFilter = useCallback(
(field: DataViewField | string, values: unknown, operation: '+' | '-') => {
const fieldName = typeof field === 'string' ? field : field.name;
Expand Down
3 changes: 0 additions & 3 deletions src/plugins/discover/public/build_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ import type { LensPublicStart } from '@kbn/lens-plugin/public';
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import type { SettingsStart } from '@kbn/core-ui-settings-browser';
import type { ContentClient } from '@kbn/content-management-plugin/public';
import type { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public';
import { memoize, noop } from 'lodash';
import type { NoDataPagePluginStart } from '@kbn/no-data-page-plugin/public';
import { DiscoverStartPlugins } from './plugin';
Expand Down Expand Up @@ -124,7 +123,6 @@ export interface DiscoverServices {
uiActions: UiActionsStart;
contentClient: ContentClient;
noDataPage?: NoDataPagePluginStart;
observabilityAIAssistant?: ObservabilityAIAssistantPublicStart;
}

export const buildServices = memoize(
Expand Down Expand Up @@ -205,7 +203,6 @@ export const buildServices = memoize(
uiActions: plugins.uiActions,
contentClient: plugins.contentManagement.client,
noDataPage: plugins.noDataPage,
observabilityAIAssistant: plugins.observabilityAIAssistant,
};
}
);
6 changes: 0 additions & 6 deletions src/plugins/discover/public/plugin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,6 @@ import { setStateToKbnUrl } from '@kbn/kibana-utils-plugin/public';
import type { LensPublicStart } from '@kbn/lens-plugin/public';
import { TRUNCATE_MAX_HEIGHT, ENABLE_ESQL } from '@kbn/discover-utils';
import type { NoDataPagePluginStart } from '@kbn/no-data-page-plugin/public';
import type {
ObservabilityAIAssistantPublicSetup,
ObservabilityAIAssistantPublicStart,
} from '@kbn/observability-ai-assistant-plugin/public';
import { PLUGIN_ID } from '../common';
import { registerFeature } from './register_feature';
import { buildServices, UrlTracker } from './build_services';
Expand Down Expand Up @@ -170,7 +166,6 @@ export interface DiscoverSetupPlugins {
data: DataPublicPluginSetup;
expressions: ExpressionsSetup;
globalSearch?: GlobalSearchPluginSetup;
observabilityAIAssistant?: ObservabilityAIAssistantPublicSetup;
}

/**
Expand Down Expand Up @@ -201,7 +196,6 @@ export interface DiscoverStartPlugins {
lens: LensPublicStart;
contentManagement: ContentManagementPublicStart;
noDataPage?: NoDataPagePluginStart;
observabilityAIAssistant?: ObservabilityAIAssistantPublicStart;
}

export type StartRenderServices = Pick<CoreStart, 'analytics' | 'i18n' | 'theme'>;
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/discover/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@
"@kbn/deeplinks-analytics",
"@kbn/shared-ux-markdown",
"@kbn/data-view-utils",
"@kbn/presentation-publishing",
"@kbn/observability-ai-assistant-plugin"
"@kbn/presentation-publishing"
],
"exclude": ["target/**/*"]
}