Skip to content

Commit

Permalink
set entityType to events
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Aug 5, 2021
1 parent 30d5438 commit b8d76f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ import {
import { isCompleteResponse, isErrorResponse } from '../../../../../../../src/plugins/data/public';
import { useAppToasts } from '../../../common/hooks/use_app_toasts';
import * as i18n from './translations';
import { EntityType } from '../../../../../timelines/common/search_strategy';

enum EntityType {
ALERTS = 'alerts',
EVENTS = 'events',
}
export interface EventsArgs {
detailsData: TimelineEventsDetailsItem[] | null;
}
Expand Down Expand Up @@ -73,7 +76,7 @@ export const useTimelineEventsDetails = ({

searchSubscription$.current = data.search
.search<TimelineEventsDetailsRequestOptions, TimelineEventsDetailsStrategyResponse>(
{ ...request, entityType: 'alerts' },
{ ...request, entityType: EntityType.EVENTS },
{
strategy: 'timelineSearchStrategy',
abortSignal: abortCtrl.current.signal,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const timelineEventsDetails: TimelineFactory<TimelineEventsQueries.detail
dsl: [inspectStringifyObject(buildTimelineDetailsQuery(indexName, eventId, docValueFields))],
};

console.log('----', options, JSON.stringify(response));
if (response.isRunning) {
return {
...response,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ export const timelineSearchStrategyProvider = <T extends TimelineFactoryQueryTyp
const queryFactory: TimelineFactory<T> = timelineFactory[factoryQueryType];

if (alertConsumers != null && entityType != null && entityType === EntityType.ALERTS) {
console.log('------------------');
const allFeatureIdsValid = alertConsumers.every((id) => isValidFeatureId(id));

if (!allFeatureIdsValid) {
Expand Down

0 comments on commit b8d76f8

Please sign in to comment.