Skip to content

Commit

Permalink
[Solution nav] Use flyout for Stack management Security Solution (#21…
Browse files Browse the repository at this point in the history
…0471)

This reverts commit 949d5d1 from
#208632 (comment).

## Summary

Closes #208636
Part of elastic/kibana-team#1439

</details>
<details><summary>Security / Serverless (no longer in this PR)</summary>

![optimized-serverless-security 4 48
01 PM](https://github.com/user-attachments/assets/33df6104-8de7-405e-8fd6-3082fc2dadb6)

</details>
<details><summary>Security / Stateful (no longer in this PR)</summary>

![optimized-stateful-security 4 48
01 PM](https://github.com/user-attachments/assets/4e654a8f-e802-4484-850e-f7b67a4fefa8)

</details>

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] New lists of Stack Management navigation items were added for
flyout menus in serverless projects using static declarations. There is
a risk that these lists have missing items, which could hurt user
experience by making the pages harder to navigate to.
  • Loading branch information
tsullivan authored Feb 11, 2025
1 parent 161ce34 commit 145d295
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export const initSideNavigation = async (services: Services) => {
management.id = 'stack_management';
management.spaceBefore = null;
management.children = stackManagementLinks;
delete management.link;
}
})
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { i18n } from '@kbn/i18n';
import type { GroupDefinition } from '@kbn/core-chrome-browser';
import type { AppDeepLinkId, GroupDefinition, NodeDefinition } from '@kbn/core-chrome-browser';
import produce from 'immer';
import { map } from 'rxjs';
import { type Services } from '../common/services';
Expand All @@ -29,6 +29,14 @@ export const initSideNavigation = async (services: Services) => {
const footerGroup: GroupDefinition | undefined = draft.footer?.find(
({ type }) => type === 'navGroup'
) as GroupDefinition;
const management = footerGroup?.children.find((child) => child.link === 'management');
if (management) {
management.renderAs = 'panelOpener';
management.id = 'stack_management';
management.spaceBefore = null;
management.children = stackManagementLinks;
delete management.link;
}
if (footerGroup) {
footerGroup.title = PROJECT_SETTINGS_TITLE;
footerGroup.children.push({ cloudLink: 'billingAndSub', openInNewTab: true });
Expand All @@ -42,3 +50,83 @@ export const initSideNavigation = async (services: Services) => {
dataTestSubj: 'securitySolutionSideNav',
});
};

// Stack Management static node definition
const stackManagementLinks: Array<NodeDefinition<AppDeepLinkId, string, string>> = [
{
title: i18n.translate('xpack.securitySolutionServerless.navLinks.projectSettings.mngt.data', {
defaultMessage: 'Data',
}),
breadcrumbStatus: 'hidden',
children: [
{ link: 'management:index_management', breadcrumbStatus: 'hidden' },
{ link: 'management:transform', breadcrumbStatus: 'hidden' },
{ link: 'management:ingest_pipelines', breadcrumbStatus: 'hidden' },
{ link: 'management:dataViews', breadcrumbStatus: 'hidden' },
{ link: 'management:jobsListLink', breadcrumbStatus: 'hidden' },
{ link: 'management:pipelines', breadcrumbStatus: 'hidden' },
{ link: 'management:data_quality', breadcrumbStatus: 'hidden' },
{ link: 'management:data_usage', breadcrumbStatus: 'hidden' },
],
},
{
title: i18n.translate('xpack.securitySolutionServerless.navLinks.projectSettings.mngt.access', {
defaultMessage: 'Access',
}),
breadcrumbStatus: 'hidden',
children: [
{ link: 'management:api_keys', breadcrumbStatus: 'hidden' },
{ link: 'management:roles', breadcrumbStatus: 'hidden' },
{
cloudLink: 'userAndRoles',
title: i18n.translate(
'xpack.securitySolutionServerless.navLinks.projectSettings.mngt.usersAndRoles',
{ defaultMessage: 'Manage organization members' }
),
},
],
},
{
title: i18n.translate(
'xpack.securitySolutionServerless.navLinks.projectSettings.mngt.alertsAndInsights',
{ defaultMessage: 'Alerts and Insights' }
),
breadcrumbStatus: 'hidden',
children: [
{ link: 'management:triggersActions', breadcrumbStatus: 'hidden' },
{ link: 'management:triggersActionsConnectors', breadcrumbStatus: 'hidden' },
{ link: 'management:maintenanceWindows', breadcrumbStatus: 'hidden' },
{ link: 'securitySolutionUI:entity_analytics-management', breadcrumbStatus: 'hidden' },
{
link: 'securitySolutionUI:entity_analytics-entity_store_management',
breadcrumbStatus: 'hidden',
},
],
},
{
title: i18n.translate(
'xpack.securitySolutionServerless.navLinks.projectSettings.mngt.content',
{ defaultMessage: 'Content' }
),
breadcrumbStatus: 'hidden',
children: [
{ link: 'management:spaces', breadcrumbStatus: 'hidden' },
{ link: 'management:objects', breadcrumbStatus: 'hidden' },
{ link: 'management:filesManagement', breadcrumbStatus: 'hidden' },
{ link: 'management:reporting', breadcrumbStatus: 'hidden' },
{ link: 'management:tags', breadcrumbStatus: 'hidden' },
{ link: 'maps' },
{ link: 'visualize' },
],
},
{
title: i18n.translate('xpack.securitySolutionServerless.navLinks.projectSettings.mngt.other', {
defaultMessage: 'Other',
}),
breadcrumbStatus: 'hidden',
children: [
{ link: 'management:settings', breadcrumbStatus: 'hidden' },
{ link: 'management:securityAiAssistantManagement', breadcrumbStatus: 'hidden' },
],
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
await svlCommonNavigation.search.hideSearch();
await headerPage.waitUntilLoadingHasFinished();

await expect(await browser.getCurrentUrl()).contain('app/security/dashboards');
expect(await browser.getCurrentUrl()).contain('app/security/dashboards');
});

it('shows cases in sidebar navigation', async () => {
Expand All @@ -74,12 +74,13 @@ export default function ({ getPageObject, getService }: FtrProviderContext) {
await testSubjects.existOrFail('cases-all-title');
});
});

it('navigates to maintenance windows', async () => {
await svlCommonPage.loginAsAdmin();
await svlSecNavigation.navigateToLandingPage();
await svlCommonNavigation.sidenav.openSection('category-management');
await svlCommonNavigation.sidenav.clickLink({ deepLinkId: 'management' });
await testSubjects.click('app-card-maintenanceWindows');
await svlCommonNavigation.sidenav.clickLink({ navId: 'stack_management' });
await svlCommonNavigation.sidenav.clickPanelLink('management:maintenanceWindows');
await svlCommonNavigation.breadcrumbs.expectBreadcrumbTexts([
'Stack Management',
'Maintenance Windows',
Expand Down

0 comments on commit 145d295

Please sign in to comment.