Skip to content

Commit

Permalink
[Obs AI Assistant] Add to dashboard in Discover
Browse files Browse the repository at this point in the history
  • Loading branch information
dgieselaar committed Mar 26, 2024
1 parent 13a024d commit 79fcedb
Show file tree
Hide file tree
Showing 12 changed files with 557 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export class LensConfigBuilder {
async build(
config: LensConfig,
options: LensConfigOptions = {}
): Promise<LensAttributes | LensEmbeddableInput | undefined> {
): Promise<LensAttributes | LensEmbeddableInput> {
const { chartType } = config;
const chartConfig = await this.charts[chartType](config as any, {
formulaAPI: this.formulaAPI,
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/dashboard/kibana.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@
"usageCollection",
"taskManager",
"serverless",
"noDataPage"
"noDataPage",
"observabilityAIAssistant"
],
"requiredBundles": [
"kibanaReact",
Expand Down
12 changes: 10 additions & 2 deletions src/plugins/dashboard/public/dashboard_app/dashboard_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useS
import { ViewMode } from '@kbn/embeddable-plugin/public';
import { useExecutionContext } from '@kbn/kibana-react-plugin/public';
import { createKbnUrlStateStorage, withNotifyOnErrors } from '@kbn/kibana-utils-plugin/public';

import {
DashboardAppNoDataPage,
isDashboardAppInNoDataState,
Expand Down Expand Up @@ -42,6 +41,7 @@ import { loadDashboardHistoryLocationState } from './locator/load_dashboard_hist
import type { DashboardCreationOptions } from '../dashboard_container/embeddable/dashboard_container_factory';
import { DashboardTopNav } from '../dashboard_top_nav';
import { DashboardTabTitleSetter } from './tab_title_setter/dashboard_tab_title_setter';
import { useObservabilityAIAssistantContext } from './hooks/use_observability_ai_assistant_context';

export interface DashboardAppProps {
history: History;
Expand Down Expand Up @@ -82,13 +82,21 @@ export function DashboardApp({
embeddable: { getStateTransfer },
notifications: { toasts },
settings: { uiSettings },
data: { search },
data: { search, dataViews },
customBranding,
share: { url },
observabilityAIAssistant,
} = pluginServices.getServices();
const showPlainSpinner = useObservable(customBranding.hasCustomBranding$, false);
const { scopedHistory: getScopedHistory } = useDashboardMountContext();

useObservabilityAIAssistantContext({
observabilityAIAssistant: observabilityAIAssistant.start,
dashboardAPI,
search,
dataViews,
});

useExecutionContext(executionContext, {
type: 'application',
page: 'app',
Expand Down
Loading

0 comments on commit 79fcedb

Please sign in to comment.