mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
[Security Solution][Threat Intelligence] - fix broken KQL bar (#179153)
This commit is contained in:
parent
ffcc1ffa33
commit
98f0cfe7dd
9 changed files with 14 additions and 23 deletions
|
@ -8,9 +8,9 @@
|
|||
import React, { memo } from 'react';
|
||||
import type { SecuritySolutionPluginContext } from '@kbn/threat-intelligence-plugin/public';
|
||||
import { THREAT_INTELLIGENCE_BASE_PATH } from '@kbn/threat-intelligence-plugin/public';
|
||||
import type { SourcererDataView } from '@kbn/threat-intelligence-plugin/public/types';
|
||||
import type { Store } from 'redux';
|
||||
import { useSelector } from 'react-redux';
|
||||
import type { SelectedDataView } from '@kbn/threat-intelligence-plugin/public/types';
|
||||
import { useUserPrivileges } from '../common/components/user_privileges';
|
||||
import { useSetUrlParams } from '../management/components/artifact_list_page/hooks/use_set_url_params';
|
||||
import { BlockListForm } from '../management/pages/blocklist/view/components/blocklist_form';
|
||||
|
@ -46,7 +46,7 @@ const ThreatIntelligence = memo(() => {
|
|||
getFiltersGlobalComponent: () => FiltersGlobal,
|
||||
getPageWrapper: () => SecuritySolutionPageWrapper,
|
||||
licenseService,
|
||||
sourcererDataView: sourcererDataView as unknown as SourcererDataView,
|
||||
sourcererDataView: sourcererDataView as unknown as SelectedDataView,
|
||||
getUseInvestigateInTimeline: useInvestigateInTimeline,
|
||||
|
||||
blockList: {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
*/
|
||||
|
||||
import React, { NamedExoticComponent } from 'react';
|
||||
import { BlockListFlyoutProps, BlockListFormProps } from '../types';
|
||||
import { BlockListFlyoutProps, BlockListFormProps, SelectedDataView } from '../types';
|
||||
import { SecuritySolutionPluginContext } from '..';
|
||||
|
||||
export const getSecuritySolutionContextMock = (): SecuritySolutionPluginContext => ({
|
||||
|
@ -31,7 +31,7 @@ export const getSecuritySolutionContextMock = (): SecuritySolutionPluginContext
|
|||
selectedPatterns: [],
|
||||
indexPattern: { fields: [], title: '' },
|
||||
loading: false,
|
||||
},
|
||||
} as unknown as SelectedDataView,
|
||||
securitySolutionStore: {
|
||||
// @ts-ignore
|
||||
dispatch: () => jest.fn(),
|
||||
|
|
|
@ -79,11 +79,7 @@ export const useAggregatedIndicators = ({
|
|||
} = useKibana();
|
||||
const userTimeZone = useTimeZone();
|
||||
const userFormat = useDateFormat();
|
||||
|
||||
const {
|
||||
sourcererDataView: { selectedPatterns },
|
||||
} = useSourcererDataView();
|
||||
|
||||
const { selectedPatterns } = useSourcererDataView();
|
||||
const { inspectorAdapters } = useInspector();
|
||||
|
||||
const [field, setField] = useState<EuiComboBoxOptionOption<string>>({
|
||||
|
|
|
@ -64,10 +64,7 @@ export const useIndicators = ({
|
|||
data: { search: searchService },
|
||||
},
|
||||
} = useKibana();
|
||||
const {
|
||||
sourcererDataView: { selectedPatterns },
|
||||
} = useSourcererDataView();
|
||||
|
||||
const { selectedPatterns } = useSourcererDataView();
|
||||
const { inspectorAdapters } = useInspector();
|
||||
|
||||
const onChangeItemsPerPage = useCallback(
|
||||
|
|
|
@ -54,7 +54,7 @@ export const useSourcererDataView = () => {
|
|||
|
||||
return useMemo(
|
||||
() => ({
|
||||
sourcererDataView,
|
||||
...sourcererDataView,
|
||||
indexPatterns,
|
||||
indexPattern: updatedPattern,
|
||||
browserFields,
|
||||
|
|
|
@ -24,9 +24,7 @@ export const useIndicatorsTotalCount = () => {
|
|||
const [count, setCount] = useState<number>(0);
|
||||
const [isLoading, setIsLoading] = useState<boolean>(true);
|
||||
|
||||
const {
|
||||
sourcererDataView: { selectedPatterns, loading: loadingDataView },
|
||||
} = useSourcererDataView();
|
||||
const { selectedPatterns, loading: loadingDataView } = useSourcererDataView();
|
||||
|
||||
useEffect(() => {
|
||||
const query = {
|
||||
|
|
|
@ -83,7 +83,6 @@ const IndicatorsPageContent: VFC = () => {
|
|||
<FiltersGlobal>
|
||||
<QueryBar
|
||||
queries={[indicatorChartQuery, indicatorListQuery]}
|
||||
indexPattern={indexPattern}
|
||||
sourcererDataView={sourcererDataView}
|
||||
/>
|
||||
</FiltersGlobal>
|
||||
|
|
|
@ -6,17 +6,16 @@
|
|||
*/
|
||||
|
||||
import React, { useEffect, VFC } from 'react';
|
||||
import type { DataViewSpec } from '@kbn/data-views-plugin/common';
|
||||
import { useSecurityContext } from '../../../hooks/use_security_context';
|
||||
import { SecuritySolutionDataViewBase, SourcererDataView } from '../../../types';
|
||||
|
||||
interface QueryBarProps {
|
||||
indexPattern: SecuritySolutionDataViewBase;
|
||||
queries: Array<{
|
||||
id: string;
|
||||
refetch: VoidFunction;
|
||||
loading: boolean;
|
||||
}>;
|
||||
sourcererDataView: SourcererDataView | undefined;
|
||||
sourcererDataView: DataViewSpec | undefined;
|
||||
}
|
||||
|
||||
export const QueryBar: VFC<QueryBarProps> = ({ queries, sourcererDataView }) => {
|
||||
|
|
|
@ -10,6 +10,7 @@ import { CoreStart } from '@kbn/core/public';
|
|||
import { DataPublicPluginStart } from '@kbn/data-plugin/public';
|
||||
import {
|
||||
DataViewField,
|
||||
type DataViewSpec,
|
||||
DataViewsPublicPluginStart,
|
||||
FieldSpec,
|
||||
} from '@kbn/data-views-plugin/public';
|
||||
|
@ -64,7 +65,8 @@ export interface LicenseAware {
|
|||
|
||||
export type BrowserFields = Readonly<Record<string, Partial<BrowserField>>>;
|
||||
|
||||
export interface SourcererDataView {
|
||||
export interface SelectedDataView {
|
||||
sourcererDataView: DataViewSpec | undefined;
|
||||
indexPattern: SecuritySolutionDataViewBase;
|
||||
browserFields: BrowserFields;
|
||||
selectedPatterns: string[];
|
||||
|
@ -112,7 +114,7 @@ export interface SecuritySolutionPluginContext {
|
|||
/**
|
||||
* Gets Security Solution shared information like browerFields, indexPattern and selectedPatterns in DataView.
|
||||
*/
|
||||
sourcererDataView: SourcererDataView;
|
||||
sourcererDataView: SelectedDataView;
|
||||
|
||||
/**
|
||||
* Security Solution store
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue