[Security Solution] Adds read only prop to preview table details flyout threat summary (#138665)

This commit is contained in:
Davis Plumlee 2022-08-11 23:19:28 +02:00 committed by GitHub
parent 1c59a09965
commit cb0ca889a9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 3 deletions

View file

@ -33,6 +33,7 @@ export interface ThreatSummaryDescription {
timelineId: string;
value: string | undefined;
isDraggable?: boolean;
isReadOnly?: boolean;
}
const EnrichmentFieldFeedName = styled.span`
@ -65,6 +66,7 @@ const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
timelineId,
value,
isDraggable,
isReadOnly,
}) => {
if (!data || !value) return null;
const key = `alert-details-value-formatted-field-value-${timelineId}-${eventId}-${data.field}-${value}-${index}-${feedName}`;
@ -92,7 +94,7 @@ const EnrichmentDescription: React.FC<ThreatSummaryDescription> = ({
</div>
</EuiFlexItem>
<EuiFlexItem>
{value && (
{value && !isReadOnly && (
<ActionCell
data={data}
contextId={timelineId}
@ -115,7 +117,8 @@ const EnrichmentSummaryComponent: React.FC<{
timelineId: string;
eventId: string;
isDraggable?: boolean;
}> = ({ browserFields, data, enrichments, timelineId, eventId, isDraggable }) => {
isReadOnly?: boolean;
}> = ({ browserFields, data, enrichments, timelineId, eventId, isDraggable, isReadOnly }) => {
const parsedEnrichments = enrichments.map((enrichment, index) => {
const { field, type, feedName, value } = getEnrichmentIdentifiers(enrichment);
const eventData = data.find((item) => item.field === field);
@ -168,6 +171,7 @@ const EnrichmentSummaryComponent: React.FC<{
data={fieldsData}
browserField={browserField}
isDraggable={isDraggable}
isReadOnly={isReadOnly}
/>
}
/>
@ -198,6 +202,7 @@ const EnrichmentSummaryComponent: React.FC<{
data={fieldsData}
browserField={browserField}
isDraggable={isDraggable}
isReadOnly={isReadOnly}
/>
}
/>

View file

@ -127,7 +127,17 @@ const ThreatSummaryViewComponent: React.FC<{
timelineId: string;
hostRisk: HostRisk | null;
isDraggable?: boolean;
}> = ({ browserFields, data, enrichments, eventId, timelineId, hostRisk, isDraggable }) => {
isReadOnly?: boolean;
}> = ({
browserFields,
data,
enrichments,
eventId,
timelineId,
hostRisk,
isDraggable,
isReadOnly,
}) => {
if (!hostRisk && enrichments.length === 0) {
return null;
}
@ -155,6 +165,7 @@ const ThreatSummaryViewComponent: React.FC<{
timelineId={timelineId}
eventId={eventId}
isDraggable={isDraggable}
isReadOnly={isReadOnly}
/>
</EuiFlexGroup>
</>

View file

@ -202,6 +202,7 @@ const EventDetailsComponent: React.FC<Props> = ({
eventId={id}
timelineId={timelineId}
enrichments={allEnrichments}
isReadOnly={isReadOnly}
/>
)}