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] Remove legacy navigation and related logic #158094

Merged
merged 14 commits into from
May 31, 2023
501 changes: 0 additions & 501 deletions x-pack/packages/security-solution/data_table/common/constants.ts

This file was deleted.

13 changes: 12 additions & 1 deletion x-pack/packages/security-solution/data_table/mock/mock_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,18 @@

import type { MappingRuntimeFields } from '@elastic/elasticsearch/lib/api/typesWithBodyKey';
import { BrowserFields } from '@kbn/timelines-plugin/common';
import { DEFAULT_INDEX_PATTERN } from '../common/constants';

const DEFAULT_INDEX_PATTERN = [
'apm-*-transaction*',
'auditbeat-*',
'endgame-*',
'filebeat-*',
'logs-*',
'packetbeat-*',
'traces-apm*',
'winlogbeat-*',
'-*elastic-cloud-logs-*',
];

export const mockBrowserFields: BrowserFields = {
agent: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*/

import { cloudDefendPages } from './constants';
import { getSecuritySolutionLink, getSecuritySolutionNavTab } from './security_solution_links';
import { getSecuritySolutionLink } from './security_solution_links';
import { Chance } from 'chance';
import type { CloudDefendPage } from './types';

Expand All @@ -23,17 +23,3 @@ describe('getSecuritySolutionLink', () => {
expect(link.title).toEqual(cloudDefendPages[cloudDefendPage].name);
});
});

describe('getSecuritySolutionNavTab', () => {
it('gets the correct nav tab properties', () => {
const cloudDefendPage = chance.pickone<CloudDefendPage>(['policies']);
const basePath = chance.word();

const navTab = getSecuritySolutionNavTab(cloudDefendPage, basePath);

expect(navTab.id).toEqual(cloudDefendPages[cloudDefendPage].id);
expect(navTab.name).toEqual(cloudDefendPages[cloudDefendPage].name);
expect(navTab.href).toEqual(`${basePath}${cloudDefendPages[cloudDefendPage].path}`);
expect(navTab.disabled).toEqual(!!cloudDefendPages[cloudDefendPage].disabled);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ interface CloudDefendLinkItem<TId extends string = CloudDefendPageId> {
path: string;
}

interface CloudDefendNavTab<TId extends string = CloudDefendPageId> {
id: TId;
name: string;
href: string;
disabled: boolean;
}

/**
* Gets the cloud_defend link properties of a Cloud Defend page for navigation in the security solution.
* @param cloudDefendPage the name of the cloud defend page.
Expand All @@ -34,18 +27,3 @@ export const getSecuritySolutionLink = <TId extends string = CloudDefendPageId>(
path: cloudDefendPages[cloudDefendPage].path,
};
};

/**
* Gets the link properties of a Cloud Defend page for navigation in the old security solution navigation.
* @param cloudDefendPage the name of the cloud defend page.
* @param basePath the base path for links.
*/
export const getSecuritySolutionNavTab = <TId extends string = CloudDefendPageId>(
cloudDefendPage: CloudDefendPage,
basePath: string
): CloudDefendNavTab<TId> => ({
id: cloudDefendPages[cloudDefendPage].id as TId,
name: cloudDefendPages[cloudDefendPage].name,
href: `${basePath}${cloudDefendPages[cloudDefendPage].path}`,
disabled: !!cloudDefendPages[cloudDefendPage].disabled,
});
5 changes: 1 addition & 4 deletions x-pack/plugins/cloud_defend/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
import { CloudDefendPlugin } from './plugin';

export type { CloudDefendSecuritySolutionContext } from './types';
export {
getSecuritySolutionLink,
getSecuritySolutionNavTab,
} from './common/navigation/security_solution_links';
export { getSecuritySolutionLink } from './common/navigation/security_solution_links';
export { CLOUD_DEFEND_BASE_PATH } from './common/navigation/constants';
export type { CloudDefendPageId } from './common/navigation/types';

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

import { cloudPosturePages } from './constants';
import { getSecuritySolutionLink, getSecuritySolutionNavTab } from './security_solution_links';
import { getSecuritySolutionLink } from './security_solution_links';
import { Chance } from 'chance';
import type { CspPage } from './types';

Expand All @@ -23,17 +23,3 @@ describe('getSecuritySolutionLink', () => {
expect(link.title).toEqual(cloudPosturePages[cspPage].name);
});
});

describe('getSecuritySolutionNavTab', () => {
it('gets the correct nav tab properties', () => {
const cspPage = chance.pickone<CspPage>(['dashboard', 'findings', 'benchmarks']);
const basePath = chance.word();

const navTab = getSecuritySolutionNavTab(cspPage, basePath);

expect(navTab.id).toEqual(cloudPosturePages[cspPage].id);
expect(navTab.name).toEqual(cloudPosturePages[cspPage].name);
expect(navTab.href).toEqual(`${basePath}${cloudPosturePages[cspPage].path}`);
expect(navTab.disabled).toEqual(!!cloudPosturePages[cspPage].disabled);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,6 @@ interface CloudSecurityPostureLinkItem<TId extends string = CloudSecurityPosture
path: string;
}

interface CloudSecurityPostureNavTab<TId extends string = CloudSecurityPosturePageId> {
id: TId;
name: string;
href: string;
disabled: boolean;
}

/**
* Gets the cloud security posture link properties of a CSP page for navigation in the security solution.
* @param cloudSecurityPosturePage the name of the cloud posture page.
Expand All @@ -32,18 +25,3 @@ export const getSecuritySolutionLink = <TId extends string = CloudSecurityPostur
title: cloudPosturePages[cloudSecurityPosturePage].name,
path: cloudPosturePages[cloudSecurityPosturePage].path,
});

/**
* Gets the cloud security posture link properties of a CSP page for navigation in the old security solution navigation.
* @param cloudSecurityPosturePage the name of the cloud posture page.
* @param basePath the base path for links.
*/
export const getSecuritySolutionNavTab = <TId extends string = CloudSecurityPosturePageId>(
cloudSecurityPosturePage: CspPage,
basePath: string
): CloudSecurityPostureNavTab<TId> => ({
id: cloudPosturePages[cloudSecurityPosturePage].id as TId,
name: cloudPosturePages[cloudSecurityPosturePage].name,
href: `${basePath}${cloudPosturePages[cloudSecurityPosturePage].path}`,
disabled: !!cloudPosturePages[cloudSecurityPosturePage].disabled,
});
5 changes: 1 addition & 4 deletions x-pack/plugins/cloud_security_posture/public/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ import { CspPlugin } from './plugin';
export type { CspSecuritySolutionContext } from './types';
export { CLOUD_SECURITY_POSTURE_BASE_PATH } from './common/navigation/constants';
export type { CloudSecurityPosturePageId } from './common/navigation/types';
export {
getSecuritySolutionLink,
getSecuritySolutionNavTab,
} from './common/navigation/security_solution_links';
export { getSecuritySolutionLink } from './common/navigation/security_solution_links';

export type { CspClientPluginSetup, CspClientPluginStart } from './types';

Expand Down
3 changes: 0 additions & 3 deletions x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,6 @@ export const INCLUDE_INDEX_PATTERN = [
/** The comma-delimited list of Elasticsearch indices from which the SIEM app collects events, and the exclude index pattern */
export const DEFAULT_INDEX_PATTERN = [...INCLUDE_INDEX_PATTERN, ...EXCLUDE_ELASTIC_CLOUD_INDICES];

/** This Kibana Advanced Setting enables the grouped navigation in Security Solution */
export const ENABLE_GROUPED_NAVIGATION = 'securitySolution:enableGroupedNav' as const;

/** This Kibana Advanced Setting enables the `Security news` feed widget */
export const ENABLE_NEWS_FEED_SETTING = 'securitySolution:enableNewsFeed' as const;

Expand Down
195 changes: 0 additions & 195 deletions x-pack/plugins/security_solution/public/app/deep_links/index.test.ts

This file was deleted.

Loading