-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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] Add 3rd level breadcrumb to admin page #71275
Changes from all commits
8b41d4b
d57c13d
661c4ad
4df5aa7
1f6bdae
b4b87d9
6b057cf
07e9edd
36e34d2
5b58de0
baef12d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,4 @@ export type UrlStateType = | |
| 'network' | ||
| 'overview' | ||
| 'timeline' | ||
| 'management'; | ||
| 'administration'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { i18n } from '@kbn/i18n'; | ||
|
||
export const HOSTS_TAB = i18n.translate('xpack.securitySolution.hostsTab', { | ||
defaultMessage: 'Hosts', | ||
}); | ||
|
||
export const POLICIES_TAB = i18n.translate('xpack.securitySolution.policiesTab', { | ||
defaultMessage: 'Policies', | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ import React, { memo, useMemo } from 'react'; | |
import { i18n } from '@kbn/i18n'; | ||
import { useParams } from 'react-router-dom'; | ||
import { PageView, PageViewProps } from '../../common/components/endpoint/page_view'; | ||
import { ManagementSubTab } from '../types'; | ||
import { AdministrationSubTab } from '../types'; | ||
import { SecurityPageName } from '../../app/types'; | ||
import { useFormatUrl } from '../../common/components/link_to'; | ||
import { getHostListPath, getPoliciesPath } from '../common/routing'; | ||
import { useNavigateByRouterEventHandler } from '../../common/hooks/endpoint/use_navigate_by_router_event_handler'; | ||
|
||
export const ManagementPageView = memo<Omit<PageViewProps, 'tabs'>>((options) => { | ||
const { formatUrl, search } = useFormatUrl(SecurityPageName.management); | ||
const { tabName } = useParams<{ tabName: ManagementSubTab }>(); | ||
const { formatUrl, search } = useFormatUrl(SecurityPageName.administration); | ||
const { tabName } = useParams<{ tabName: AdministrationSubTab }>(); | ||
|
||
const goToEndpoint = useNavigateByRouterEventHandler( | ||
getHostListPath({ name: 'hostList' }, search) | ||
|
@@ -30,20 +30,20 @@ export const ManagementPageView = memo<Omit<PageViewProps, 'tabs'>>((options) => | |
} | ||
return [ | ||
{ | ||
name: i18n.translate('xpack.securitySolution.managementTabs.endpoints', { | ||
name: i18n.translate('xpack.securitySolution.managementTabs.hosts', { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see you created a |
||
defaultMessage: 'Hosts', | ||
}), | ||
id: ManagementSubTab.hosts, | ||
isSelected: tabName === ManagementSubTab.hosts, | ||
id: AdministrationSubTab.hosts, | ||
isSelected: tabName === AdministrationSubTab.hosts, | ||
href: formatUrl(getHostListPath({ name: 'hostList' })), | ||
onClick: goToEndpoint, | ||
}, | ||
{ | ||
name: i18n.translate('xpack.securitySolution.managementTabs.policies', { | ||
defaultMessage: 'Policies', | ||
}), | ||
id: ManagementSubTab.policies, | ||
isSelected: tabName === ManagementSubTab.policies, | ||
id: AdministrationSubTab.policies, | ||
isSelected: tabName === AdministrationSubTab.policies, | ||
href: formatUrl(getPoliciesPath()), | ||
onClick: goToPolicies, | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { | |
const policyStatus = useHostSelector( | ||
policyResponseStatus | ||
) as keyof typeof POLICY_STATUS_TO_HEALTH_COLOR; | ||
const { formatUrl } = useFormatUrl(SecurityPageName.management); | ||
const { formatUrl } = useFormatUrl(SecurityPageName.administration); | ||
|
||
const detailsResultsUpper = useMemo(() => { | ||
return [ | ||
|
@@ -106,7 +106,7 @@ export const HostDetails = memo(({ details }: { details: HostMetadata }) => { | |
path: agentDetailsWithFlyoutPath, | ||
state: { | ||
onDoneNavigateTo: [ | ||
'securitySolution:management', | ||
'securitySolution:administration', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should actually be replaced with the constant we have in |
||
{ | ||
path: getHostDetailsPath({ name: 'hostDetails', selected_host: details.host.id }), | ||
}, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,7 +89,7 @@ export const HostList = () => { | |
policyItemsLoading, | ||
endpointPackageVersion, | ||
} = useHostSelector(selector); | ||
const { formatUrl, search } = useFormatUrl(SecurityPageName.management); | ||
const { formatUrl, search } = useFormatUrl(SecurityPageName.administration); | ||
|
||
const dispatch = useDispatch<(a: HostAction) => void>(); | ||
|
||
|
@@ -127,12 +127,12 @@ export const HostList = () => { | |
}`, | ||
state: { | ||
onCancelNavigateTo: [ | ||
'securitySolution:management', | ||
'securitySolution:administration', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here and other places below - use |
||
{ path: getHostListPath({ name: 'hostList' }) }, | ||
], | ||
onCancelUrl: formatUrl(getHostListPath({ name: 'hostList' })), | ||
onSaveNavigateTo: [ | ||
'securitySolution:management', | ||
'securitySolution:administration', | ||
{ path: getHostListPath({ name: 'hostList' }) }, | ||
], | ||
}, | ||
|
@@ -145,7 +145,7 @@ export const HostList = () => { | |
path: `#/configs/${selectedPolicyId}?openEnrollmentFlyout=true`, | ||
state: { | ||
onDoneNavigateTo: [ | ||
'securitySolution:management', | ||
'securitySolution:administration', | ||
{ path: getHostListPath({ name: 'hostList' }) }, | ||
], | ||
}, | ||
|
@@ -422,7 +422,7 @@ export const HostList = () => { | |
</> | ||
)} | ||
{renderTableOrEmptyState} | ||
<SpyRoute pageName={SecurityPageName.management} /> | ||
<SpyRoute pageName={SecurityPageName.administration} /> | ||
</ManagementPageView> | ||
); | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious what the ESLint error was here.