Skip to content

Commit

Permalink
Move notes page to timelines, register deep link conditionally
Browse files Browse the repository at this point in the history
  • Loading branch information
kqualters-elastic committed Jul 1, 2024
1 parent b1097b6 commit e60aa4d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 29 deletions.
20 changes: 0 additions & 20 deletions x-pack/plugins/security_solution/public/management/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import {
EVENT_FILTERS_PATH,
HOST_ISOLATION_EXCEPTIONS_PATH,
MANAGE_PATH,
NOTES_MANAGEMENT_PATH,
POLICIES_PATH,
RESPONSE_ACTIONS_HISTORY_PATH,
SecurityPageName,
Expand All @@ -40,7 +39,6 @@ import {
TRUSTED_APPLICATIONS,
ENTITY_ANALYTICS_RISK_SCORE,
ASSET_CRITICALITY,
NOTES,
} from '../app/translations';
import { licenseService } from '../common/hooks/use_license';
import type { LinkItem } from '../common/links/types';
Expand Down Expand Up @@ -87,12 +85,6 @@ const categories = [
}),
linkIds: [SecurityPageName.cloudDefendPolicies],
},
{
label: i18n.translate('xpack.securitySolution.appLinks.category.investigations', {
defaultMessage: 'Investigations',
}),
linkIds: [SecurityPageName.notesManagement],
},
];

export const links: LinkItem = {
Expand Down Expand Up @@ -223,18 +215,6 @@ export const links: LinkItem = {
hideTimeline: true,
},
cloudDefendLink,
{
id: SecurityPageName.notesManagement,
title: NOTES,
description: i18n.translate('xpack.securitySolution.appLinks.notesManagementDescription', {
defaultMessage: 'Visualize and delete notes.',
}),
landingIcon: IconTool, // TODO get new icon
path: NOTES_MANAGEMENT_PATH,
skipUrlState: true,
hideTimeline: true,
experimentalKey: 'securitySolutionNotesEnabled',
},
],
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import React, { useCallback, useMemo, useEffect } from 'react';
import type { DefaultItemAction, EuiBasicTableColumn } from '@elastic/eui';
import { EuiBasicTable, EuiEmptyPrompt, EuiSpacer, EuiTitle } from '@elastic/eui';
import { EuiBasicTable, EuiEmptyPrompt } from '@elastic/eui';
import { useDispatch, useSelector } from 'react-redux';
// TODO unify this type from the api with the one in public/common/lib/note
import type { Note } from '../../../common/api/timeline';
Expand All @@ -34,7 +34,6 @@ import { SearchRow } from '../components/search_row';
import { NotesUtilityBar } from '../components/utility_bar';
import { DeleteConfirmModal } from '../components/delete_confirm_modal';
import * as i18n from '../components/translations';
import { NOTES_MANAGEMENT_TITLE } from '../components/translations';

const columns: Array<EuiBasicTableColumn<Note>> = [
{
Expand Down Expand Up @@ -193,10 +192,6 @@ export const NoteManagementPage = () => {

return (
<>
<EuiTitle size={'l'}>
<h1>{NOTES_MANAGEMENT_TITLE}</h1>
</EuiTitle>
<EuiSpacer />
<SearchRow />
<NotesUtilityBar />
<EuiBasicTable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import { TimelinesTable } from './timelines_table';
import * as i18n from './translations';
import { OPEN_TIMELINE_CLASS_NAME } from './helpers';
import type { OpenTimelineProps, ActionTimelineToShow, OpenTimelineResult } from './types';
import { NotesTable } from '../../../notes';
import { NoteManagementPage } from '../../../notes';

const QueryText = styled.span`
white-space: normal;
Expand Down Expand Up @@ -312,7 +312,7 @@ export const OpenTimeline = React.memo<OpenTimelineProps>(
/>
</>
) : (
<NotesTable />
<NoteManagementPage />
)}
</div>
</>
Expand Down
13 changes: 12 additions & 1 deletion x-pack/plugins/security_solution/public/timelines/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

import { i18n } from '@kbn/i18n';
import { SecurityPageName, SERVER_APP_ID, TIMELINES_PATH } from '../../common/constants';
import { TIMELINES } from '../app/translations';
import { TIMELINES, NOTES } from '../app/translations';
import type { LinkItem } from '../common/links/types';

export const links: LinkItem = {
Expand All @@ -30,5 +30,16 @@ export const links: LinkItem = {
path: `${TIMELINES_PATH}/template`,
sideNavDisabled: true,
},
{
id: SecurityPageName.notesManagement,
title: NOTES,
description: i18n.translate('xpack.securitySolution.appLinks.notesManagementDescription', {
defaultMessage: 'Visualize and delete notes.',
}),
path: `${TIMELINES_PATH}/notes`,
skipUrlState: true,
hideTimeline: true,
experimentalKey: 'securitySolutionNotesEnabled',
},
],
};

0 comments on commit e60aa4d

Please sign in to comment.