[8.x] [ECO][Inventory v2] Remove the landing page to enable the entity model (#205534) (#205958)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[ECO][Inventory v2] Remove the landing page to enable the entity
model (#205534)](https://github.com/elastic/kibana/pull/205534)

<!--- Backport version: 9.4.3 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"dzheni.pavlova@elastic.co"},"sourceCommit":{"committedDate":"2025-01-08T19:30:17Z","message":"[ECO][Inventory
v2] Remove the landing page to enable the entity model
(#205534)\n\nCloses #203095\r\nCloses
https://github.com/elastic/kibana/issues/204263\r\n\r\n\r\n##
Summary\r\n\r\nThis PR removes the page for the enabling functionality
and welcome\r\nscreen. After the migration to v2 API we don't need to
enable it anymore\r\nas we are not using transforms\r\n\r\n### Before:
\r\n\r\n\r\n![image](75a73dd8-6b16-452b-abcf-41e1fcca6645)\r\n\r\n###
After: \r\nThe same without the extra step to enable the entities and
the welcome\r\nscreen:\r\n- No data:
\r\n\r\n![image](https://github.com/user-attachments/assets/dbfdf501-36e7-4b6f-a8b6-ed0a6748ab62)\r\n\r\n-
With
data:\r\n\r\n![image](https://github.com/user-attachments/assets/0bbb2983-4e0a-477c-ac11-d2256b5ff854)\r\n\r\n##
Testing\r\n\r\n- In a local environment enable the entities feature flag
( it should be\r\na clean env as the entities should not be enabled
before ):\r\n<img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/75d6f77d-5039-41ca-80ca-34c3bf99844e\"\r\n/>\r\n\r\n-
Go to Inventory \r\n- Check before and after ingesting data\r\n-
Synthtrace: `node scripts/synthtrace logs_traces_hosts.ts` - ~⚠️
this\r\ncase can't be checked
before\r\nhttps://github.com/elastic/kibana/pull/203452 is merged~
-\r\nhttps://github.com/elastic/kibana/pull/203452 is merged
🎉","sha":"d6e28f766ac5363b4a6888871a2813538a4ee367","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","Team:obs-ux-infra_services"],"title":"[ECO][Inventory
v2] Remove the landing page to enable the entity
model","number":205534,"url":"https://github.com/elastic/kibana/pull/205534","mergeCommit":{"message":"[ECO][Inventory
v2] Remove the landing page to enable the entity model
(#205534)\n\nCloses #203095\r\nCloses
https://github.com/elastic/kibana/issues/204263\r\n\r\n\r\n##
Summary\r\n\r\nThis PR removes the page for the enabling functionality
and welcome\r\nscreen. After the migration to v2 API we don't need to
enable it anymore\r\nas we are not using transforms\r\n\r\n### Before:
\r\n\r\n\r\n![image](75a73dd8-6b16-452b-abcf-41e1fcca6645)\r\n\r\n###
After: \r\nThe same without the extra step to enable the entities and
the welcome\r\nscreen:\r\n- No data:
\r\n\r\n![image](https://github.com/user-attachments/assets/dbfdf501-36e7-4b6f-a8b6-ed0a6748ab62)\r\n\r\n-
With
data:\r\n\r\n![image](https://github.com/user-attachments/assets/0bbb2983-4e0a-477c-ac11-d2256b5ff854)\r\n\r\n##
Testing\r\n\r\n- In a local environment enable the entities feature flag
( it should be\r\na clean env as the entities should not be enabled
before ):\r\n<img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/75d6f77d-5039-41ca-80ca-34c3bf99844e\"\r\n/>\r\n\r\n-
Go to Inventory \r\n- Check before and after ingesting data\r\n-
Synthtrace: `node scripts/synthtrace logs_traces_hosts.ts` - ~⚠️
this\r\ncase can't be checked
before\r\nhttps://github.com/elastic/kibana/pull/203452 is merged~
-\r\nhttps://github.com/elastic/kibana/pull/203452 is merged
🎉","sha":"d6e28f766ac5363b4a6888871a2813538a4ee367"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/205534","number":205534,"mergeCommit":{"message":"[ECO][Inventory
v2] Remove the landing page to enable the entity model
(#205534)\n\nCloses #203095\r\nCloses
https://github.com/elastic/kibana/issues/204263\r\n\r\n\r\n##
Summary\r\n\r\nThis PR removes the page for the enabling functionality
and welcome\r\nscreen. After the migration to v2 API we don't need to
enable it anymore\r\nas we are not using transforms\r\n\r\n### Before:
\r\n\r\n\r\n![image](75a73dd8-6b16-452b-abcf-41e1fcca6645)\r\n\r\n###
After: \r\nThe same without the extra step to enable the entities and
the welcome\r\nscreen:\r\n- No data:
\r\n\r\n![image](https://github.com/user-attachments/assets/dbfdf501-36e7-4b6f-a8b6-ed0a6748ab62)\r\n\r\n-
With
data:\r\n\r\n![image](https://github.com/user-attachments/assets/0bbb2983-4e0a-477c-ac11-d2256b5ff854)\r\n\r\n##
Testing\r\n\r\n- In a local environment enable the entities feature flag
( it should be\r\na clean env as the entities should not be enabled
before ):\r\n<img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/75d6f77d-5039-41ca-80ca-34c3bf99844e\"\r\n/>\r\n\r\n-
Go to Inventory \r\n- Check before and after ingesting data\r\n-
Synthtrace: `node scripts/synthtrace logs_traces_hosts.ts` - ~⚠️
this\r\ncase can't be checked
before\r\nhttps://github.com/elastic/kibana/pull/203452 is merged~
-\r\nhttps://github.com/elastic/kibana/pull/203452 is merged
🎉","sha":"d6e28f766ac5363b4a6888871a2813538a4ee367"}}]}] BACKPORT-->

Co-authored-by: jennypavlova <dzheni.pavlova@elastic.co>
This commit is contained in:
Kibana Machine 2025-01-09 08:24:09 +11:00 committed by GitHub
parent bcc1b0c14f
commit 61aa939461
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 5 additions and 476 deletions

View file

@ -25934,7 +25934,6 @@
"xpack.inventory.badgeFilterWithPopover.filterForButtonEmptyLabel": "Filtrer sur",
"xpack.inventory.badgeFilterWithPopover.openPopoverBadgeLabel": "Ouvrir la fenêtre contextuelle",
"xpack.inventory.data_view.creation_failed": "Une erreur s'est produite lors de la création de la vue de données",
"xpack.inventory.eemEnablement.errorTitle": "Erreur lors de l'activation du nouveau modèle d'entité",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsLabel": "Alertes",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsTooltip": "Le nombre d'alertes actives",
"xpack.inventory.entitiesGrid.euiDataGrid.entityNameLabel": "Nom de l'entité",
@ -25951,13 +25950,6 @@
"xpack.inventory.home.serviceAlertsTable.tooltip.activeAlertsExplanation": "Alertes actives",
"xpack.inventory.inventoryLinkTitle": "Inventory",
"xpack.inventory.inventoryPageHeaderLabel": "Inventory",
"xpack.inventory.noData.card.button": "Activer",
"xpack.inventory.noData.card.description": "L{inventoryLink} utilise le {link} pour afficher l'ensemble des entités observées en un seul endroit.",
"xpack.inventory.noData.card.description.inventory": "Inventory",
"xpack.inventory.noData.card.description.link": "Modèle d'entité Elastic",
"xpack.inventory.noData.page.description": "L'inventaire affichera toutes vos entités observées en un seul endroit afin que vous puissiez détecter et résoudre les problèmes liés à celles-ci plus rapidement !",
"xpack.inventory.noData.page.title": "Tout ce que vous avez en un seul endroit !",
"xpack.inventory.noData.solutionName": "Observabilité",
"xpack.inventory.noEntitiesEmptyState.actions.title": "Commencez à observer vos entités :",
"xpack.inventory.noEntitiesEmptyState.body.description": "Visualisez toutes vos entités observées en un seul endroit en collectant des données.",
"xpack.inventory.noEntitiesEmptyState.callout.title": "C'est votre premier essai ?",
@ -25968,16 +25960,6 @@
"xpack.inventory.shareLink.shareButtonLabel": "Partager",
"xpack.inventory.shareLink.shareToastFailureLabel": "Les URL courtes ne peuvent pas être copiées.",
"xpack.inventory.shareLink.shareToastSuccessLabel": "URL courte copiée dans le presse-papiers !",
"xpack.inventory.unauthorised.body": "Vous n'avez pas les autorisations nécessaires pour activer le modèle d'entité Elastic. Veuillez demander à votre administrateur de l'activer pour vous afin que vous puissiez voir toutes vos ressources en un seul endroit.",
"xpack.inventory.unauthorised.button": "OK",
"xpack.inventory.unauthorised.image.at,": "Image de la nouvelle interface de l'inventaire des entités, montrant les services, les hôtes et les conteneurs",
"xpack.inventory.unauthorised.title": "Permissions insuffisantes",
"xpack.inventory.unauthorized.linkLabel": "En savoir plus",
"xpack.inventory.welcome.body": "L'inventaire affichera toutes vos entités observées en un seul endroit pour que vous puissiez détecter et résoudre les problèmes plus rapidement.",
"xpack.inventory.welcome.button": "OK",
"xpack.inventory.welcome.image.alt": "Image de la nouvelle interface de l'inventaire des entités, montrant les services, les hôtes et les conteneurs",
"xpack.inventory.welcome.linkLabel": "En savoir plus",
"xpack.inventory.welcome.title": "Tout ce que vous avez en un seul endroit !",
"xpack.investigateApp.addFromLibraryButtonLabel": "Importer depuis la bibliothèque",
"xpack.investigateApp.addInvestigationItem.errorMessage": "une erreur s'est produite",
"xpack.investigateApp.addInvestigationItem.errorTitle": "Erreur",

View file

@ -25792,7 +25792,6 @@
"xpack.inventory.badgeFilterWithPopover.filterForButtonEmptyLabel": "フィルター",
"xpack.inventory.badgeFilterWithPopover.openPopoverBadgeLabel": "ポップオーバーを開く",
"xpack.inventory.data_view.creation_failed": "データビューの作成中にエラーが発生しました",
"xpack.inventory.eemEnablement.errorTitle": "新しいエンティティモデルの有効化エラー",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsLabel": "アラート",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsTooltip": "アクティブなアラートの件数",
"xpack.inventory.entitiesGrid.euiDataGrid.entityNameLabel": "エンティティ名",
@ -25809,13 +25808,6 @@
"xpack.inventory.home.serviceAlertsTable.tooltip.activeAlertsExplanation": "アクティブアラート",
"xpack.inventory.inventoryLinkTitle": "インベントリ",
"xpack.inventory.inventoryPageHeaderLabel": "インベントリ",
"xpack.inventory.noData.card.button": "有効にする",
"xpack.inventory.noData.card.description": "{inventoryLink}は、{link}を使用して、観測されたエンティティをすべて一元的に表示します。",
"xpack.inventory.noData.card.description.inventory": "インベントリ",
"xpack.inventory.noData.card.description.link": "Elasticエンティティモデル",
"xpack.inventory.noData.page.description": "インベントリでは、観測されたすべてのエンティティが一元的に表示されるため、それらの問題をより迅速に検出および解決することができます!",
"xpack.inventory.noData.page.title": "すべてを一元的に確認できます!",
"xpack.inventory.noData.solutionName": "Observability",
"xpack.inventory.noEntitiesEmptyState.actions.title": "エンティティの観測を開始:",
"xpack.inventory.noEntitiesEmptyState.body.description": "いくつかのデータを収集することで、観測されたエンティティをすべて一元的に確認できます。",
"xpack.inventory.noEntitiesEmptyState.callout.title": "初めて試す場合",
@ -25826,16 +25818,6 @@
"xpack.inventory.shareLink.shareButtonLabel": "共有",
"xpack.inventory.shareLink.shareToastFailureLabel": "短縮URLをコピーできません。",
"xpack.inventory.shareLink.shareToastSuccessLabel": "短縮URLがクリップボードにコピーされました",
"xpack.inventory.unauthorised.body": "Elasticエンティティモデルをオンにする権限がありません。すべてを一元的に確認できるように、管理者にこの機能を有効にするよう依頼してください。",
"xpack.inventory.unauthorised.button": "OK",
"xpack.inventory.unauthorised.image.at,": "サービス、ホスト、コンテナーを表示する、エンティティの在庫の新しいエクスペリエンスの図",
"xpack.inventory.unauthorised.title": "パーミッションがありません",
"xpack.inventory.unauthorized.linkLabel": "詳細",
"xpack.inventory.welcome.body": "インベントリでは、観測されたすべてのエンティティが一元的に表示されるため、それらの問題をより迅速に検出および解決することができます。",
"xpack.inventory.welcome.button": "OK",
"xpack.inventory.welcome.image.alt": "サービス、ホスト、コンテナーを表示する、エンティティの在庫の新しいエクスペリエンスの図",
"xpack.inventory.welcome.linkLabel": "詳細",
"xpack.inventory.welcome.title": "すべてを一元的に確認できます!",
"xpack.investigateApp.addFromLibraryButtonLabel": "ライブラリからインポート",
"xpack.investigateApp.addInvestigationItem.errorMessage": "エラーが発生しました",
"xpack.investigateApp.addInvestigationItem.errorTitle": "エラー",

View file

@ -25879,7 +25879,6 @@
"xpack.inventory.badgeFilterWithPopover.filterForButtonEmptyLabel": "筛留",
"xpack.inventory.badgeFilterWithPopover.openPopoverBadgeLabel": "打开弹出框",
"xpack.inventory.data_view.creation_failed": "创建数据视图时出错",
"xpack.inventory.eemEnablement.errorTitle": "启用新实体模型时出错",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsLabel": "告警",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsTooltip": "活动告警计数",
"xpack.inventory.entitiesGrid.euiDataGrid.entityNameLabel": "实体名称",
@ -25896,13 +25895,6 @@
"xpack.inventory.home.serviceAlertsTable.tooltip.activeAlertsExplanation": "活动告警",
"xpack.inventory.inventoryLinkTitle": "库存",
"xpack.inventory.inventoryPageHeaderLabel": "库存",
"xpack.inventory.noData.card.button": "启用",
"xpack.inventory.noData.card.description": "{inventoryLink} 使用 {link} 在一个位置显示您观察到的所有实体。",
"xpack.inventory.noData.card.description.inventory": "库存",
"xpack.inventory.noData.card.description.link": "Elastic 实体模型",
"xpack.inventory.noData.page.description": "库存将在一个位置显示您观察到的所有实体,以便您更快检测并解决它们存在的问题!",
"xpack.inventory.noData.page.title": "在一个位置查看您的所有内容!",
"xpack.inventory.noData.solutionName": "Observability",
"xpack.inventory.noEntitiesEmptyState.actions.title": "开始观察您的实体:",
"xpack.inventory.noEntitiesEmptyState.body.description": "通过收集某些数据,在一个位置查看您观察到的所有实体。",
"xpack.inventory.noEntitiesEmptyState.callout.title": "第一次尝试?",
@ -25913,16 +25905,6 @@
"xpack.inventory.shareLink.shareButtonLabel": "共享",
"xpack.inventory.shareLink.shareToastFailureLabel": "无法复制短 URL。",
"xpack.inventory.shareLink.shareToastSuccessLabel": "短 URL 已复制到剪贴板!",
"xpack.inventory.unauthorised.body": "您无权打开 Elastic 实体模型。请联系管理员为您启用此模型,以便在一个位置查看您的所有内容。",
"xpack.inventory.unauthorised.button": "确定",
"xpack.inventory.unauthorised.image.at,": "实体库存新体验的图像,显示服务、主机和容器",
"xpack.inventory.unauthorised.title": "权限不足",
"xpack.inventory.unauthorized.linkLabel": "了解详情",
"xpack.inventory.welcome.body": "库存将在一个位置显示您观察到的所有实体,以便您更快检测并解决它们存在的问题。",
"xpack.inventory.welcome.button": "确定",
"xpack.inventory.welcome.image.alt": "实体库存新体验的图像,显示服务、主机和容器",
"xpack.inventory.welcome.linkLabel": "了解详情",
"xpack.inventory.welcome.title": "在一个位置查看您的所有内容!",
"xpack.investigateApp.addFromLibraryButtonLabel": "从库中导入",
"xpack.investigateApp.addInvestigationItem.errorMessage": "发生错误",
"xpack.investigateApp.addInvestigationItem.errorTitle": "错误",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 176 KiB

View file

@ -1,71 +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 { EuiButton } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import React, { useState } from 'react';
import { EntityManagerUnauthorizedError } from '@kbn/entityManager-plugin/public';
import type { IHttpFetchError, ResponseErrorBody } from '@kbn/core/public';
import { TechnicalPreviewBadge } from '@kbn/observability-shared-plugin/public';
import { useKibana } from '../../hooks/use_kibana';
import { Unauthorized } from './unauthorized_modal';
export function EnableEntityModelButton({ onSuccess }: { onSuccess: () => void }) {
const {
services: { entityManager, notifications },
} = useKibana();
const [isLoading, setIsLoading] = useState(false);
const [showModal, setModalVisible] = useState(false);
const handleEnablement = async () => {
setIsLoading(true);
try {
const response = await entityManager.entityClient.enableManagedEntityDiscovery();
if (response.success) {
setIsLoading(false);
onSuccess();
} else {
throw new Error(response.message);
}
} catch (error) {
setIsLoading(false);
if (error instanceof EntityManagerUnauthorizedError) {
setModalVisible(true);
return;
}
const err = error as Error | IHttpFetchError<ResponseErrorBody>;
notifications.toasts.addDanger({
title: i18n.translate('xpack.inventory.eemEnablement.errorTitle', {
defaultMessage: 'Error while enabling the new entity model',
}),
text: 'response' in err ? err.body?.message ?? err.response?.statusText : err.message,
});
}
};
return (
<>
<EuiButton
isLoading={isLoading}
data-test-subj="inventoryInventoryPageTemplateFilledButton"
fill
onClick={handleEnablement}
iconType={() => <TechnicalPreviewBadge />}
iconSide="right"
>
{i18n.translate('xpack.inventory.noData.card.button', {
defaultMessage: 'Enable',
})}
</EuiButton>
{showModal ? <Unauthorized onClose={() => setModalVisible(false)} /> : null}
</>
);
}

View file

@ -1,100 +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 {
EuiButton,
EuiConfirmModal,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiImage,
EuiLink,
EuiPanel,
EuiSpacer,
EuiText,
EuiTitle,
useEuiTheme,
COLOR_MODES_STANDARD,
} from '@elastic/eui';
import inventoryLight from '../../assets/entities_inventory_light.png';
import inventoryDark from '../../assets/entities_inventory_dark.png';
export function Unauthorized({ onClose }: { onClose: () => void }) {
const { colorMode } = useEuiTheme();
return (
<EuiConfirmModal
style={{
width: '630px',
}}
onCancel={onClose}
onConfirm={onClose}
confirmButtonText={
<EuiButton data-test-subj="xpack.inventory.unauthorised.button" fill size="s">
{i18n.translate('xpack.inventory.unauthorised.button', {
defaultMessage: 'OK',
})}
</EuiButton>
}
cancelButtonText={
<EuiLink
target="_blank"
data-test-subj="inventoryUnauthorizedLinkExternal"
href="https://ela.st/docs-entity-inventory"
external
>
{i18n.translate('xpack.inventory.unauthorized.linkLabel', {
defaultMessage: 'Learn more',
})}
</EuiLink>
}
defaultFocusedButton="confirm"
>
<EuiPanel hasShadow={false}>
<EuiFlexGroup direction="column" justifyContent="center" alignItems="center" gutterSize="m">
<EuiFlexItem>
<EuiIcon type="lock" size="l" />
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle>
<h2>
{i18n.translate('xpack.inventory.unauthorised.title', {
defaultMessage: 'Insufficient permissions',
})}
</h2>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
<EuiPanel hasShadow={false} paddingSize="s">
<EuiText grow={false} textAlign="center">
<p>
{i18n.translate('xpack.inventory.unauthorised.body', {
defaultMessage:
"You don't have permissions to turn on the Elastic Entity Model. Please ask your administrator to enable this for you so you can see everything you have in one place.",
})}
</p>
</EuiText>
</EuiPanel>
<EuiSpacer size="m" />
<EuiPanel hasBorder paddingSize="none">
<EuiImage
allowFullScreen
size="xl"
src={colorMode === COLOR_MODES_STANDARD.dark ? inventoryDark : inventoryLight}
alt={i18n.translate('xpack.inventory.unauthorised.image.at,', {
defaultMessage:
'Image of the new experience of the entities inventory, showing services, hosts and containers',
})}
/>
</EuiPanel>
</EuiConfirmModal>
);
}

View file

@ -1,100 +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 {
EuiButton,
EuiConfirmModal,
EuiFlexGroup,
EuiFlexItem,
EuiIcon,
EuiImage,
EuiLink,
EuiPanel,
EuiSpacer,
EuiText,
EuiTitle,
useEuiTheme,
COLOR_MODES_STANDARD,
} from '@elastic/eui';
import inventoryLight from '../../assets/entities_inventory_light.png';
import inventoryDark from '../../assets/entities_inventory_dark.png';
export function Welcome({ onClose, onConfirm }: { onClose: () => void; onConfirm: () => void }) {
const { colorMode } = useEuiTheme();
return (
<EuiConfirmModal
style={{
width: '630px',
}}
onCancel={onClose}
onConfirm={onConfirm}
confirmButtonText={
<EuiButton data-test-subj="xpack.inventory.welcome.button.open" fill size="s">
{i18n.translate('xpack.inventory.welcome.button', {
defaultMessage: 'OK',
})}
</EuiButton>
}
cancelButtonText={
<EuiLink
target="_blank"
data-test-subj="inventoryWelcomeLinkExternal"
href="https://ela.st/docs-entity-inventory"
external
>
{i18n.translate('xpack.inventory.welcome.linkLabel', {
defaultMessage: 'Learn more',
})}
</EuiLink>
}
defaultFocusedButton="confirm"
>
<EuiPanel hasShadow={false}>
<EuiFlexGroup direction="column" justifyContent="center" alignItems="center" gutterSize="m">
<EuiFlexItem>
<EuiIcon type="logoElastic" size="l" />
</EuiFlexItem>
<EuiFlexItem>
<EuiTitle>
<h2>
{i18n.translate('xpack.inventory.welcome.title', {
defaultMessage: 'See everything you have in one place!',
})}
</h2>
</EuiTitle>
</EuiFlexItem>
</EuiFlexGroup>
</EuiPanel>
<EuiPanel hasShadow={false} paddingSize="s">
<EuiText grow={false} textAlign="center">
<p>
{i18n.translate('xpack.inventory.welcome.body', {
defaultMessage:
'The inventory will show all of your observed entities in one place so you can detect and resolve problems with them faster.',
})}
</p>
</EuiText>
</EuiPanel>
<EuiSpacer size="m" />
<EuiPanel hasBorder paddingSize="none">
<EuiImage
size="xl"
src={colorMode === COLOR_MODES_STANDARD.dark ? inventoryDark : inventoryLight}
allowFullScreen
alt={i18n.translate('xpack.inventory.welcome.image.alt', {
defaultMessage:
'Image of the new experience of the entities inventory, showing services, hosts and containers',
})}
/>
</EuiPanel>
</EuiConfirmModal>
);
}

View file

@ -13,9 +13,6 @@ import {
} from '@kbn/observability-shared-plugin/public';
import { useKibana } from '../../hooks/use_kibana';
import { SearchBar } from '../search_bar';
import { getEntityManagerEnablement } from './no_data_config';
import { useEntityManager } from '../../hooks/use_entity_manager';
import { Welcome } from '../entity_enablement/welcome_modal';
import { useInventoryAbortableAsync } from '../../hooks/use_inventory_abortable_async';
import { EmptyState } from '../empty_states/empty_state';
import { useIsLoadingComplete } from '../../hooks/use_is_loading_complete';
@ -41,19 +38,6 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode
} = useKibana();
const { PageTemplate: ObservabilityPageTemplate } = observabilityShared.navigation;
const {
isEntityManagerEnabled,
isEnablementLoading,
refresh,
showWelcomedModal,
toggleWelcomedModal,
} = useEntityManager();
const handleSuccess = () => {
refresh();
toggleWelcomedModal();
};
const { value = { hasData: false }, loading: hasDataLoading } = useInventoryAbortableAsync(
({ signal }) => {
return inventoryAPIClient.fetch('GET /internal/inventory/has_data', {
@ -64,23 +48,19 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode
);
const isLoadingComplete = useIsLoadingComplete({
loadingStates: [isEnablementLoading, hasDataLoading],
loadingStates: [hasDataLoading],
});
useEffect(() => {
if (isLoadingComplete) {
const viewState = isEntityManagerEnabled
? value.hasData
? 'populated'
: 'empty'
: 'eem_disabled';
const viewState = value.hasData ? 'populated' : 'empty';
telemetry.reportEntityInventoryViewed({
view_state: viewState,
});
}
}, [isEntityManagerEnabled, value.hasData, telemetry, isLoadingComplete]);
}, [value.hasData, telemetry, isLoadingComplete]);
if (isEnablementLoading || hasDataLoading) {
if (hasDataLoading) {
return (
<ObservabilityPageTemplate
pageHeader={{
@ -106,23 +86,13 @@ export function InventoryPageTemplate({ children }: { children: React.ReactNode
/>,
],
}}
noDataConfig={getEntityManagerEnablement({
enabled: isEntityManagerEnabled,
loading: isEnablementLoading,
onSuccess: handleSuccess,
})}
>
{value.hasData ? (
<EuiFlexGroup direction="column">
<EuiFlexItem>
<SearchBar />
</EuiFlexItem>
<EuiFlexItem>
{children}
{showWelcomedModal ? (
<Welcome onClose={toggleWelcomedModal} onConfirm={toggleWelcomedModal} />
) : null}
</EuiFlexItem>
<EuiFlexItem>{children}</EuiFlexItem>
</EuiFlexGroup>
) : (
<EmptyState />

View file

@ -1,79 +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 { FormattedMessage } from '@kbn/i18n-react';
import { EuiLink } from '@elastic/eui';
import { EnableEntityModelButton } from '../entity_enablement/enable_entity_model_button';
export function getEntityManagerEnablement({
enabled,
loading,
onSuccess,
}: {
enabled: boolean;
loading: boolean;
onSuccess: () => void;
}) {
if (enabled || loading) {
return;
}
return {
solution: i18n.translate('xpack.inventory.noData.solutionName', {
defaultMessage: 'Observability',
}),
action: {
elasticAgent: {
description: (
<FormattedMessage
id="xpack.inventory.noData.card.description"
defaultMessage="The {inventoryLink} uses the {link} to show all of your observed entities in one place."
values={{
inventoryLink: (
<EuiLink
data-test-subj="inventoryNoDataCardInventoryLink"
href="https://ela.st/docs-entity-inventory"
external
target="_blank"
>
{i18n.translate('xpack.inventory.noData.card.description.inventory', {
defaultMessage: 'Inventory',
})}
</EuiLink>
),
link: (
<EuiLink
data-test-subj="inventoryNoDataCardLink"
href="https://ela.st/docs-elastic-entity-model"
external
target="_blank"
>
{i18n.translate('xpack.inventory.noData.card.description.link', {
defaultMessage: 'Elastic Entity Model',
})}
</EuiLink>
),
}}
/>
),
button: <EnableEntityModelButton onSuccess={onSuccess} />,
onClick: (event: React.MouseEvent<HTMLElement, MouseEvent>) => {
event.preventDefault();
},
},
},
pageTitle: i18n.translate('xpack.inventory.noData.page.title', {
defaultMessage: 'See everything you have in one place!',
}),
pageDescription: i18n.translate('xpack.inventory.noData.page.description', {
defaultMessage:
'The inventory will show all of your observed entities in one place so you can detect and resolve problems with them faster!',
}),
};
}

View file

@ -1,37 +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 { useAbortableAsync } from '@kbn/observability-utils-browser/hooks/use_abortable_async';
import { useState } from 'react';
import { useKibana } from './use_kibana';
export const useEntityManager = () => {
const {
services: { entityManager },
} = useKibana();
const [showWelcomedModal, setWelcomedModal] = useState(false);
const {
value = { enabled: false },
loading,
refresh,
} = useAbortableAsync(
({ signal }) => {
return entityManager.entityClient.isManagedEntityDiscoveryEnabled();
},
[entityManager]
);
return {
isEntityManagerEnabled: value.enabled,
isEnablementLoading: loading,
refresh,
showWelcomedModal,
toggleWelcomedModal: () => setWelcomedModal((state) => !state),
};
};