Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Inventory] Remove open in Discover button
Browse files Browse the repository at this point in the history
jennypavlova committed Nov 18, 2024

Verified

This commit was signed with the committer’s verified signature.
watson Thomas Watson
1 parent da46be0 commit 50b6b85
Showing 3 changed files with 15 additions and 91 deletions.
Original file line number Diff line number Diff line change
@@ -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',

This file was deleted.

Original file line number Diff line number Diff line change
@@ -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';
@@ -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();
@@ -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
/>
);
}

0 comments on commit 50b6b85

Please sign in to comment.