-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix alert consumers #7
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,8 +7,6 @@ | |
|
||
import React, { useCallback, useRef, useState } from 'react'; | ||
import { useDispatch } from 'react-redux'; | ||
import { AlertConsumers } from '@kbn/rule-data-utils'; | ||
|
||
import { | ||
getCaseDetailsUrl, | ||
getCaseDetailsUrlWithCommentId, | ||
|
@@ -21,7 +19,7 @@ import { Case, CaseViewRefreshPropInterface } from '../../../../../cases/common' | |
import { TimelineId } from '../../../../common/types/timeline'; | ||
import { SecurityPageName } from '../../../app/types'; | ||
import { useKibana } from '../../../common/lib/kibana'; | ||
import { APP_ID } from '../../../../common/constants'; | ||
import { APP_ID, SECURITY_SOLUTION_ALERT_CONSUMERS } from '../../../../common/constants'; | ||
import { timelineActions } from '../../../timelines/store/timeline'; | ||
import { useSourcererScope } from '../../../common/containers/sourcerer'; | ||
import { SourcererScopeName } from '../../../common/store/sourcerer/model'; | ||
|
@@ -55,8 +53,6 @@ export interface CaseProps extends Props { | |
updateCase: (newCase: Case) => void; | ||
} | ||
|
||
const ALERT_CONSUMER: AlertConsumers[] = [AlertConsumers.SIEM]; | ||
|
||
const TimelineDetailsPanel = ({ alertConsumers }: { alertConsumers?: AlertConsumers[] }) => { | ||
const { browserFields, docValueFields } = useSourcererScope(SourcererScopeName.detections); | ||
|
||
|
@@ -65,7 +61,7 @@ const TimelineDetailsPanel = ({ alertConsumers }: { alertConsumers?: AlertConsum | |
alertConsumers={alertConsumers} | ||
browserFields={browserFields} | ||
docValueFields={docValueFields} | ||
entityType={EntityType.ALERTS} | ||
entityType="alerts" | ||
isFlyoutView | ||
timelineId={TimelineId.casePage} | ||
/> | ||
|
@@ -234,7 +230,7 @@ export const CaseView = React.memo(({ caseId, subCaseId, userCanCrud }: Props) = | |
showAlertDetails, | ||
subCaseId, | ||
timelineIntegration: { | ||
alertConsumers: ALERT_CONSUMER, | ||
alertConsumers: SECURITY_SOLUTION_ALERT_CONSUMERS, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pass consumers for the timelineIntegration for cases |
||
editor_plugins: { | ||
parsingPlugin: timelineMarkdownPlugin.parser, | ||
processingPluginRenderer: timelineMarkdownPlugin.renderer, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,6 @@ import deepEqual from 'fast-deep-equal'; | |
import styled from 'styled-components'; | ||
|
||
import { isEmpty } from 'lodash/fp'; | ||
import { AlertConsumers } from '@kbn/rule-data-utils'; | ||
import { inputsModel, inputsSelectors, State } from '../../store'; | ||
import { inputsActions } from '../../store/actions'; | ||
import { ControlColumnProps, RowRenderer, TimelineId } from '../../../../common/types/timeline'; | ||
|
@@ -24,7 +23,7 @@ import { useGlobalFullScreen } from '../../containers/use_full_screen'; | |
import { useIsExperimentalFeatureEnabled } from '../../hooks/use_experimental_features'; | ||
import { SourcererScopeName } from '../../store/sourcerer/model'; | ||
import { useSourcererScope } from '../../containers/sourcerer'; | ||
import { EntityType } from '../../../../../timelines/common'; | ||
import type { EntityType } from '../../../../../timelines/common'; | ||
import { TGridCellAction } from '../../../../../timelines/common/types'; | ||
import { DetailsPanel } from '../../../timelines/components/side_panel'; | ||
import { CellValueElementProps } from '../../../timelines/components/timeline/cell_rendering'; | ||
|
@@ -69,8 +68,6 @@ export interface OwnProps { | |
|
||
type Props = OwnProps & PropsFromRedux; | ||
|
||
const alertConsumers: AlertConsumers[] = [AlertConsumers.SIEM]; | ||
|
||
/** | ||
* The stateful events viewer component is the highest level component that is utilized across the security_solution pages layer where | ||
* timeline is used BESIDES the flyout. The flyout makes use of the `EventsViewer` component which is a subcomponent here | ||
|
@@ -219,9 +216,8 @@ const StatefulEventsViewerComponent: React.FC<Props> = ({ | |
</InspectButtonContainer> | ||
</FullScreenContainer> | ||
<DetailsPanel | ||
alertConsumers={alertConsumers} | ||
browserFields={browserFields} | ||
entityType={EntityType.ALERTS} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Detail panel should use whatever entityType is passed in for hosts vs alerts page |
||
entityType={entityType} | ||
docValueFields={docValueFields} | ||
isFlyoutView | ||
timelineId={id} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -232,6 +232,7 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({ | |
loading, | ||
{ events, loadPage, pageInfo, refetch, totalCount = 0, inspect }, | ||
] = useTimelineEvents({ | ||
// We rely on entityType to determine Events vs Alerts | ||
alertConsumers: SECURITY_ALERTS_CONSUMERS, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use this table for the hosts page as well, so just passing this value in on the alerts table and leaving it out on the host page |
||
docValueFields, | ||
entityType, | ||
|
@@ -302,7 +303,7 @@ const TGridIntegratedComponent: React.FC<TGridIntegratedProps> = ({ | |
<UpdatedFlexItem grow={false} show={!loading}> | ||
{!resolverIsShowing(graphEventId) && additionalFilters} | ||
</UpdatedFlexItem> | ||
{tGridEventRenderedViewEnabled && ( | ||
{tGridEventRenderedViewEnabled && entityType === 'alerts' && ( | ||
<UpdatedFlexItem grow={false} show={!loading}> | ||
<SummaryViewSelector viewSelected={tableView} onViewChange={setTableView} /> | ||
</UpdatedFlexItem> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use a shared constant