Skip to content
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

[Security Solution] Fix missing title on inspect pop-up #143601

Merged
merged 20 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export interface TimelinePersistInput {
timelineType?: TimelineTypeLiteral;
templateTimelineId?: string | null;
templateTimelineVersion?: number | null;
title?: string;
}

/** Invoked when a column is sorted */
Expand Down
14 changes: 0 additions & 14 deletions x-pack/plugins/security_solution/public/cases/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,19 +77,6 @@ const CaseContainerComponent: React.FC = () => {
}),
});

const onComponentInitialized = useCallback(() => {
christineweng marked this conversation as resolved.
Show resolved Hide resolved
dispatch(
timelineActions.createTimeline({
id: TimelineId.casePage,
columns: [],
dataViewId: null,
indexNames: [],
expandedDetail: {},
show: false,
})
);
}, [dispatch]);

const refreshRef = useRef<CaseViewRefreshPropInterface>(null);

return (
Expand All @@ -103,7 +90,6 @@ const CaseContainerComponent: React.FC = () => {
alerts: { isExperimental: true },
},
refreshRef,
onComponentInitialized,
actionsNavigation: {
href: endpointDetailsHref,
onClick: (endpointId: string, e) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ const EventsQueryTabBodyComponent: React.FC<EventsQueryTabBodyComponentProps> =
}
: c
),
title: i18n.EVENTS_GRAPH_TITLE,
})
);
}, [dispatch, showExternalAlerts, tGridEnabled, tableId]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
* 2.0.
*/

import React, { useMemo } from 'react';
import React, { useMemo, useEffect } from 'react';
import { useDispatch } from 'react-redux';
import type { Filter } from '@kbn/es-query';
import { EVENT_ACTION } from '@kbn/rule-registry-plugin/common/technical_rule_data_field_names';
import { ENTRY_SESSION_ENTITY_ID_PROPERTY, EventAction } from '@kbn/session-view-plugin/public';
Expand All @@ -21,6 +22,7 @@ import { getDefaultControlColumn } from '../../../timelines/components/timeline/
import { useLicense } from '../../hooks/use_license';
import { TableId } from '../../../../common/types/timeline';
export const TEST_ID = 'security_solution:sessions_viewer:sessions_view';
import { dataTableActions } from '../../store/data_table';

export const defaultSessionsFilter: Required<Pick<Filter, 'meta' | 'query'>> = {
query: {
Expand Down Expand Up @@ -102,6 +104,17 @@ const SessionsViewComponent: React.FC<SessionsComponentsProps> = ({
const unit = (c: number) =>
c > 1 ? i18n.TOTAL_COUNT_OF_SESSIONS : i18n.SINGLE_COUNT_OF_SESSIONS;

const dispatch = useDispatch();

useEffect(() => {
dispatch(
dataTableActions.initializeTGridSettings({
id: tableId,
title: i18n.SESSIONS_TITLE,
})
);
}, [dispatch, tableId]);

return (
<div data-test-subj={TEST_ID}>
<StatefulEventsViewer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

import { i18n } from '@kbn/i18n';

export const SESSIONS_TITLE = i18n.translate('xpack.securitySolution.sessionsView.sessionsTitle', {
defaultMessage: 'Sessions',
});

export const TOTAL_COUNT_OF_SESSIONS = i18n.translate(
'xpack.securitySolution.sessionsView.totalCountOfSessions',
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ export const AlertsTableComponent: React.FC<AlertsTableComponentProps> = ({
id: tableId,
loadingText: i18n.LOADING_ALERTS,
queryFields: requiredFieldsForActions,
title: '',
title: i18n.ALERTS_DOCUMENT_TYPE,
showCheckboxes: true,
})
);
Expand Down
3 changes: 2 additions & 1 deletion x-pack/plugins/timelines/public/store/t_grid/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export interface TGridModelSettings {
showCheckboxes: boolean;
/** Specifies which column the timeline is sorted on, and the direction (ascending / descending) */
sort: SortColumnTable[];
title: string;
title?: string;
unit?: (n: number) => string | React.ReactNode;
}
export interface TGridModel extends TGridModelSettings {
Expand Down Expand Up @@ -85,5 +85,6 @@ export type SubsetTGridModel = Readonly<
| 'graphEventId'
| 'sessionViewConfig'
| 'queryFields'
| 'title'
>
>;