Skip to content

Commit

Permalink
clean code
Browse files Browse the repository at this point in the history
  • Loading branch information
chantal-kelm committed Oct 28, 2024
1 parent dcd44ca commit 3eb00b4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,8 @@ import { FlyoutTechnique } from '../../../../overview/mitre/framework/components
import { getMitreCount } from './lib';
import { useAsyncActionRunOnStart, useTimeFilter } from '../../../hooks';
import NavigationService from '../../../../../react-services/navigation-service';
import { getWzCurrentAppID } from '../../../../../kibana-services';
import { AppState } from '../../../../../react-services';
import {
mitreAttack,
endpointSummary,
} from '../../../../../utils/applications';
import { mitreAttack } from '../../../../../utils/applications';
import {
FILTER_OPERATOR,
PatternDataSourceFilterManager,
Expand Down Expand Up @@ -117,14 +113,6 @@ const MitreTopTacticsTechniques = ({
const onChangeFlyout = () => {
setShowTechniqueDetails('');
};
const openDiscover = (e, techniqueID) => {
if (getWzCurrentAppID() === endpointSummary.id) {
NavigationService.getInstance().navigateToApp(mitreAttack.id, {
path: `#/overview?tab=mitre&tabView=dashboard&agentId=${agentId}`,
filters: { 'rule.mitre.id': techniqueID },
});
}
};

const goToDashboardWithFilter = async (e, techniqueID) => {
const indexPatternId = AppState.getCurrentPattern();
Expand Down Expand Up @@ -164,20 +152,6 @@ const MitreTopTacticsTechniques = ({
});
};

const openDashboard = (e, techniqueID) => {
if (getWzCurrentAppID() === endpointSummary.id) {
NavigationService.getInstance().navigateToApp(mitreAttack.id, {
path: `#/overview?tab=mitre&tabView=dashboard&agentId=${agentId}`,
filters: { 'rule.mitre.id': techniqueID },
});
} else {
NavigationService.getInstance().navigateToModule(e, 'overview', {
tab: 'mitre',
tabView: 'dashboard',
filters: { 'rule.mitre.id': techniqueID },
});
}
};
return (
<FlyoutTechnique
openDashboard={(e, itemId) => goToDashboardWithFilter(e, itemId)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,7 @@ import store from '../../../../../../../../redux/store';
import NavigationService from '../../../../../../../../react-services/navigation-service';
import { wzDiscoverRenderColumns } from '../../../../../../../common/wazuh-discover/render-columns';
import { AppState } from '../../../../../../../../react-services';
import {
mitreAttack,
endpointSummary,
} from '../../../../../../../../utils/applications';
import { mitreAttack } from '../../../../../../../../utils/applications';

type tFlyoutTechniqueProps = {
currentTechnique: string;
Expand Down Expand Up @@ -295,7 +292,7 @@ export const FlyoutTechnique = (props: tFlyoutTechniqueProps) => {
});
};

const renderBody = (e, techniqueID) => {
const renderBody = e => {
const { currentTechnique } = props;
const { techniqueData } = state;
const data = [
Expand Down

0 comments on commit 3eb00b4

Please sign in to comment.