Skip to content

Commit

Permalink
PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Jul 14, 2020
1 parent 69fbcf5 commit 8dbe7ab
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: mockEcsDataWithAlert,
nonEcsData: [],
updateTimelineIsLoading,
});

Expand All @@ -65,6 +66,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: mockEcsDataWithAlert,
nonEcsData: [],
updateTimelineIsLoading,
});
const expected = {
Expand Down Expand Up @@ -250,6 +252,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: mockEcsDataWithAlert,
nonEcsData: [],
updateTimelineIsLoading,
});
// @ts-ignore
Expand Down Expand Up @@ -279,6 +282,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: mockEcsDataWithAlert,
nonEcsData: [],
updateTimelineIsLoading,
});
// @ts-ignore
Expand All @@ -297,6 +301,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: mockEcsDataWithAlert,
nonEcsData: [],
updateTimelineIsLoading,
});

Expand Down Expand Up @@ -326,6 +331,7 @@ describe('alert actions', () => {
apolloClient,
createTimeline,
ecsData: ecsDataMock,
nonEcsData: [],
updateTimelineIsLoading,
});

Expand All @@ -350,6 +356,7 @@ describe('alert actions', () => {
await sendAlertToTimelineAction({
createTimeline,
ecsData: ecsDataMock,
nonEcsData: [],
updateTimelineIsLoading,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
replaceTemplateFieldFromDataProviders,
} from './helpers';
import { KueryFilterQueryKind } from '../../../common/store';
import { DataProvider } from '../../../timelines/components/timeline/data_providers/data_provider';

export const getUpdateAlertsQuery = (eventIds: Readonly<string[]>) => {
return {
Expand Down Expand Up @@ -105,7 +106,7 @@ export const determineToAndFrom = ({ ecsData }: { ecsData: Ecs }) => {
export const getThresholdAggregationDataProvider = (
ecsData: Ecs,
nonEcsData: TimelineNonEcsData[]
) => {
): DataProvider[] => {
const aggregationField = ecsData.signal?.rule?.threshold.field;
const aggregationValue =
get(aggregationField, ecsData) ?? find(['field', aggregationField], nonEcsData)?.value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import ApolloClient from 'apollo-client';

import { Status } from '../../../../common/detection_engine/schemas/common/schemas';
import { Ecs } from '../../../graphql/types';
import { Ecs, TimelineNonEcsData } from '../../../graphql/types';
import { TimelineModel } from '../../../timelines/store/timeline/model';
import { inputsModel } from '../../../common/store';

Expand Down Expand Up @@ -53,6 +53,7 @@ export interface SendAlertToTimelineActionProps {
apolloClient?: ApolloClient<{}>;
createTimeline: CreateTimeline;
ecsData: Ecs;
nonEcsData: TimelineNonEcsData[];
updateTimelineIsLoading: UpdateTimelineLoading;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@
},
"status": {
"type": "keyword"
},
"threshold_count": {
"type": "keyword"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -251,12 +251,6 @@ export const signalRulesAlertType = ({
threshold,
});

// console.log(
// 'thresholdResults',
// thresholdResults
// // JSON.stringify(thresholdResults.aggregations?.threshold.buckets, null, 2)
// );

const {
success,
bulkCreateDuration,
Expand Down

0 comments on commit 8dbe7ab

Please sign in to comment.