Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix types
Browse files Browse the repository at this point in the history
walterra committed Oct 11, 2024
1 parent 1ef6f76 commit c755697
Showing 3 changed files with 9 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -72,3 +72,5 @@ export const useFieldStatsTrigger = () => {
populatedFields,
};
};

export type UseFieldStatsTrigger = typeof useFieldStatsTrigger;
Original file line number Diff line number Diff line change
@@ -638,7 +638,7 @@ export const FieldsControls: FC<PropsWithChildren<FieldsControlsProps>> = ({
}) => {
const { splitFieldsOptions, combinedQuery } = useChangePointDetectionContext();
const { dataView } = useDataSource();
const { data, uiSettings, fieldFormats, charts, fieldStats } = useAiopsAppContext();
const { data, uiSettings, fieldFormats, charts, fieldStats, theme } = useAiopsAppContext();
const timefilter = useTimefilter();
// required in order to trigger state updates
useTimeRangeUpdates();
@@ -677,6 +677,7 @@ export const FieldsControls: FC<PropsWithChildren<FieldsControlsProps>> = ({
}
: undefined
}
theme={theme}
>
<EuiFlexGroup alignItems={'center'} responsive={true} wrap={true} gutterSize={'m'}>
<EuiFlexItem grow={false} css={{ width: '200px' }}>
25 changes: 5 additions & 20 deletions x-pack/plugins/aiops/public/hooks/use_aiops_app_context.ts
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
* 2.0.
*/

import { createContext, type FC, type PropsWithChildren, useContext } from 'react';
import { createContext, type FC, useContext } from 'react';

import type { ObservabilityAIAssistantPublicStart } from '@kbn/observability-ai-assistant-plugin/public';
import type { IStorageWrapper } from '@kbn/kibana-utils-plugin/public';
@@ -24,17 +24,12 @@ import type {
ThemeServiceStart,
} from '@kbn/core/public';
import type { LensPublicStart } from '@kbn/lens-plugin/public';
import { type EuiComboBoxProps } from '@elastic/eui/src/components/combo_box/combo_box';
import { type DataView } from '@kbn/data-views-plugin/common';
import type {
FieldStatsProps,
FieldStatsServices,
} from '@kbn/unified-field-list/src/components/field_stats';
import type { TimeRange as TimeRangeMs } from '@kbn/ml-date-picker';
import type { EmbeddableStart } from '@kbn/embeddable-plugin/public';
import type { CasesPublicStart } from '@kbn/cases-plugin/public';
import type { UsageCollectionSetup } from '@kbn/usage-collection-plugin/public';
import type { UiActionsStart } from '@kbn/ui-actions-plugin/public';
import type { FieldStatsFlyoutProviderProps } from '@kbn/ml-field-stats-flyout/field_stats_flyout_provider';
import type { UseFieldStatsTrigger } from '@kbn/ml-field-stats-flyout/use_field_stats_trigger';

/**
* AIOps app context value to be provided via React context.
@@ -115,18 +110,8 @@ export interface AiopsAppContextValue {
* Deps for unified fields stats.
*/
fieldStats?: {
useFieldStatsTrigger: () => {
renderOption: EuiComboBoxProps<string>['renderOption'];
closeFlyout: () => void;
};
FieldStatsFlyoutProvider: FC<
PropsWithChildren<{
dataView: DataView;
fieldStatsServices: FieldStatsServices;
timeRangeMs?: TimeRangeMs;
dslQuery?: FieldStatsProps['dslQuery'];
}>
>;
useFieldStatsTrigger: UseFieldStatsTrigger;
FieldStatsFlyoutProvider: FC<FieldStatsFlyoutProviderProps>;
};
embeddable?: EmbeddableStart;
cases?: CasesPublicStart;

0 comments on commit c755697

Please sign in to comment.