Skip to content

Commit

Permalink
[8.x] [SecuritySolution][Navigation] Unify Notes link (elastic#199374) (
Browse files Browse the repository at this point in the history
elastic#199440)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[SecuritySolution][Navigation] Unify Notes link
(elastic#199374)](elastic#199374)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Sergi
Massaneda","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-08T09:43:30Z","message":"[SecuritySolution][Navigation]
Unify Notes link (elastic#199374)\n\n## Summary\r\n\r\nBug Issue:
https://github.com/elastic/kibana/issues/197694\r\n\r\nUnify the Notes
link configuration.\r\n\r\n- ESS classic nav (default) -> subLink of the
`Manage` section\r\n- ESS solution nav / Serverless -> `Manage` section
is removed and the\r\n`Notes` link is relocated as a sublink of the
`Investigations` section\r\n \r\nBreadcrumbs and global search results
are now consistent with the page's\r\nlocation in each
environment.\r\n\r\n### Screenshots\r\n\r\nClassic
nav:\r\n\r\n![search\r\nclassic](https://github.com/user-attachments/assets/0c0f31e8-3e34-4348-b0f0-2f7ea9fc18ab)\r\n![breadcrumbs\r\nclassic](https://github.com/user-attachments/assets/1cdeec4b-436f-4fa0-b04d-058fb8802509)\r\n\r\nSolution
nav:\r\n\r\n![search\r\nsolution](https://github.com/user-attachments/assets/a915dc1e-ecdc-4d41-97a7-fa280307fb9e)\r\n![breadcrumbs\r\nsolution](https://github.com/user-attachments/assets/254b66b2-da1f-4563-acaf-568018035daf)","sha":"fb4ed90cae6f2c2ad426648f5a352b05b5e2bdfc","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:skip","v9.0.0","Team:Threat
Hunting","backport:prev-minor","v8.16.0","backport:version","v8.17.0"],"title":"[SecuritySolution][Navigation]
Unify Notes
link","number":199374,"url":"https://github.com/elastic/kibana/pull/199374","mergeCommit":{"message":"[SecuritySolution][Navigation]
Unify Notes link (elastic#199374)\n\n## Summary\r\n\r\nBug Issue:
https://github.com/elastic/kibana/issues/197694\r\n\r\nUnify the Notes
link configuration.\r\n\r\n- ESS classic nav (default) -> subLink of the
`Manage` section\r\n- ESS solution nav / Serverless -> `Manage` section
is removed and the\r\n`Notes` link is relocated as a sublink of the
`Investigations` section\r\n \r\nBreadcrumbs and global search results
are now consistent with the page's\r\nlocation in each
environment.\r\n\r\n### Screenshots\r\n\r\nClassic
nav:\r\n\r\n![search\r\nclassic](https://github.com/user-attachments/assets/0c0f31e8-3e34-4348-b0f0-2f7ea9fc18ab)\r\n![breadcrumbs\r\nclassic](https://github.com/user-attachments/assets/1cdeec4b-436f-4fa0-b04d-058fb8802509)\r\n\r\nSolution
nav:\r\n\r\n![search\r\nsolution](https://github.com/user-attachments/assets/a915dc1e-ecdc-4d41-97a7-fa280307fb9e)\r\n![breadcrumbs\r\nsolution](https://github.com/user-attachments/assets/254b66b2-da1f-4563-acaf-568018035daf)","sha":"fb4ed90cae6f2c2ad426648f5a352b05b5e2bdfc"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/199374","number":199374,"mergeCommit":{"message":"[SecuritySolution][Navigation]
Unify Notes link (elastic#199374)\n\n## Summary\r\n\r\nBug Issue:
https://github.com/elastic/kibana/issues/197694\r\n\r\nUnify the Notes
link configuration.\r\n\r\n- ESS classic nav (default) -> subLink of the
`Manage` section\r\n- ESS solution nav / Serverless -> `Manage` section
is removed and the\r\n`Notes` link is relocated as a sublink of the
`Investigations` section\r\n \r\nBreadcrumbs and global search results
are now consistent with the page's\r\nlocation in each
environment.\r\n\r\n### Screenshots\r\n\r\nClassic
nav:\r\n\r\n![search\r\nclassic](https://github.com/user-attachments/assets/0c0f31e8-3e34-4348-b0f0-2f7ea9fc18ab)\r\n![breadcrumbs\r\nclassic](https://github.com/user-attachments/assets/1cdeec4b-436f-4fa0-b04d-058fb8802509)\r\n\r\nSolution
nav:\r\n\r\n![search\r\nsolution](https://github.com/user-attachments/assets/a915dc1e-ecdc-4d41-97a7-fa280307fb9e)\r\n![breadcrumbs\r\nsolution](https://github.com/user-attachments/assets/254b66b2-da1f-4563-acaf-568018035daf)","sha":"fb4ed90cae6f2c2ad426648f5a352b05b5e2bdfc"}},{"branch":"8.16","label":"v8.16.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"url":"https://github.com/elastic/kibana/pull/199431","number":199431,"state":"OPEN"},{"branch":"8.x","label":"v8.17.0","branchLabelMappingKey":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Sergi Massaneda <[email protected]>
  • Loading branch information
kibanamachine and semd authored Nov 8, 2024
1 parent 393b0c7 commit 43f304b
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,7 @@
import { SecurityPageName } from '@kbn/security-solution-navigation';
import { cloneDeep, remove, find } from 'lodash';
import type { AppLinkItems, LinkItem } from '../../../common/links/types';
import {
createInvestigationsLinkFromNotes,
createInvestigationsLinkFromTimeline,
updateInvestigationsLinkFromNotes,
} from './sections/investigations_links';
import { createInvestigationsLink, createTimelineLink } from './sections/investigations_links';
import { mlAppLink } from './sections/ml_links';
import { createAssetsLinkFromManage } from './sections/assets_links';
import { createSettingsLinksFromManage } from './sections/settings_links';
Expand All @@ -24,25 +20,6 @@ import { createSettingsLinksFromManage } from './sections/settings_links';
export const solutionAppLinksSwitcher = (appLinks: AppLinkItems): AppLinkItems => {
const solutionAppLinks = cloneDeep(appLinks) as LinkItem[];

// Remove timeline link
const [timelineLinkItem] = remove(solutionAppLinks, { id: SecurityPageName.timelines });
if (timelineLinkItem) {
solutionAppLinks.push(createInvestigationsLinkFromTimeline(timelineLinkItem));
}

// Remove note link
const investigationsLinkItem = find(solutionAppLinks, { id: SecurityPageName.investigations });
const [noteLinkItem] = remove(solutionAppLinks, { id: SecurityPageName.notes });
if (noteLinkItem) {
if (!investigationsLinkItem) {
solutionAppLinks.push(createInvestigationsLinkFromNotes(noteLinkItem));
} else {
solutionAppLinks.push(
updateInvestigationsLinkFromNotes(investigationsLinkItem, noteLinkItem)
);
}
}

// Remove manage link
const [manageLinkItem] = remove(solutionAppLinks, { id: SecurityPageName.administration });

Expand All @@ -51,6 +28,22 @@ export const solutionAppLinksSwitcher = (appLinks: AppLinkItems): AppLinkItems =
solutionAppLinks.push(...createSettingsLinksFromManage(manageLinkItem));
}

// Create investigations link
const investigationsLinks = [];
const [timelineLinkItem] = remove(solutionAppLinks, { id: SecurityPageName.timelines });
if (timelineLinkItem) {
investigationsLinks.push(createTimelineLink(timelineLinkItem));
}
if (manageLinkItem) {
const noteLinkItem = find(manageLinkItem.links, { id: SecurityPageName.notes });
if (noteLinkItem) {
investigationsLinks.push(noteLinkItem);
}
}
if (investigationsLinks.length > 0) {
solutionAppLinks.push(createInvestigationsLink(investigationsLinks));
}

// Add ML link
solutionAppLinks.push(mlAppLink);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,37 +24,16 @@ const investigationsAppLink: LinkItem = {
links: [], // timeline and note links are added via the methods below
};

export const createInvestigationsLinkFromTimeline = (timelineLink: LinkItem): LinkItem => {
return {
...investigationsAppLink,
links: [
{ ...timelineLink, description: i18n.TIMELINE_DESCRIPTION, landingIcon: IconTimelineLazy },
],
};
};

export const createInvestigationsLinkFromNotes = (noteLink: LinkItem): LinkItem => {
return {
...investigationsAppLink,
links: [{ ...noteLink, description: i18n.NOTE_DESCRIPTION, landingIcon: IconTimelineLazy }],
};
};
export const createInvestigationsLink = (links: LinkItem[]): LinkItem => ({
...investigationsAppLink,
links,
});

export const updateInvestigationsLinkFromNotes = (
investigationsLink: LinkItem,
noteLink: LinkItem
): LinkItem => {
const currentLinks = investigationsLink.links ?? [];
currentLinks.push({
...noteLink,
description: i18n.NOTE_DESCRIPTION,
landingIcon: 'filebeatApp',
});
return {
...investigationsLink,
links: currentLinks,
};
};
export const createTimelineLink = (timelineLink: LinkItem): LinkItem => ({
...timelineLink,
description: i18n.TIMELINE_DESCRIPTION,
landingIcon: IconTimelineLazy,
});

// navLinks define the navigation links for the Security Solution pages and External pages as well
export const investigationsNavLinks: SolutionNavLink[] = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ export const TIMELINE_DESCRIPTION = i18n.translate(
}
);

export const NOTE_DESCRIPTION = i18n.translate(
'xpack.securitySolution.navLinks.investigations.note.title',
{
defaultMessage:
'Oversee, revise, and revisit the notes attached to alerts, events and Timelines.',
}
);

export const OSQUERY_TITLE = i18n.translate(
'xpack.securitySolution.navLinks.investigations.osquery.title',
{
Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/security_solution/public/app_links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*/
import type { CoreStart } from '@kbn/core/public';

import { links as notesLink } from './notes/links';
import { links as attackDiscoveryLinks } from './attack_discovery/links';
import type { AppLinkItems } from './common/links/types';
import { indicatorsLinks } from './threat_intelligence/links';
Expand Down Expand Up @@ -36,7 +35,6 @@ export const appLinks: AppLinkItems = Object.freeze([
rulesLinks,
onboardingLinks,
managementLinks,
notesLink,
]);

export const getFilteredLinks = async (
Expand All @@ -57,6 +55,5 @@ export const getFilteredLinks = async (
rulesLinks,
onboardingLinks,
managementFilteredLinks,
notesLink,
]);
};
18 changes: 2 additions & 16 deletions x-pack/plugins/security_solution/public/management/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
EVENT_FILTERS_PATH,
HOST_ISOLATION_EXCEPTIONS_PATH,
MANAGE_PATH,
NOTES_PATH,
POLICIES_PATH,
RESPONSE_ACTIONS_HISTORY_PATH,
SecurityPageName,
Expand All @@ -38,13 +37,13 @@ import {
RESPONSE_ACTIONS_HISTORY,
TRUSTED_APPLICATIONS,
ENTITY_ANALYTICS_RISK_SCORE,
NOTES,
ENTITY_STORE,
} from '../app/translations';
import { licenseService } from '../common/hooks/use_license';
import type { LinkItem } from '../common/links/types';
import type { StartPlugins } from '../types';
import { cloudDefendLink } from '../cloud_defend/links';
import { links as notesLink } from '../notes/links';
import { IconConsole } from '../common/icons/console';
import { IconShield } from '../common/icons/shield';
import { IconEndpoints } from '../common/icons/endpoints';
Expand Down Expand Up @@ -218,20 +217,7 @@ export const links: LinkItem = {
hideTimeline: true,
},
cloudDefendLink,
{
id: SecurityPageName.notes,
title: NOTES,
description: i18n.translate('xpack.securitySolution.appLinks.notesDescription', {
defaultMessage:
'Oversee, revise, and revisit the notes attached to alerts, events and Timelines.',
}),
landingIcon: 'filebeatApp',
path: NOTES_PATH,
skipUrlState: true,
hideTimeline: true,
hideWhenExperimentalKey: 'securitySolutionNotesDisabled',
globalSearchDisabled: true,
},
notesLink,
],
};

Expand Down
15 changes: 8 additions & 7 deletions x-pack/plugins/security_solution/public/notes/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ import type { LinkItem } from '../common/links/types';

export const links: LinkItem = {
id: SecurityPageName.notes,
title: NOTES,
path: NOTES_PATH,
title: NOTES,
description: i18n.translate('xpack.securitySolution.appLinks.notesDescription', {
defaultMessage:
'Oversee, revise, and revisit the notes attached to alerts, events and Timelines.',
}),
capabilities: [`${SERVER_APP_ID}.show`],
globalSearchKeywords: [
i18n.translate('xpack.securitySolution.appLinks.notes', {
defaultMessage: 'Notes',
}),
],
links: [],
landingIcon: 'filebeatApp',
skipUrlState: true,
hideTimeline: true,
hideWhenExperimentalKey: 'securitySolutionNotesDisabled',
};
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -37253,7 +37253,6 @@
"xpack.securitySolution.appLinks.network.flows": "Flux",
"xpack.securitySolution.appLinks.network.http": "HTTP",
"xpack.securitySolution.appLinks.network.tls": "TLS",
"xpack.securitySolution.appLinks.notes": "Notes",
"xpack.securitySolution.appLinks.notesDescription": "Superviser, réviser et revoir les annotations dans chaque document et chronologie.",
"xpack.securitySolution.appLinks.overview": "Aperçu",
"xpack.securitySolution.appLinks.overviewDescription": "Résumé de votre activité d'environnement de sécurité, y compris les alertes, les événements, les éléments récents et un fil d'actualités !",
Expand Down Expand Up @@ -41731,7 +41730,6 @@
"xpack.securitySolution.navLinks.assets.title": "Ressources",
"xpack.securitySolution.navLinks.devTools.title": "Outils de développeur",
"xpack.securitySolution.navLinks.discover.title": "Discover",
"xpack.securitySolution.navLinks.investigations.note.title": "Superviser, réviser et revoir les annotations dans chaque document et chronologie",
"xpack.securitySolution.navLinks.investigations.osquery.description": "Déployez Osquery avec Elastic Agent, puis exécutez et planifiez des requêtes dans Kibana",
"xpack.securitySolution.navLinks.investigations.osquery.title": "Osquery",
"xpack.securitySolution.navLinks.investigations.timeline.title": "Emplacement central pour les chronologies et les modèles de chronologies",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -37220,7 +37220,6 @@
"xpack.securitySolution.appLinks.network.flows": "Flow",
"xpack.securitySolution.appLinks.network.http": "HTTP",
"xpack.securitySolution.appLinks.network.tls": "TLS",
"xpack.securitySolution.appLinks.notes": "メモ",
"xpack.securitySolution.appLinks.notesDescription": "各ドキュメントとタイムライン内の注釈を監視、修正、再検討します。",
"xpack.securitySolution.appLinks.overview": "概要",
"xpack.securitySolution.appLinks.overviewDescription": "アラート、イベント、最近のアイテム、ニュースフィードを含む、セキュリティ環境アクティビティの概要。",
Expand Down Expand Up @@ -41697,7 +41696,6 @@
"xpack.securitySolution.navLinks.assets.title": "アセット",
"xpack.securitySolution.navLinks.devTools.title": "開発者ツール",
"xpack.securitySolution.navLinks.discover.title": "Discover",
"xpack.securitySolution.navLinks.investigations.note.title": "各ドキュメントとタイムライン内の注釈を監視、修正、再検討します",
"xpack.securitySolution.navLinks.investigations.osquery.description": "ElasticエージェントでOsqueryをデプロイし、Kibanaでクエリを実行、スケジュールします。",
"xpack.securitySolution.navLinks.investigations.osquery.title": "Osquery",
"xpack.securitySolution.navLinks.investigations.timeline.title": "タイムラインとタイムラインテンプレートの一元的な場所",
Expand Down
2 changes: 0 additions & 2 deletions x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -37289,7 +37289,6 @@
"xpack.securitySolution.appLinks.network.flows": "流",
"xpack.securitySolution.appLinks.network.http": "HTTP",
"xpack.securitySolution.appLinks.network.tls": "TLS",
"xpack.securitySolution.appLinks.notes": "备注",
"xpack.securitySolution.appLinks.notesDescription": "监管、修正和重新访问每个文档或时间线内的标注。",
"xpack.securitySolution.appLinks.overview": "概览",
"xpack.securitySolution.appLinks.overviewDescription": "您的安全环境活动摘要,包括告警、事件、最近项和新闻源!",
Expand Down Expand Up @@ -41768,7 +41767,6 @@
"xpack.securitySolution.navLinks.assets.title": "资产",
"xpack.securitySolution.navLinks.devTools.title": "开发者工具",
"xpack.securitySolution.navLinks.discover.title": "Discover",
"xpack.securitySolution.navLinks.investigations.note.title": "监管、修正和重新访问每个文档或时间线内的标注",
"xpack.securitySolution.navLinks.investigations.osquery.description": "使用 Elastic 代理部署 Osquery,然后在 Kibana 运行并排定查询",
"xpack.securitySolution.navLinks.investigations.osquery.title": "Osquery",
"xpack.securitySolution.navLinks.investigations.timeline.title": "时间线和时间线模板的中心位置",
Expand Down

0 comments on commit 43f304b

Please sign in to comment.