mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Security Solution][Sourcerer] Rename index pattern props to data view (#216542)
## Summary This PR cleaned up some naming inconsistencies related to index pattern and data view spec. No change to features/UI. ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios - [ ] [Flaky Test Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was used on any tests changed - [ ] The PR description includes the appropriate Release Notes section, and the correct `release_note:*` label is applied per the [guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
This commit is contained in:
parent
f578f401d4
commit
005940ce48
18 changed files with 24 additions and 38 deletions
|
@ -233,7 +233,7 @@ const StatefulEventsViewerComponent: React.FC<EventsViewerProps & PropsFromRedux
|
|||
dataProviders: [],
|
||||
filters: globalFilters,
|
||||
from: start,
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
kqlMode: 'filter',
|
||||
kqlQuery: query,
|
||||
to: end,
|
||||
|
|
|
@ -51,7 +51,7 @@ export const useInsightQuery = ({
|
|||
const parsedCombinedQueries = combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders,
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters,
|
||||
kqlQuery: {
|
||||
|
|
|
@ -97,7 +97,7 @@ const StatefulTopNComponent: React.FC<Props> = ({
|
|||
browserFields,
|
||||
dataProviders,
|
||||
field,
|
||||
dataViewSpec: indexPattern,
|
||||
dataViewSpec,
|
||||
globalFilters = EMPTY_FILTERS,
|
||||
globalQuery = EMPTY_QUERY,
|
||||
kqlMode,
|
||||
|
@ -121,7 +121,7 @@ const StatefulTopNComponent: React.FC<Props> = ({
|
|||
config: getEsQueryConfig(uiSettings),
|
||||
dataProviders,
|
||||
filters: activeTimelineFilters,
|
||||
indexPattern,
|
||||
dataViewSpec,
|
||||
kqlMode,
|
||||
kqlQuery: {
|
||||
language: 'kuery',
|
||||
|
@ -135,7 +135,7 @@ const StatefulTopNComponent: React.FC<Props> = ({
|
|||
uiSettings,
|
||||
dataProviders,
|
||||
activeTimelineFilters,
|
||||
indexPattern,
|
||||
dataViewSpec,
|
||||
kqlMode,
|
||||
activeTimelineKqlQueryExpression,
|
||||
]
|
||||
|
@ -155,7 +155,7 @@ const StatefulTopNComponent: React.FC<Props> = ({
|
|||
field={field as AlertsStackByField}
|
||||
filters={isActiveTimeline(scopeId ?? '') ? EMPTY_FILTERS : globalFilters}
|
||||
from={isActiveTimeline(scopeId ?? '') ? activeTimelineFrom : from}
|
||||
indexPattern={indexPattern}
|
||||
dataViewSpec={dataViewSpec}
|
||||
options={options}
|
||||
paddingSize={paddingSize}
|
||||
query={isActiveTimeline(scopeId ?? '') ? EMPTY_QUERY : globalQuery}
|
||||
|
|
|
@ -107,7 +107,7 @@ describe('TopN', () => {
|
|||
field,
|
||||
filters: [],
|
||||
from: '2020-04-14T00:31:47.695Z',
|
||||
indexPattern: mockDataViewSpec,
|
||||
dataViewSpec: mockDataViewSpec,
|
||||
options: defaultOptions,
|
||||
query,
|
||||
setAbsoluteRangeDatePickerTarget: InputsModelId.global,
|
||||
|
|
|
@ -52,7 +52,7 @@ export interface Props extends Pick<GlobalTimeArgs, 'from' | 'to' | 'deleteQuery
|
|||
defaultView: TimelineEventsType;
|
||||
field: AlertsStackByField;
|
||||
filters: Filter[];
|
||||
indexPattern?: DataViewSpec;
|
||||
dataViewSpec?: DataViewSpec;
|
||||
options: TopNOption[];
|
||||
paddingSize?: 's' | 'm' | 'l' | 'none';
|
||||
query: Query;
|
||||
|
@ -70,7 +70,7 @@ const TopNComponent: React.FC<Props> = ({
|
|||
filters,
|
||||
field,
|
||||
from,
|
||||
indexPattern,
|
||||
dataViewSpec,
|
||||
options,
|
||||
paddingSize,
|
||||
query,
|
||||
|
@ -124,7 +124,7 @@ const TopNComponent: React.FC<Props> = ({
|
|||
filters={applicableFilters}
|
||||
from={from}
|
||||
headerChildren={headerChildren}
|
||||
dataViewSpec={indexPattern}
|
||||
dataViewSpec={dataViewSpec}
|
||||
onlyField={field}
|
||||
paddingSize={paddingSize}
|
||||
query={query}
|
||||
|
|
|
@ -30,7 +30,7 @@ export type PrimitiveOrArrayOfPrimitives =
|
|||
export interface CombineQueries {
|
||||
config: EsQueryConfig;
|
||||
dataProviders: DataProvider[];
|
||||
indexPattern?: DataViewSpec;
|
||||
dataViewSpec?: DataViewSpec;
|
||||
browserFields: BrowserFields;
|
||||
filters: Filter[];
|
||||
kqlQuery: Query;
|
||||
|
@ -245,7 +245,7 @@ export interface CombinedQuery {
|
|||
export const combineQueries = ({
|
||||
config,
|
||||
dataProviders = [],
|
||||
indexPattern,
|
||||
dataViewSpec,
|
||||
browserFields,
|
||||
filters = [],
|
||||
kqlQuery,
|
||||
|
@ -258,7 +258,7 @@ export const combineQueries = ({
|
|||
const [filterQuery, kqlError] = convertToBuildEsQuery({
|
||||
config,
|
||||
queries: [kuery],
|
||||
dataViewSpec: indexPattern,
|
||||
dataViewSpec,
|
||||
filters,
|
||||
});
|
||||
|
||||
|
@ -286,7 +286,7 @@ export const combineQueries = ({
|
|||
const [filterQuery, kqlError] = convertToBuildEsQuery({
|
||||
config,
|
||||
queries: [kuery],
|
||||
dataViewSpec: indexPattern,
|
||||
dataViewSpec,
|
||||
filters,
|
||||
});
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ export const GroupedSubLevelComponent: React.FC<AlertsTableComponentProps> = ({
|
|||
return combineQueries({
|
||||
config: getEsQueryConfig(uiSettings),
|
||||
dataProviders: [],
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters: [
|
||||
...(defaultFilters ?? []),
|
||||
|
|
|
@ -219,7 +219,7 @@ const DetectionEngineAlertsTableComponent: FC<Omit<DetectionEngineAlertTableProp
|
|||
return combineQueries({
|
||||
config: getEsQueryConfig(uiSettings),
|
||||
dataProviders: [],
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters: [...allFilters],
|
||||
kqlQuery: globalQuery,
|
||||
|
|
|
@ -121,7 +121,7 @@ export const useAddBulkToTimelineAction = ({
|
|||
return combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders: [],
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
filters: combinedFilters,
|
||||
kqlQuery: { query: '', language: 'kuery' },
|
||||
browserFields,
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
import { get } from 'lodash/fp';
|
||||
import numeral from '@elastic/numeral';
|
||||
import React from 'react';
|
||||
import type { DataViewBase } from '@kbn/es-query';
|
||||
import {
|
||||
SecurityCellActions,
|
||||
CellActionsMode,
|
||||
|
@ -45,7 +44,6 @@ export type NetworkTopCountriesColumnsNetworkDetails = [
|
|||
];
|
||||
|
||||
export const getNetworkTopCountriesColumns = (
|
||||
indexPattern: DataViewBase,
|
||||
flowTarget: FlowTargetSourceDest,
|
||||
type: networkModel.NetworkType,
|
||||
tableId: string
|
||||
|
@ -149,12 +147,11 @@ export const getNetworkTopCountriesColumns = (
|
|||
];
|
||||
|
||||
export const getCountriesColumnsCurated = (
|
||||
indexPattern: DataViewBase,
|
||||
flowTarget: FlowTargetSourceDest,
|
||||
type: networkModel.NetworkType,
|
||||
tableId: string
|
||||
): NetworkTopCountriesColumns | NetworkTopCountriesColumnsNetworkDetails => {
|
||||
const columns = getNetworkTopCountriesColumns(indexPattern, flowTarget, type, tableId);
|
||||
const columns = getNetworkTopCountriesColumns(flowTarget, type, tableId);
|
||||
|
||||
// Columns to exclude from host details pages
|
||||
if (type === networkModel.NetworkType.details) {
|
||||
|
|
|
@ -9,7 +9,6 @@ import { last } from 'lodash/fp';
|
|||
import React, { useCallback, useMemo } from 'react';
|
||||
import { useDispatch } from 'react-redux';
|
||||
import deepEqual from 'fast-deep-equal';
|
||||
import type { DataViewBase } from '@kbn/es-query';
|
||||
|
||||
import { networkActions, networkModel, networkSelectors } from '../../store';
|
||||
import type { NetworkTopCountriesEdges, SortField } from '../../../../../common/search_strategy';
|
||||
|
@ -31,7 +30,6 @@ interface NetworkTopCountriesTableProps {
|
|||
fakeTotalCount: number;
|
||||
flowTargeted: FlowTargetSourceDest;
|
||||
id: string;
|
||||
indexPattern: DataViewBase;
|
||||
isInspect: boolean;
|
||||
loading: boolean;
|
||||
loadPage: (newActivePage: number) => void;
|
||||
|
@ -59,7 +57,6 @@ const NetworkTopCountriesTableComponent: React.FC<NetworkTopCountriesTableProps>
|
|||
fakeTotalCount,
|
||||
flowTargeted,
|
||||
id,
|
||||
indexPattern,
|
||||
isInspect,
|
||||
loading,
|
||||
loadPage,
|
||||
|
@ -152,8 +149,8 @@ const NetworkTopCountriesTableComponent: React.FC<NetworkTopCountriesTableProps>
|
|||
);
|
||||
|
||||
const columns = useMemo(
|
||||
() => getCountriesColumnsCurated(indexPattern, flowTargeted, type, NetworkTopCountriesTableId),
|
||||
[indexPattern, flowTargeted, type]
|
||||
() => getCountriesColumnsCurated(flowTargeted, type, NetworkTopCountriesTableId),
|
||||
[flowTargeted, type]
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
@ -56,7 +56,6 @@ export const CountriesQueryTabBody = ({
|
|||
fakeTotalCount={getOr(50, 'fakeTotalCount', pageInfo)}
|
||||
flowTargeted={flowTarget}
|
||||
id={id}
|
||||
indexPattern={indexPattern}
|
||||
inspect={inspect}
|
||||
isInspect={isInspected}
|
||||
loading={loading}
|
||||
|
|
|
@ -64,7 +64,6 @@ describe('useEventDetails', () => {
|
|||
expect(hookResult.result.current.dataAsNestedObject).toEqual({});
|
||||
expect(hookResult.result.current.dataFormattedForFieldBrowser).toEqual([]);
|
||||
expect(hookResult.result.current.getFieldsData('test')).toEqual('test');
|
||||
expect('indexPattern' in hookResult.result.current).toEqual(true);
|
||||
expect(hookResult.result.current.loading).toEqual(false);
|
||||
expect(hookResult.result.current.refetchFlyoutData()).toEqual(undefined);
|
||||
expect(hookResult.result.current.searchHit).toEqual({});
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
import type { BrowserFields, TimelineEventsDetailsItem } from '@kbn/timelines-plugin/common';
|
||||
import type { EcsSecurityExtension as Ecs } from '@kbn/securitysolution-ecs';
|
||||
import { SecurityPageName } from '@kbn/security-solution-navigation';
|
||||
import { type DataViewSpec } from '@kbn/data-plugin/common';
|
||||
import { DEFAULT_ALERTS_INDEX, DEFAULT_PREVIEW_INDEX } from '../../../../../common/constants';
|
||||
import type { RunTimeMappings } from '../../../../../common/api/search_strategy';
|
||||
import { useSpaceId } from '../../../../common/hooks/use_space_id';
|
||||
|
@ -63,10 +62,6 @@ export interface UseEventDetailsResult {
|
|||
* Retrieves searchHit values for the provided field
|
||||
*/
|
||||
getFieldsData: GetFieldsData;
|
||||
/**
|
||||
* Index pattern for rule details
|
||||
*/
|
||||
indexPattern?: DataViewSpec;
|
||||
/**
|
||||
* Whether the data is loading
|
||||
*/
|
||||
|
@ -112,7 +107,6 @@ export const useEventDetails = ({
|
|||
dataAsNestedObject,
|
||||
dataFormattedForFieldBrowser,
|
||||
getFieldsData,
|
||||
indexPattern: sourcererDataView.sourcererDataView,
|
||||
loading,
|
||||
refetchFlyoutData,
|
||||
searchHit,
|
||||
|
|
|
@ -111,7 +111,7 @@ export const TimelineModalHeader = React.memo<FlyoutHeaderPanelProps>(
|
|||
combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders,
|
||||
indexPattern: dataView,
|
||||
dataViewSpec: dataView,
|
||||
browserFields,
|
||||
filters: filters ? filters : [],
|
||||
kqlQuery: kqlQueryObj,
|
||||
|
|
|
@ -97,7 +97,7 @@ export const TimelineKpisContainer = ({ timelineId }: KpiExpandedProps) => {
|
|||
combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders,
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters: filters ? filters : [],
|
||||
kqlQuery,
|
||||
|
|
|
@ -116,7 +116,7 @@ export const TimelineQueryTabEventsCountComponent: React.FC<{ timelineId: string
|
|||
return combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders,
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters,
|
||||
kqlQuery,
|
||||
|
|
|
@ -149,7 +149,7 @@ export const QueryTabContentComponent: React.FC<Props> = ({
|
|||
return combineQueries({
|
||||
config: esQueryConfig,
|
||||
dataProviders,
|
||||
indexPattern: sourcererDataView,
|
||||
dataViewSpec: sourcererDataView,
|
||||
browserFields,
|
||||
filters,
|
||||
kqlQuery,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue