Skip to content

Commit

Permalink
[Inventory] Remove open in Discover button (#200574)
Browse files Browse the repository at this point in the history
Closes #199964 

This PR removes the `open in discover` button from the inventory search
bar section.

| Before | After |
| ------- | ----- |
| <img width="1911" alt="image"
src="https://github.com/user-attachments/assets/627ebfa0-77c9-4ff1-8a38-3623bf1b7e32">
| <img width="1915" alt="image"
src="https://github.com/user-attachments/assets/2dace203-7203-4bda-8cee-0186e022e373">
|
  • Loading branch information
jennypavlova authored Nov 18, 2024
1 parent aa0dcdc commit 1607803
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 94 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,35 +121,6 @@ describe('Home page', () => {
cy.url().should('include', '/app/metrics/detail/host/server1');
});

it('Navigates to discover with default filter', () => {
cy.intercept('GET', '/internal/entities/managed/enablement', {
fixture: 'eem_enabled.json',
}).as('getEEMStatus');
cy.visitKibana('/app/inventory');
cy.wait('@getEEMStatus');
cy.contains('Open in discover').click();
cy.url().should(
'include',
"query:(language:kuery,query:'entity.definition_id%20:%20builtin*"
);
});

it('Navigates to discover with kuery filter', () => {
cy.intercept('GET', '/internal/entities/managed/enablement', {
fixture: 'eem_enabled.json',
}).as('getEEMStatus');
cy.visitKibana('/app/inventory');
cy.wait('@getEEMStatus');
cy.getByTestSubj('queryInput').type('service.name : foo');

cy.contains('Update').click();
cy.contains('Open in discover').click();
cy.url().should(
'include',
"query:'service.name%20:%20foo%20AND%20entity.definition_id%20:%20builtin*'"
);
});

it('Navigates to infra when clicking on a container type entity', () => {
cy.intercept('GET', '/internal/entities/managed/enablement', {
fixture: 'eem_enabled.json',
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
* 2.0; you may not use this file except in compliance with the Elastic License
* 2.0.
*/
import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import type { Query } from '@kbn/es-query';
import { i18n } from '@kbn/i18n';
import type { SearchBarOwnProps } from '@kbn/unified-search-plugin/public/search_bar';
Expand All @@ -14,7 +13,6 @@ import { useKibana } from '../../hooks/use_kibana';
import { useUnifiedSearchContext } from '../../hooks/use_unified_search_context';
import { getKqlFieldsWithFallback } from '../../utils/get_kql_field_names_with_fallback';
import { ControlGroups } from './control_groups';
import { DiscoverButton } from './discover_button';

export function SearchBar() {
const { refreshSubject$, dataView, searchState, onQueryChange } = useUnifiedSearchContext();
Expand Down Expand Up @@ -73,30 +71,20 @@ export function SearchBar() {
);

return (
<EuiFlexGroup direction="row" gutterSize="s">
<EuiFlexItem grow>
<UnifiedSearchBar
appName="Inventory"
displayStyle="inPage"
indexPatterns={dataView ? [dataView] : undefined}
renderQueryInputAppend={() => <ControlGroups />}
onQuerySubmit={handleQuerySubmit}
placeholder={i18n.translate('xpack.inventory.searchBar.placeholder', {
defaultMessage:
'Search for your entities by name or its metadata (e.g. entity.type : service)',
})}
showDatePicker={false}
showFilterBar
showQueryInput
showQueryMenu
/>
</EuiFlexItem>

{dataView ? (
<EuiFlexItem grow={false}>
<DiscoverButton dataView={dataView} />
</EuiFlexItem>
) : null}
</EuiFlexGroup>
<UnifiedSearchBar
appName="Inventory"
displayStyle="inPage"
indexPatterns={dataView ? [dataView] : undefined}
renderQueryInputAppend={() => <ControlGroups />}
onQuerySubmit={handleQuerySubmit}
placeholder={i18n.translate('xpack.inventory.searchBar.placeholder', {
defaultMessage:
'Search for your entities by name or its metadata (e.g. entity.type : service)',
})}
showDatePicker={false}
showFilterBar
showQueryInput
showQueryMenu
/>
);
}
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -26205,6 +26205,7 @@
"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.entityActions.discoverLink": "Ouvrir dans Discover",
"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é",
Expand Down Expand Up @@ -26234,7 +26235,6 @@
"xpack.inventory.noEntitiesEmptyState.description": "L'affichage de vos entités peut prendre quelques minutes. Essayez de rafraîchir à nouveau dans une minute ou deux.",
"xpack.inventory.noEntitiesEmptyState.learnMore.link": "En savoir plus",
"xpack.inventory.noEntitiesEmptyState.title": "Aucune entité disponible",
"xpack.inventory.searchBar.discoverButton": "Ouvrir dans Discover",
"xpack.inventory.searchBar.placeholder": "Recherchez vos entités par nom ou par leurs métadonnées (par exemple entity.type : service)",
"xpack.inventory.shareLink.shareButtonLabel": "Partager",
"xpack.inventory.shareLink.shareToastFailureLabel": "Les URL courtes ne peuvent pas être copiées.",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -26177,6 +26177,7 @@
"xpack.inventory.badgeFilterWithPopover.openPopoverBadgeLabel": "ポップオーバーを開く",
"xpack.inventory.data_view.creation_failed": "データビューの作成中にエラーが発生しました",
"xpack.inventory.eemEnablement.errorTitle": "新しいエンティティモデルの有効化エラー",
"xpack.inventory.entityActions.discoverLink": "Discoverで開く",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsLabel": "アラート",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsTooltip": "アクティブなアラートの件数",
"xpack.inventory.entitiesGrid.euiDataGrid.entityNameLabel": "エンティティ名",
Expand Down Expand Up @@ -26206,7 +26207,6 @@
"xpack.inventory.noEntitiesEmptyState.description": "エンティティが表示されるまで数分かかる場合があります。1〜2分後に更新してください。",
"xpack.inventory.noEntitiesEmptyState.learnMore.link": "詳細",
"xpack.inventory.noEntitiesEmptyState.title": "エンティティがありません",
"xpack.inventory.searchBar.discoverButton": "Discoverで開く",
"xpack.inventory.searchBar.placeholder": "エンティティを名前またはメタデータ(例:entity.type : service)で検索します。",
"xpack.inventory.shareLink.shareButtonLabel": "共有",
"xpack.inventory.shareLink.shareToastFailureLabel": "短縮URLをコピーできません。",
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/translations/translations/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -25703,6 +25703,7 @@
"xpack.inventory.badgeFilterWithPopover.openPopoverBadgeLabel": "打开弹出框",
"xpack.inventory.data_view.creation_failed": "创建数据视图时出错",
"xpack.inventory.eemEnablement.errorTitle": "启用新实体模型时出错",
"xpack.inventory.entityActions.discoverLink": "在 Discover 中打开",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsLabel": "告警",
"xpack.inventory.entitiesGrid.euiDataGrid.alertsTooltip": "活动告警计数",
"xpack.inventory.entitiesGrid.euiDataGrid.entityNameLabel": "实体名称",
Expand Down Expand Up @@ -25732,7 +25733,6 @@
"xpack.inventory.noEntitiesEmptyState.description": "您的实体可能需要数分钟才能显示。请尝试在一或两分钟后刷新。",
"xpack.inventory.noEntitiesEmptyState.learnMore.link": "了解详情",
"xpack.inventory.noEntitiesEmptyState.title": "无可用实体",
"xpack.inventory.searchBar.discoverButton": "在 Discover 中打开",
"xpack.inventory.searchBar.placeholder": "按名称或其元数据(例如,entity.type:服务)搜索您的实体",
"xpack.inventory.shareLink.shareButtonLabel": "共享",
"xpack.inventory.shareLink.shareToastFailureLabel": "无法复制短 URL。",
Expand Down

0 comments on commit 1607803

Please sign in to comment.