diff --git a/x-pack/plugins/observability/public/hooks/create_use_rules_link.ts b/x-pack/plugins/observability/public/hooks/create_use_rules_link.ts index f7995a938c61b..fc9fa73f234b6 100644 --- a/x-pack/plugins/observability/public/hooks/create_use_rules_link.ts +++ b/x-pack/plugins/observability/public/hooks/create_use_rules_link.ts @@ -11,7 +11,7 @@ export function createUseRulesLink(isNewRuleManagementEnabled = false) { const linkProps = isNewRuleManagementEnabled ? { app: 'observability', - pathname: '/rules', + pathname: '/alerts/rules', } : { app: 'management', diff --git a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx index 939223feb87c0..dbe095c311c0f 100644 --- a/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx +++ b/x-pack/plugins/observability/public/pages/alerts/containers/alerts_page/alerts_page.tsx @@ -147,7 +147,7 @@ function AlertsPage() { }, []); const manageRulesHref = config.unsafe.rules.enabled - ? http.basePath.prepend('/app/observability/rules') + ? http.basePath.prepend('/app/observability/alerts/rules') : http.basePath.prepend('/app/management/insightsAndAlerting/triggersActions/rules'); const dynamicIndexPatternsAsyncState = useAsync(async (): Promise => { diff --git a/x-pack/plugins/observability/public/pages/rules/index.tsx b/x-pack/plugins/observability/public/pages/rules/index.tsx index 21664ca63507d..a0b95441f4857 100644 --- a/x-pack/plugins/observability/public/pages/rules/index.tsx +++ b/x-pack/plugins/observability/public/pages/rules/index.tsx @@ -19,6 +19,7 @@ import { EuiFieldSearch, OnRefreshChangeProps, } from '@elastic/eui'; +import { i18n } from '@kbn/i18n'; import { FormattedMessage } from '@kbn/i18n-react'; import { usePluginContext } from '../../hooks/use_plugin_context'; import { useBreadcrumbs } from '../../hooks/use_breadcrumbs'; @@ -140,6 +141,12 @@ export function RulesPage() { }, [refreshInterval, reload, isPaused]); useBreadcrumbs([ + { + text: i18n.translate('xpack.observability.breadcrumbs.alertsLinkText', { + defaultMessage: 'Alerts', + }), + href: http.basePath.prepend('/app/observability/alerts'), + }, { text: RULES_BREADCRUMB_TEXT, }, diff --git a/x-pack/plugins/observability/public/plugin.ts b/x-pack/plugins/observability/public/plugin.ts index 9d483b63ac0a9..ed591d45a9820 100644 --- a/x-pack/plugins/observability/public/plugin.ts +++ b/x-pack/plugins/observability/public/plugin.ts @@ -93,21 +93,22 @@ export class Plugin order: 8001, path: '/alerts', navLinkStatus: AppNavLinkStatus.hidden, - }, - { - id: 'rules', - title: i18n.translate('xpack.observability.rulesLinkTitle', { - defaultMessage: 'Rules', - }), - order: 8002, - path: '/rules', - navLinkStatus: AppNavLinkStatus.hidden, + deepLinks: [ + { + id: 'rules', + title: i18n.translate('xpack.observability.rulesLinkTitle', { + defaultMessage: 'Rules', + }), + path: '/alerts/rules', + navLinkStatus: AppNavLinkStatus.hidden, + }, + ], }, getCasesDeepLinks({ basePath: casesPath, extend: { [CasesDeepLinkId.cases]: { - order: 8003, + order: 8002, navLinkStatus: AppNavLinkStatus.hidden, }, [CasesDeepLinkId.casesCreate]: { diff --git a/x-pack/plugins/observability/public/routes/index.tsx b/x-pack/plugins/observability/public/routes/index.tsx index d895f55152ef8..528dbfee06f9d 100644 --- a/x-pack/plugins/observability/public/routes/index.tsx +++ b/x-pack/plugins/observability/public/routes/index.tsx @@ -88,7 +88,7 @@ export const routes = { }, exact: true, }, - '/rules': { + '/alerts/rules': { handler: () => { return ; }, diff --git a/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts b/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts index 3cfe612037e0c..3a0e4046291e4 100644 --- a/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts +++ b/x-pack/test/functional/apps/apm/feature_controls/apm_security.ts @@ -64,7 +64,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(navLinks.map((link) => link.text)).to.eql([ 'Overview', 'Alerts', - 'Rules', 'APM', 'User Experience', 'Stack Management', @@ -120,7 +119,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(navLinks).to.eql([ 'Overview', 'Alerts', - 'Rules', 'APM', 'User Experience', 'Stack Management', diff --git a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts index 64387753dc39a..f713c903ebe1e 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/infrastructure_security.ts @@ -63,7 +63,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows metrics navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Rules', 'Metrics', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Metrics', 'Stack Management']); }); describe('infrastructure landing page without data', () => { @@ -161,7 +161,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows metrics navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Rules', 'Metrics', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Metrics', 'Stack Management']); }); describe('infrastructure landing page without data', () => { diff --git a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts index aaa80407f9df4..8908a34298373 100644 --- a/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts +++ b/x-pack/test/functional/apps/infra/feature_controls/logs_security.ts @@ -60,7 +60,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Rules', 'Logs', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Logs', 'Stack Management']); }); describe('logs landing page without data', () => { @@ -123,7 +123,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows logs navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Rules', 'Logs', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Logs', 'Stack Management']); }); describe('logs landing page without data', () => { diff --git a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts index ea4e4e939d946..4d4acbe6242ba 100644 --- a/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts +++ b/x-pack/test/functional/apps/uptime/feature_controls/uptime_security.ts @@ -70,7 +70,6 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { expect(navLinks.map((link) => link.text)).to.eql([ 'Overview', 'Alerts', - 'Rules', 'Uptime', 'Stack Management', ]); @@ -124,7 +123,7 @@ export default function ({ getPageObjects, getService }: FtrProviderContext) { it('shows uptime navlink', async () => { const navLinks = (await appsMenu.readLinks()).map((link) => link.text); - expect(navLinks).to.eql(['Overview', 'Alerts', 'Rules', 'Uptime', 'Stack Management']); + expect(navLinks).to.eql(['Overview', 'Alerts', 'Uptime', 'Stack Management']); }); it('can navigate to Uptime app', async () => {