Skip to content

Commit

Permalink
refactor: move vulnerability detection constants to a dedicated file …
Browse files Browse the repository at this point in the history
…for better organization
  • Loading branch information
guidomodarelli committed Feb 12, 2025
1 parent 9ec4fde commit ae09f91
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ import {
AppNavLinkStatus,
AppUpdater,
} from '../../../../../src/core/public';
import {
VULNERABILITY_DETECTION_ID,
VULNERABILITY_DETECTION_TITLE,
} from './constants';
import {
MITRE_ATTACK_ID,
MITRE_ATTACK_TITLE,
Expand All @@ -16,6 +12,10 @@ import {
THREAT_HUNTING_ID,
THREAT_HUNTING_TITLE,
} from './apps/threat-hunting/constants';
import {
VULNERABILITY_DETECTION_ID,
VULNERABILITY_DETECTION_TITLE,
} from './apps/vulnerability-detection/constants';

export function getThreatIntelligenceApps(updater$?: Subject<AppUpdater>) {
return [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,9 @@ import ReactDOM from 'react-dom';
import { ThreatIntelligenceNavGroup } from '../..';
import { Layout } from '../../../layout';
import { createSideNavItems } from '../../../side-nav';
import {
THREAT_INTELLIGENCE_TITLE,
VULNERABILITY_DETECTION_ID,
} from '../../constants';
import { THREAT_INTELLIGENCE_TITLE } from '../../constants';
import { VulnerabilityDetectionApp } from './vulnerability-detection-app';
import { VULNERABILITY_DETECTION_ID } from './constants';

export const renderApp = async (params: AppMountParameters) => {
const items = createSideNavItems({
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { i18n } from '@osd/i18n';
import { PLUGIN_ID } from '../../../../../common/constants';
import { buildSubAppId } from '../../../../utils';
import { THREAT_INTELLIGENCE_ID } from '../../constants';

export const VULNERABILITY_DETECTION_ID = buildSubAppId(
THREAT_INTELLIGENCE_ID,
'vulnerability_detection',
);
export const VULNERABILITY_DETECTION_TITLE = i18n.translate(
`${PLUGIN_ID}.category.${VULNERABILITY_DETECTION_ID}`,
{
defaultMessage: 'Vulnerability Detection',
},
);
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { AppMountParameters } from 'opensearch-dashboards/public';
import { VULNERABILITY_DETECTION_TITLE } from '../../constants';
import { VULNERABILITY_DETECTION_TITLE } from './constants';

interface VulnerabilityDetectionAppProps {
params: AppMountParameters;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { i18n } from '@osd/i18n';
import { PLUGIN_ID } from '../../../common/constants';
import { buildSubAppId } from '../../utils';

export const THREAT_INTELLIGENCE_ID = 'threat_intelligence';
export const THREAT_INTELLIGENCE_TITLE = i18n.translate(
Expand All @@ -16,13 +15,3 @@ export const THREAT_INTELLIGENCE_DESCRIPTION = i18n.translate(
'Collect and analyze information about potential threats to inform security decisions.',
},
);
export const VULNERABILITY_DETECTION_ID = buildSubAppId(
THREAT_INTELLIGENCE_ID,
'vulnerability_detection',
);
export const VULNERABILITY_DETECTION_TITLE = i18n.translate(
`${PLUGIN_ID}.category.${VULNERABILITY_DETECTION_ID}`,
{
defaultMessage: 'Vulnerability Detection',
},
);

0 comments on commit ae09f91

Please sign in to comment.