Skip to content

Commit

Permalink
Migrate "Investigate" tab group to new side navigation (#102705)
Browse files Browse the repository at this point in the history
* Migrate "Investigate" tab group to new side navigation

It includes:
* Timelines
* Cases

* Quick fix useFormatUrl and HeaderPage navigation
  • Loading branch information
machadoum authored and XavierM committed Jun 23, 2021
1 parent 21b788d commit b7fca6b
Show file tree
Hide file tree
Showing 37 changed files with 231 additions and 458 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,6 @@ export const applicationUsageSchema = {
security_logout: commonSchema,
security_overwritten_session: commonSchema,
securitySolution: commonSchema, // It's a forward app so we'll likely never report it
'securitySolution:timelines': commonSchema,
'securitySolution:case': commonSchema,
'securitySolution:administration': commonSchema,
siem: commonSchema,
space_selector: commonSchema,
Expand Down
262 changes: 0 additions & 262 deletions src/plugins/telemetry/schema/oss_plugins.json
Original file line number Diff line number Diff line change
Expand Up @@ -5411,268 +5411,6 @@
}
}
},
"securitySolution:timelines": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "Always `main`"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 90 days"
}
},
"views": {
"type": "array",
"items": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "The application view being tracked"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application sub view since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application sub view is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 90 days"
}
}
}
}
}
}
},
"securitySolution:case": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "Always `main`"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen over the last 90 days"
}
},
"views": {
"type": "array",
"items": {
"properties": {
"appId": {
"type": "keyword",
"_meta": {
"description": "The application being tracked"
}
},
"viewId": {
"type": "keyword",
"_meta": {
"description": "The application view being tracked"
}
},
"clicks_total": {
"type": "long",
"_meta": {
"description": "General number of clicks in the application sub view since we started counting them"
}
},
"clicks_7_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 7 days"
}
},
"clicks_30_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 30 days"
}
},
"clicks_90_days": {
"type": "long",
"_meta": {
"description": "General number of clicks in the active application sub view over the last 90 days"
}
},
"minutes_on_screen_total": {
"type": "float",
"_meta": {
"description": "Minutes the application sub view is active and on-screen since we started counting them."
}
},
"minutes_on_screen_7_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 7 days"
}
},
"minutes_on_screen_30_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 30 days"
}
},
"minutes_on_screen_90_days": {
"type": "float",
"_meta": {
"description": "Minutes the application is active and on-screen active application sub view over the last 90 days"
}
}
}
}
}
}
},
"securitySolution:administration": {
"properties": {
"appId": {
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ export enum SecurityPageGroupName {
manage = 'manage',
}

export const TIMELINES_PATH = '/timelines';
export const CASES_PATH = '/cases';
export const OVERVIEW_PATH = '/overview';
export const ALERTS_PATH = '/alerts';
export const RULES_PATH = '/rules';
Expand Down
2 changes: 2 additions & 0 deletions x-pack/plugins/security_solution/public/app/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ export const renderApp = ({
...(subPlugins.alerts.routes ?? []),
...(subPlugins.rules.routes ?? []),
...(subPlugins.exceptions.routes ?? []),
...(subPlugins.timelines.routes ?? []),
...(subPlugins.cases.routes ?? []),
/* TODO: [1101] add subPlugins routes here when migrating sections, once all migrated we will be able to inject all subPlugins routes at once */
].map((route, index) => (
<Route key={`subpligin-route-${index}`} {...route} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from '../../../common/components/link_to';
import { SecurityPageName } from '../../../app/types';
import { useKibana } from '../../../common/lib/kibana';
import { APP_ID, CASES_APP_ID } from '../../../../common/constants';
import { APP_ID } from '../../../../common/constants';

export interface AllCasesNavProps {
detailName: string;
Expand All @@ -36,7 +36,8 @@ export const AllCases = React.memo<AllCasesProps>(({ userCanCrud }) => {
const goToCreateCase = useCallback(
async (ev) => {
ev.preventDefault();
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: getCreateCaseUrl(urlSearch),
});
},
Expand All @@ -46,7 +47,8 @@ export const AllCases = React.memo<AllCasesProps>(({ userCanCrud }) => {
const goToCaseConfigure = useCallback(
async (ev) => {
ev.preventDefault();
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: getConfigureCasesUrl(urlSearch),
});
},
Expand All @@ -59,7 +61,8 @@ export const AllCases = React.memo<AllCasesProps>(({ userCanCrud }) => {
return formatUrl(getCaseDetailsUrl({ id: detailName, subCaseId }));
},
onClick: async ({ detailName, subCaseId, search }: AllCasesNavProps) => {
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: getCaseDetailsUrl({ id: detailName, search, subCaseId }),
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,7 @@ import { Case } from '../../../../../cases/common';
import { TimelineId } from '../../../../common/types/timeline';
import { SecurityPageName } from '../../../app/types';
import { KibanaServices, useKibana } from '../../../common/lib/kibana';
import {
APP_ID,
CASES_APP_ID,
DETECTION_ENGINE_QUERY_SIGNALS_URL,
} from '../../../../common/constants';
import { APP_ID, DETECTION_ENGINE_QUERY_SIGNALS_URL } from '../../../../common/constants';
import { timelineActions } from '../../../timelines/store/timeline';
import { useSourcererScope } from '../../../common/containers/sourcerer';
import { SourcererScopeName } from '../../../common/store/sourcerer/model';
Expand Down Expand Up @@ -185,7 +181,8 @@ export const CaseView = React.memo(({ caseId, subCaseId, userCanCrud }: Props) =
if (e) {
e.preventDefault();
}
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: allCasesLink,
});
},
Expand All @@ -196,7 +193,8 @@ export const CaseView = React.memo(({ caseId, subCaseId, userCanCrud }: Props) =
if (e) {
e.preventDefault();
}
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: getCaseDetailsUrl({ id: caseId }),
});
},
Expand All @@ -208,7 +206,8 @@ export const CaseView = React.memo(({ caseId, subCaseId, userCanCrud }: Props) =
if (e) {
e.preventDefault();
}
return navigateToApp(CASES_APP_ID, {
return navigateToApp(APP_ID, {
deepLinkId: SecurityPageName.case,
path: getConfigureCasesUrl(search),
});
},
Expand Down
Loading

0 comments on commit b7fca6b

Please sign in to comment.