Deprecate Behavioral Analytics and Maintanence for Search Applications (#212031)

## Summary

Deprecation warnings for Behavioral Analytics removal from sidebar
Maintenance mode warnings for Search Applications.

<img width="1714" alt="Screenshot 2025-02-21 at 12 55 19"
src="https://github.com/user-attachments/assets/d97c55c4-1592-489f-bb0c-01adef09d12d"
/>
<img width="1728" alt="Screenshot 2025-02-21 at 12 55 23"
src="https://github.com/user-attachments/assets/8bf0f414-2614-4576-9268-c572ba8bf49d"
/>
<img width="1727" alt="Screenshot 2025-02-21 at 12 55 38"
src="https://github.com/user-attachments/assets/10751fe7-cf92-4487-8e0c-6ec81940594c"
/>
<img width="1724" alt="Screenshot 2025-02-21 at 12 55 47"
src="https://github.com/user-attachments/assets/354b0bc7-5f25-4016-9fb0-87ec26a032be"
/>
<img width="1728" alt="Screenshot 2025-02-21 at 12 56 16"
src="https://github.com/user-attachments/assets/ff695078-5f15-4a40-9966-2767a0773fa1"
/>
<img width="1663" alt="Screenshot 2025-02-21 at 12 56 21"
src="https://github.com/user-attachments/assets/8d0f9867-e226-4a7d-822e-be600d947a46"
/>
<img width="1536" alt="Screenshot 2025-02-21 at 12 56 37"
src="https://github.com/user-attachments/assets/cb0c4b01-e3f8-444c-a05a-a48e2f6933f2"
/>
<img width="1453" alt="Screenshot 2025-02-21 at 12 56 41"
src="https://github.com/user-attachments/assets/7fb3353f-4319-48da-8123-905240af0b64"
/>

<img width="1271" alt="Screenshot 2025-02-25 at 18 07 30"
src="https://github.com/user-attachments/assets/24235ed7-8a8b-4846-a4fb-2d5cbc3946ea"
/>

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [x] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)

---------

Co-authored-by: Liam Thompson <32779855+leemthompo@users.noreply.github.com>
This commit is contained in:
Efe Gürkan YALAMAN 2025-02-25 17:50:56 +01:00 committed by GitHub
parent 7bd5aa6fba
commit 45768bae66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
21 changed files with 276 additions and 327 deletions

View file

@ -16041,8 +16041,6 @@
"xpack.enterpriseSearch.attachIndexBox.orPanelLabel": "OR",
"xpack.enterpriseSearch.attachIndexBox.saveConfigurationButtonLabel": "Enregistrer la configuration",
"xpack.enterpriseSearch.attachIndexBox.thisIndexWillHoldTextLabel": "Cet index contiendra le contenu de la source de données et il est optimisé avec les mappings de champ par défaut pour les expériences de recherche correspondantes. Donnez un nom unique à votre index et configurez pour lui un analyseur linguistique (facultatif).",
"xpack.enterpriseSearch.behavioralAnalytics.description": "Tableaux de bord et outils permettant de visualiser le comportement des utilisateurs finaux et de mesurer les performances de vos applications de recherche",
"xpack.enterpriseSearch.behavioralAnalytics.productCardCTA": "Explorer Behavioral Analytics",
"xpack.enterpriseSearch.betaCalloutTitle": "Fonctionnalité bêta",
"xpack.enterpriseSearch.betaConnectorCalloutDescription": "Ce connecteur est en version bêta. Les fonctionnalités bêta sont susceptibles d'être modifiées et ne sont pas couvertes par l'accord de niveau de service (SLA) des fonctionnalités de la version générale (GA). Elastic prévoit de faire passer cette fonctionnalité en disponibilité générale dans une prochaine version.",
"xpack.enterpriseSearch.betaConnectorCalloutTitle": "Connecteur en version bêta",

View file

@ -15903,8 +15903,6 @@
"xpack.enterpriseSearch.attachIndexBox.optionsGroup.selectExistingIndex": "既存のインデックスを選択",
"xpack.enterpriseSearch.attachIndexBox.orPanelLabel": "OR",
"xpack.enterpriseSearch.attachIndexBox.saveConfigurationButtonLabel": "構成を保存",
"xpack.enterpriseSearch.behavioralAnalytics.description": "エンドユーザーの行動を可視化し、検索アプリケーションのパフォーマンスを測定するためのダッシュボードとツール",
"xpack.enterpriseSearch.behavioralAnalytics.productCardCTA": "Behavioral Analyticsの詳細",
"xpack.enterpriseSearch.betaCalloutTitle": "ベータ機能",
"xpack.enterpriseSearch.betaConnectorCalloutDescription": "このコネクターはベータ版です。ベータ版の機能は変更される可能性があり、一般リリースGA機能のサポートSLAではカバーされません。Elasticは将来のリリースでこの機能をGAに昇格させる予定です。",
"xpack.enterpriseSearch.betaConnectorCalloutTitle": "ベータ版コネクター",

View file

@ -15629,8 +15629,6 @@
"xpack.enterpriseSearch.attachIndexBox.orPanelLabel": "OR",
"xpack.enterpriseSearch.attachIndexBox.saveConfigurationButtonLabel": "保存配置",
"xpack.enterpriseSearch.attachIndexBox.thisIndexWillHoldTextLabel": "此索引将存放您的数据源内容,并通过默认字段映射进行优化,以提供相关搜索体验。提供唯一的索引名称,并为索引设置默认的语言分析器(可选)。",
"xpack.enterpriseSearch.behavioralAnalytics.description": "用于对最终用户行为进行可视化并评估搜索应用程序性能的仪表板和工具",
"xpack.enterpriseSearch.behavioralAnalytics.productCardCTA": "了解行为分析",
"xpack.enterpriseSearch.betaCalloutTitle": "公测版功能",
"xpack.enterpriseSearch.betaConnectorCalloutDescription": "此连接器为公测版。公测版功能可能会有所更改,并且不受公开发行版 (GA) 功能支持 SLA 的约束。Elastic 计划在未来版本中将此功能提升到 GA 版本。",
"xpack.enterpriseSearch.betaConnectorCalloutTitle": "公测版连接器",

View file

@ -54,10 +54,11 @@ describe('AnalyticsCollectionExplorer', () => {
expect(wrapper.prop('pageChrome')).toEqual([mockValues.analyticsCollection.name]);
expect(wrapper.prop('analyticsName')).toEqual(mockValues.analyticsCollection.name);
expect(wrapper.prop('pageHeader')).toEqual({
bottomBorder: false,
pageTitle: 'Explorer',
rightSideItems: [<AnalyticsCollectionToolbar />],
});
expect(wrapper.prop('pageHeader')).toEqual(
expect.objectContaining({
bottomBorder: false,
rightSideItems: [<AnalyticsCollectionToolbar />],
})
);
});
});

View file

@ -9,6 +9,7 @@ import React, { useEffect } from 'react';
import { useActions, useValues } from 'kea';
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { EnterpriseSearchAnalyticsPageTemplate } from '../../layout/page_template';
@ -36,12 +37,30 @@ export const AnalyticsCollectionExplorer: React.FC = ({}) => {
pageViewTelemetry={`View Analytics Collection - explorer`}
pageHeader={{
bottomBorder: false,
pageTitle: i18n.translate(
'xpack.enterpriseSearch.analytics.collectionsView.explorerView.title',
{
defaultMessage: 'Explorer',
}
pageTitle: (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate(
'xpack.enterpriseSearch.analytics.collectionsView.explorerView.title',
{
defaultMessage: 'Explorer',
}
)}
</h1>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.enterpriseSearch.analytics.collections.deprecatedBadge', {
defaultMessage: 'Deprecated',
})}
</EuiBadge>
</EuiFlexItem>
</EuiFlexGroup>
),
rightSideItems: [<AnalyticsCollectionToolbar />],
}}
>

View file

@ -20,6 +20,8 @@ import {
EuiLink,
EuiText,
EuiCodeBlock,
EuiTitle,
EuiBadge,
} from '@elastic/eui';
import { EuiContainedStepProps } from '@elastic/eui/src/components/steps/steps';
@ -265,11 +267,28 @@ export const AnalyticsCollectionIntegrateView: React.FC<AnalyticsCollectionInteg
pageViewTelemetry={`View Analytics Collection - integrate`}
pageHeader={{
bottomBorder: false,
pageTitle: i18n.translate(
'xpack.enterpriseSearch.analytics.collectionsView.integration.title',
{
defaultMessage: 'Tracker Integration',
}
pageTitle: (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate(
'xpack.enterpriseSearch.analytics.collectionsView.integration.title',
{
defaultMessage: 'Tracker Integration',
}
)}
</h1>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.enterpriseSearch.analytics.collections.deprecatedBadge', {
defaultMessage: 'Deprecated',
})}
</EuiBadge>
</EuiFlexItem>
</EuiFlexGroup>
),
description: i18n.translate(
'xpack.enterpriseSearch.analytics.collectionsView.integration.description',

View file

@ -9,7 +9,7 @@ import React, { useState } from 'react';
import { useActions, useValues } from 'kea';
import { EuiFlexGroup, EuiSpacer } from '@elastic/eui';
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@ -84,9 +84,26 @@ export const AnalyticsCollectionOverview: React.FC<AnalyticsCollectionOverviewPr
pageViewTelemetry={`View Analytics Collection - Overview`}
pageHeader={{
bottomBorder: false,
pageTitle: i18n.translate('xpack.enterpriseSearch.analytics.collectionsView.title', {
defaultMessage: 'Overview',
}),
pageTitle: (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate('xpack.enterpriseSearch.analytics.collectionsView.title', {
defaultMessage: 'Overview',
})}
</h1>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.enterpriseSearch.analytics.collections.deprecatedBadge', {
defaultMessage: 'Deprecated',
})}
</EuiBadge>
</EuiFlexItem>
</EuiFlexGroup>
),
rightSideItems: [<AnalyticsCollectionToolbar />],
}}
>

View file

@ -9,7 +9,7 @@ import React, { useEffect } from 'react';
import { useActions, useValues } from 'kea';
import { EuiFlexItem, EuiSpacer } from '@elastic/eui';
import { EuiBadge, EuiFlexGroup, EuiFlexItem, EuiSpacer, EuiTitle } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
@ -57,9 +57,26 @@ export const AnalyticsOverview: React.FC = () => {
'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications. Track trends over time, identify and investigate anomalies, and make optimizations.',
}
),
pageTitle: i18n.translate('xpack.enterpriseSearch.analytics.collections.pageTitle', {
defaultMessage: 'Behavioral Analytics',
}),
pageTitle: (
<EuiFlexGroup responsive={false} alignItems="center">
<EuiFlexItem grow={false}>
<EuiTitle>
<h1>
{i18n.translate('xpack.enterpriseSearch.analytics.collections.pageTitle', {
defaultMessage: 'Behavioral Analytics',
})}
</h1>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiBadge color="warning">
{i18n.translate('xpack.enterpriseSearch.analytics.collections.deprecatedBadge', {
defaultMessage: 'Deprecated',
})}
</EuiBadge>
</EuiFlexItem>
</EuiFlexGroup>
),
rightSideItems: [<AddAnalyticsCollection disabled={isGated} />],
}}
>

View file

@ -11,9 +11,11 @@ import { useValues } from 'kea';
import useObservable from 'react-use/lib/useObservable';
import { EuiSpacer } from '@elastic/eui';
import type { EuiSideNavItemTypeEnhanced } from '@kbn/core-chrome-browser';
import { SEARCH_PRODUCT_NAME } from '../../../../../common/constants';
import { DeprecationCallout } from '../../../shared/deprecation_callout/deprecation_callout';
import { generateEncodedPath } from '../../../shared/encode_path_params';
import { KibanaLogic } from '../../../shared/kibana';
import { SetAnalyticsChrome } from '../../../shared/kibana_chrome';
@ -94,6 +96,8 @@ export const EnterpriseSearchAnalyticsPageTemplate: React.FC<
{pageViewTelemetry && (
<SendEnterpriseSearchTelemetry action="viewed" metric={pageViewTelemetry} />
)}
<DeprecationCallout />
<EuiSpacer />
{children}
</EnterpriseSearchPageTemplateWrapper>
);

View file

@ -11,6 +11,7 @@ import { useValues } from 'kea';
import useObservable from 'react-use/lib/useObservable';
import { EuiSpacer } from '@elastic/eui';
import type { EuiSideNavItemTypeEnhanced } from '@kbn/core-chrome-browser';
import { SEARCH_PRODUCT_NAME } from '../../../../../common/constants';
@ -19,6 +20,7 @@ import { SetEnterpriseSearchApplicationsChrome } from '../../../shared/kibana_ch
import { EnterpriseSearchPageTemplateWrapper, PageTemplateProps } from '../../../shared/layout';
import { useEnterpriseSearchApplicationNav } from '../../../shared/layout';
import { SendEnterpriseSearchTelemetry } from '../../../shared/telemetry';
import { MaintenanceModeCallout } from '../maintenance_mode_callout/maintenance_mode_callout';
import { SearchApplicationHeaderDocsAction } from '../search_application/header_docs_action';
export type EnterpriseSearchApplicationsPageTemplateProps = Omit<
@ -101,6 +103,8 @@ export const EnterpriseSearchApplicationsPageTemplate: React.FC<
{pageViewTelemetry && (
<SendEnterpriseSearchTelemetry action="viewed" metric={pageViewTelemetry} />
)}
<MaintenanceModeCallout />
<EuiSpacer />
{children}
</EnterpriseSearchPageTemplateWrapper>
);

View file

@ -0,0 +1,28 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
export const MaintenanceModeCallout = () => {
return (
<EuiCallOut
title={i18n.translate('xpack.enterpriseSearch.maintenanceModeCallout.title', {
defaultMessage: 'Maintenance Mode Notice',
})}
>
<p>
{i18n.translate('xpack.enterpriseSearch.maintenanceModeCallout.description', {
defaultMessage:
'Search Applications is in maintenance mode and will only receive security updates and bug fixes in future releases.',
})}
</p>
</EuiCallOut>
);
};

View file

@ -1,39 +0,0 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { i18n } from '@kbn/i18n';
import { ANALYTICS_PLUGIN } from '../../../../../common/constants';
import baLogo from '../../assets/behavioral_analytics_logo.svg';
import { ProductCard } from '../product_card';
export interface BehavioralAnalyticsProductCard {
hasBorder: boolean;
hasShadow: boolean;
}
export const BehavioralAnalyticsProductCard = ({ hasBorder = true, hasShadow = true }) => (
<ProductCard
hasBorder={hasBorder}
hasShadow={hasShadow}
cta={i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.productCardCTA', {
defaultMessage: 'Explore Behavioral Analytics',
})}
description={i18n.translate('xpack.enterpriseSearch.behavioralAnalytics.description', {
defaultMessage:
'Dashboards and tools for visualizing end-user behavior and measuring the performance of your search applications',
})}
emptyCta
icon={baLogo}
iconSize="l"
name={ANALYTICS_PLUGIN.NAME}
productId={ANALYTICS_PLUGIN.ID}
url={ANALYTICS_PLUGIN.URL}
/>
);

View file

@ -13,7 +13,6 @@ import { ELASTICSEARCH_PLUGIN } from '../../../../../common/constants';
import { docLinks } from '../../../shared/doc_links';
import { ProductCard } from '../product_card';
import { BehavioralAnalyticsProductCard } from './behavioral_analytics_product_card';
import { SearchApplicationsProductCard } from './search_applications_product_card';
export const ElasticsearchProductCard = () => {
@ -32,10 +31,7 @@ export const ElasticsearchProductCard = () => {
defaultMessage: 'Learn more',
})}
url={docLinks.elasticsearchGettingStarted}
rightPanelItems={[
<SearchApplicationsProductCard hasBorder={false} hasShadow={false} />,
<BehavioralAnalyticsProductCard hasBorder={false} hasShadow={false} />,
]}
rightPanelItems={[<SearchApplicationsProductCard hasBorder={false} hasShadow={false} />]}
/>
);
};

View file

@ -0,0 +1,29 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import React from 'react';
import { EuiCallOut } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
export const DeprecationCallout = () => {
return (
<EuiCallOut
title={i18n.translate('xpack.enterpriseSearch.deprecationCallout.title', {
defaultMessage: 'Deprecation Notice',
})}
color="warning"
>
<p>
{i18n.translate('xpack.enterpriseSearch.deprecationCallout.description', {
defaultMessage:
'Behavioral Analytics has been deprecated and will be removed in a future release.',
})}
</p>
</EuiCallOut>
);
};

View file

@ -10,7 +10,6 @@ import React from 'react';
import { EuiText } from '@elastic/eui';
import {
ENTERPRISE_SEARCH_APP_ID,
ENTERPRISE_SEARCH_ANALYTICS_APP_ID,
SEARCH_ELASTICSEARCH,
SEARCH_VECTOR_SEARCH,
SEARCH_SEMANTIC_SEARCH,
@ -95,13 +94,6 @@ export const buildBaseClassicNavItems = (): ClassicNavItem[] => {
},
id: 'searchApplications',
},
{
'data-test-subj': 'searchSideNav-BehavioralAnalytics',
deepLink: {
link: ENTERPRISE_SEARCH_ANALYTICS_APP_ID,
},
id: 'analyticsCollections',
},
],
name: i18n.translate('xpack.enterpriseSearch.nav.applicationsTitle', {
defaultMessage: 'Build',

View file

@ -13,8 +13,6 @@ import { setMockValues, mockKibanaValues } from '../../__mocks__/kea_logic';
import { renderHook } from '@testing-library/react';
import { EuiSideNavItemType } from '@elastic/eui';
import { DEFAULT_PRODUCT_FEATURES } from '../../../../common/constants';
import {
@ -76,13 +74,6 @@ const baseNavItems = [
items: undefined,
name: 'Search Applications',
},
{
'data-test-subj': 'searchSideNav-BehavioralAnalytics',
href: '/app/elasticsearch/analytics',
id: 'analyticsCollections',
items: undefined,
name: 'Behavioral Analytics',
},
],
name: 'Build',
},
@ -233,134 +224,6 @@ describe('useEnterpriseSearchApplicationNav', () => {
const { result } = renderHook(() => useEnterpriseSearchApplicationNav());
expect(result.current).toEqual(baseNavItems);
});
it('returns selected engine sub nav items', () => {
const engineName = 'my-test-engine';
const {
result: { current: navItems },
} = renderHook(() => useEnterpriseSearchApplicationNav(engineName));
expect(navItems![0].id).toEqual('home');
expect(navItems?.slice(1).map((ni) => ni.name)).toEqual([
'Content',
'Build',
'Relevance',
'Getting started',
]);
const searchItem = navItems?.find((ni) => ni.id === 'build');
expect(searchItem).not.toBeUndefined();
expect(searchItem!.items).not.toBeUndefined();
// @ts-ignore
const enginesItem: EuiSideNavItemType<unknown> = searchItem?.items?.find(
(si: EuiSideNavItemType<unknown>) => si.id === 'searchApplications'
);
expect(enginesItem).not.toBeUndefined();
expect(enginesItem!.items).not.toBeUndefined();
expect(enginesItem!.items).toHaveLength(1);
// @ts-ignore
const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0];
expect(engineItem).toMatchInlineSnapshot(`
Object {
"href": "/app/elasticsearch/applications/search_applications/my-test-engine",
"id": "searchApplicationId",
"items": Array [
Object {
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/docs_explorer",
"id": "enterpriseSearchApplicationDocsExplorer",
"items": undefined,
"name": "Docs Explorer",
},
Object {
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/content",
"iconToString": undefined,
"id": "enterpriseSearchApplicationsContent",
"items": undefined,
"name": <EuiFlexGroup
alignItems="center"
justifyContent="spaceBetween"
>
Content
</EuiFlexGroup>,
"nameToString": "Content",
},
Object {
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/connect",
"id": "enterpriseSearchApplicationConnect",
"items": undefined,
"name": "Connect",
},
],
"name": "my-test-engine",
}
`);
});
it('returns selected engine without tabs when isEmpty', () => {
const engineName = 'my-test-engine';
const {
result: { current: navItems },
} = renderHook(() => useEnterpriseSearchApplicationNav(engineName, true));
expect(navItems![0].id).toEqual('home');
expect(navItems?.slice(1).map((ni) => ni.name)).toEqual([
'Content',
'Build',
'Relevance',
'Getting started',
]);
const searchItem = navItems?.find((ni) => ni.id === 'build');
expect(searchItem).not.toBeUndefined();
expect(searchItem!.items).not.toBeUndefined();
// @ts-ignore
const enginesItem: EuiSideNavItemType<unknown> = searchItem?.items?.find(
(si: EuiSideNavItemType<unknown>) => si.id === 'searchApplications'
);
expect(enginesItem).not.toBeUndefined();
expect(enginesItem!.items).not.toBeUndefined();
expect(enginesItem!.items).toHaveLength(1);
// @ts-ignore
const engineItem: EuiSideNavItemType<unknown> = enginesItem!.items[0];
expect(engineItem).toEqual({
href: `/app/elasticsearch/applications/search_applications/${engineName}`,
id: 'searchApplicationId',
name: engineName,
});
});
it('returns selected engine with conflict warning when hasSchemaConflicts', () => {
const engineName = 'my-test-engine';
const {
result: { current: navItems },
} = renderHook(() => useEnterpriseSearchApplicationNav(engineName, false, true));
// @ts-ignore
const engineItem = navItems
.find((ni: EuiSideNavItemType<unknown>) => ni.id === 'build')
.items.find((ni: EuiSideNavItemType<unknown>) => ni.id === 'searchApplications')
.items[0].items.find(
(ni: EuiSideNavItemType<unknown>) => ni.id === 'enterpriseSearchApplicationsContent'
);
expect(engineItem).toMatchInlineSnapshot(`
Object {
"href": "/app/elasticsearch/applications/search_applications/my-test-engine/content",
"iconToString": "warning",
"id": "enterpriseSearchApplicationsContent",
"items": undefined,
"name": <EuiFlexGroup
alignItems="center"
justifyContent="spaceBetween"
>
Content
<EuiIcon
color="danger"
type="warning"
/>
</EuiFlexGroup>,
"nameToString": "Content",
}
`);
});
});
describe('useEnterpriseSearchAnalyticsNav', () => {
@ -373,7 +236,41 @@ describe('useEnterpriseSearchAnalyticsNav', () => {
it('returns basic nav all params are empty', () => {
const { result } = renderHook(() => useEnterpriseSearchAnalyticsNav());
expect(result.current).toEqual(baseNavItems);
expect(result.current).toEqual([
baseNavItems[0],
baseNavItems[1],
{
'data-test-subj': 'searchSideNav-Build',
id: 'build',
items: [
{
'data-test-subj': 'searchSideNav-Playground',
href: '/app/search_playground',
id: 'playground',
items: undefined,
name: 'Playground',
},
{
'data-test-subj': 'searchSideNav-SearchApplications',
href: '/app/elasticsearch/applications/search_applications',
id: 'searchApplications',
items: undefined,
name: 'Search Applications',
},
{
href: '/app/elasticsearch/analytics',
id: 'analyticsCollections',
items: undefined,
name: 'Behavioral Analytics',
},
],
name: 'Build',
},
baseNavItems[3],
baseNavItems[4],
]);
});
it('returns basic nav if only name provided', () => {
@ -391,49 +288,4 @@ describe('useEnterpriseSearchAnalyticsNav', () => {
)
);
});
it('returns nav with sub items when name and paths provided', () => {
const {
result: { current: navItems },
} = renderHook(() =>
useEnterpriseSearchAnalyticsNav('my-test-collection', {
explorer: '/explorer-path',
integration: '/integration-path',
overview: '/overview-path',
})
);
const applicationsNav = navItems?.find((item) => item.id === 'build');
expect(applicationsNav).not.toBeUndefined();
const analyticsNav = applicationsNav?.items?.[2];
expect(analyticsNav).not.toBeUndefined();
expect(analyticsNav).toEqual({
'data-test-subj': 'searchSideNav-BehavioralAnalytics',
href: '/app/elasticsearch/analytics',
id: 'analyticsCollections',
items: [
{
id: 'analyticsCollection',
items: [
{
href: '/app/elasticsearch/analytics/overview-path',
id: 'analyticsCollectionOverview',
name: 'Overview',
},
{
href: '/app/elasticsearch/analytics/explorer-path',
id: 'analyticsCollectionExplorer',
name: 'Explorer',
},
{
href: '/app/elasticsearch/analytics/integration-path',
id: 'analyticsCollectionIntegration',
name: 'Integration',
},
],
name: 'my-test-collection',
},
],
name: 'Behavioral Analytics',
});
});
});

View file

@ -162,46 +162,82 @@ export const useEnterpriseSearchAnalyticsNav = (
const applicationsNav = navItems.find((item) => item.id === 'build');
const analyticsNav = applicationsNav?.items?.find((item) => item.id === 'analyticsCollections');
if (!name || !paths || !analyticsNav) return navItems;
if (!name && !analyticsNav) {
applicationsNav?.items?.push({
id: 'analyticsCollections',
name: ANALYTICS_PLUGIN.NAME,
...generateNavLink({
shouldNotCreateHref: true,
shouldShowActiveForSubroutes: false,
to: ANALYTICS_PLUGIN.URL,
}),
});
return navItems;
}
analyticsNav.items = [
{
id: 'analyticsCollection',
if (!paths || analyticsNav) return navItems;
if (!analyticsNav) {
applicationsNav?.items?.push({
id: 'analyticsCollections',
name: ANALYTICS_PLUGIN.NAME,
...generateNavLink({
shouldNotCreateHref: true,
shouldShowActiveForSubroutes: false,
to: ANALYTICS_PLUGIN.URL,
}),
items: [
{
id: 'analyticsCollectionOverview',
name: i18n.translate('xpack.enterpriseSearch.nav.analyticsCollections.overviewTitle', {
defaultMessage: 'Overview',
}),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.overview,
}),
},
{
id: 'analyticsCollectionExplorer',
name: i18n.translate('xpack.enterpriseSearch.nav.analyticsCollections.explorerTitle', {
defaultMessage: 'Explorer',
}),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.explorer,
}),
},
{
id: 'analyticsCollectionIntegration',
name: i18n.translate('xpack.enterpriseSearch.nav.analyticsCollections.integrationTitle', {
defaultMessage: 'Integration',
}),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.integration,
}),
},
...(paths
? [
{
id: 'analyticsCollection',
items: [
{
id: 'analyticsCollectionOverview',
name: i18n.translate(
'xpack.enterpriseSearch.nav.analyticsCollections.overviewTitle',
{
defaultMessage: 'Overview',
}
),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.overview,
}),
},
{
id: 'analyticsCollectionExplorer',
name: i18n.translate(
'xpack.enterpriseSearch.nav.analyticsCollections.explorerTitle',
{
defaultMessage: 'Explorer',
}
),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.explorer,
}),
},
{
id: 'analyticsCollectionIntegration',
name: i18n.translate(
'xpack.enterpriseSearch.nav.analyticsCollections.integrationTitle',
{
defaultMessage: 'Integration',
}
),
...generateNavLink({
shouldNotCreateHref: true,
to: ANALYTICS_PLUGIN.URL + paths.integration,
}),
},
],
name,
},
]
: []),
],
name,
},
];
});
}
return navItems;
};

View file

@ -186,6 +186,12 @@ export const getNavigationTreeDefinition = ({
},
link: 'enterpriseSearchAnalytics',
renderAs: 'item',
sideNavStatus: collections?.some((collection) =>
collection.items?.some((item) => item.isSelected)
)
? 'visible'
: 'hidden',
...(collections
? {
children: collections.map(euiItemTypeToNodeDefinition),

View file

@ -40,10 +40,6 @@ export default function ({ getService, getPageObjects }: FtrProviderContext) {
'Search Applications product card visible',
async () => await testSubjects.exists('enterpriseSearchApplicationsProductCard')
);
await retry.waitFor(
'Behavioral Analytics product card visible',
async () => await testSubjects.exists('enterpriseSearchAnalyticsProductCard')
);
await a11y.testAppSnapshot();
});
});

View file

@ -53,7 +53,6 @@ export default function searchSolutionNavigation({
{ id: 'Build', label: 'Build' },
{ id: 'Playground', label: 'Playground' },
{ id: 'SearchApplications', label: 'Search Applications' },
{ id: 'BehavioralAnalytics', label: 'Behavioral Analytics' },
{ id: 'Relevance', label: 'Relevance' },
{ id: 'InferenceEndpoints', label: 'Inference Endpoints' },
{ id: 'GettingStarted', label: 'Getting started' },
@ -90,11 +89,6 @@ export default function searchSolutionNavigation({
await searchClassicNavigation.expectNavItemActive('SearchApplications');
await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Build');
await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Search Applications');
// > BehavioralAnalytics
await searchClassicNavigation.clickNavItem('BehavioralAnalytics');
await searchClassicNavigation.expectNavItemActive('BehavioralAnalytics');
await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Build');
await searchClassicNavigation.breadcrumbs.expectBreadcrumbExists('Behavioral Analytics');
// Check Relevance
// > InferenceEndpoints

View file

@ -53,7 +53,6 @@ export default function searchSolutionNavigation({
await solutionNavigation.sidenav.expectLinkExists({ text: 'Web Crawlers' });
await solutionNavigation.sidenav.expectLinkExists({ text: 'Playground' });
await solutionNavigation.sidenav.expectLinkExists({ text: 'Search applications' });
await solutionNavigation.sidenav.expectLinkExists({ text: 'Behavioral Analytics' });
await solutionNavigation.sidenav.expectLinkExists({ text: 'Inference Endpoints' });
await solutionNavigation.sidenav.expectLinkExists({ text: 'Other tools' });
});
@ -174,20 +173,6 @@ export default function searchSolutionNavigation({
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({
deepLinkId: 'enterpriseSearchApplications:searchApplications',
});
// > Behavioral Analytics
await solutionNavigation.sidenav.clickLink({
deepLinkId: 'enterpriseSearchAnalytics',
});
await solutionNavigation.sidenav.expectLinkActive({
deepLinkId: 'enterpriseSearchAnalytics',
});
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({ text: 'Build' });
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({
text: 'Behavioral Analytics',
});
await solutionNavigation.breadcrumbs.expectBreadcrumbExists({
deepLinkId: 'enterpriseSearchAnalytics',
});
// check Relevance
// > Inference Endpoints
@ -268,7 +253,6 @@ export default function searchSolutionNavigation({
'build',
'searchPlayground',
'enterpriseSearchApplications:searchApplications',
'enterpriseSearchAnalytics',
'relevance',
'searchInferenceEndpoints:inferenceEndpoints',
'otherTools',