Skip to content

Commit

Permalink
[8.x] [Inventory] Remove open in Discover button (elastic#200574) (el…
Browse files Browse the repository at this point in the history
…astic#200729)

# Backport

This will backport the following commits from `main` to `8.x`:
- [[Inventory] Remove open in Discover button
(elastic#200574)](elastic#200574)

<!--- Backport version: 8.9.8 -->

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

<!--BACKPORT
[{"author":{"name":"jennypavlova","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-11-18T16:27:32Z","message":"[Inventory]
Remove open in Discover button (elastic#200574)\n\nCloses elastic#199964 \r\n\r\nThis
PR removes the `open in discover` button from the inventory
search\r\nbar section.\r\n\r\n| Before | After |\r\n| ------- | -----
|\r\n| <img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/627ebfa0-77c9-4ff1-8a38-3623bf1b7e32\">\r\n|
<img width=\"1915\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2dace203-7203-4bda-8cee-0186e022e373\">\r\n|","sha":"1607803f610cbbc97883b78578723fa8400c7b4a","branchLabelMapping":{"^v9.0.0$":"main","^v8.17.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","backport:skip","v9.0.0","ci:project-deploy-observability","Team:obs-ux-infra_services","v8.17.0"],"number":200574,"url":"https://github.com/elastic/kibana/pull/200574","mergeCommit":{"message":"[Inventory]
Remove open in Discover button (elastic#200574)\n\nCloses elastic#199964 \r\n\r\nThis
PR removes the `open in discover` button from the inventory
search\r\nbar section.\r\n\r\n| Before | After |\r\n| ------- | -----
|\r\n| <img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/627ebfa0-77c9-4ff1-8a38-3623bf1b7e32\">\r\n|
<img width=\"1915\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2dace203-7203-4bda-8cee-0186e022e373\">\r\n|","sha":"1607803f610cbbc97883b78578723fa8400c7b4a"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200574","number":200574,"mergeCommit":{"message":"[Inventory]
Remove open in Discover button (elastic#200574)\n\nCloses elastic#199964 \r\n\r\nThis
PR removes the `open in discover` button from the inventory
search\r\nbar section.\r\n\r\n| Before | After |\r\n| ------- | -----
|\r\n| <img width=\"1911\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/627ebfa0-77c9-4ff1-8a38-3623bf1b7e32\">\r\n|
<img width=\"1915\"
alt=\"image\"\r\nsrc=\"https://github.com/user-attachments/assets/2dace203-7203-4bda-8cee-0186e022e373\">\r\n|","sha":"1607803f610cbbc97883b78578723fa8400c7b4a"}},{"branch":"8.x","label":"v8.17.0","labelRegex":"^v8.17.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
  • Loading branch information
jennypavlova authored Nov 19, 2024
1 parent acafd04 commit 74d2099
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 @@ -26203,6 +26203,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 @@ -26232,7 +26233,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 @@ -26175,6 +26175,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 @@ -26204,7 +26205,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 @@ -26231,6 +26231,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 @@ -26260,7 +26261,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 74d2099

Please sign in to comment.