From 0e51ca61be444492d342e39dff5b65932bbe4698 Mon Sep 17 00:00:00 2001 From: "chantal.kelm" Date: Mon, 28 Oct 2024 15:11:54 -0300 Subject: [PATCH] Go to tactics in intellicense, clean code and eui accordion start open --- .../flyout-technique/flyout-technique.tsx | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/plugins/main/public/components/overview/mitre/framework/components/techniques/components/flyout-technique/flyout-technique.tsx b/plugins/main/public/components/overview/mitre/framework/components/techniques/components/flyout-technique/flyout-technique.tsx index f30fa75d0c..4af33091d1 100644 --- a/plugins/main/public/components/overview/mitre/framework/components/techniques/components/flyout-technique/flyout-technique.tsx +++ b/plugins/main/public/components/overview/mitre/framework/components/techniques/components/flyout-technique/flyout-technique.tsx @@ -259,9 +259,7 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => { : addRenderColumn(techniquesColumns); }; - const agentId = store.getState().appStateReducers?.currentAgentData?.id; - - const goToDashboardWithFilter = async (e, currentTechnique) => { + const goToTechniqueInIntellicense = async (e, currentTechnique) => { const indexPatternId = AppState.getCurrentPattern(); const filters = [ PatternDataSourceFilterManager.createFilter( @@ -271,7 +269,6 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => { indexPatternId, ), ]; - console.log(currentTechnique, 'currentTechnique'); const params = `tab=mitre&tabView=intelligence&tabRedirect=techniques&idToRedirect=${currentTechnique}&_g=${PatternDataSourceFilterManager.filtersToURLFormat( filters, )}`; @@ -280,6 +277,24 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => { }); }; + const goToTacticInIntellicense = async (e, tactic) => { + const indexPatternId = AppState.getCurrentPattern(); + const filters = [ + PatternDataSourceFilterManager.createFilter( + FILTER_OPERATOR.IS, + `rule.mitre.id`, + tactic, + indexPatternId, + ), + ]; + const params = `tab=mitre&tabView=intelligence&tabRedirect=tactics&idToRedirect=${ + tactic.id + }&_g=${PatternDataSourceFilterManager.filtersToURLFormat(filters)}`; + NavigationService.getInstance().navigateToApp(mitreAttack.id, { + path: `#/overview?${params}`, + }); + }; + const renderBody = (e, techniqueID) => { const { currentTechnique } = props; const { techniqueData } = state; @@ -293,17 +308,7 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => { > { - // NavigationService.getInstance().navigateToModule( - // e, - // 'overview', - // { - // tab: 'mitre', - // tabView: 'intelligence', - // tabRedirect: 'techniques', - // idToRedirect: currentTechnique, - // }, - // ); - goToDashboardWithFilter(e, currentTechnique); + goToTechniqueInIntellicense(e, currentTechnique); e.stopPropagation(); }} > @@ -324,16 +329,7 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => { > { - NavigationService.getInstance().navigateToModule( - e, - 'overview', - { - tab: 'mitre', - tabView: 'intelligence', - tabRedirect: 'tactics', - idToRedirect: tactic.id, - }, - ); + goToTacticInIntellicense(e, tactic); e.stopPropagation(); }} > @@ -355,6 +351,7 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => {

Technique details