Skip to content

Commit

Permalink
Remove implicit filter from search bar UI (#6174)
Browse files Browse the repository at this point in the history
* feat(search-bar): remove implicit filter from search bar UI

* changelog: add pull request entry

* test(search-bar): update tests of wql

---------

Co-authored-by: Chantal Belén kelm <[email protected]>
  • Loading branch information
Desvelao and chantal-kelm authored Nov 30, 2023
1 parent a61d777 commit 2b875e8
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 76 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ All notable changes to the Wazuh app project will be documented in this file.

- Removed the `disabled_roles` and `customization.logo.sidebar` settings [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Removed the ability to configure the visibility of modules and removed `extensions.*` settings [#5840](https://github.com/wazuh/wazuh-dashboard-plugins/pull/5840)
- Removed the implicit filter of WQL language of the search bar UI [#6174](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6174)

## Wazuh v4.7.1 - OpenSearch Dashboards 2.8.0 - Revision 01

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,46 +17,6 @@ exports[`SearchBar component Renders correctly to match the snapshot of query la
<div
class="euiFormControlLayout euiFormControlLayout--fullWidth euiFormControlLayout--group"
>
<div
class="euiPopover euiPopover--anchorDownCenter euiFormControlLayout__prepend"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButtonEmpty euiButtonEmpty--primary"
type="button"
>
<span
class="euiButtonContent euiButtonEmpty__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
/>
<span
class="euiButtonEmpty__text"
>
<span
class="euiCodeBlock euiCodeBlock--fontSmall euiCodeBlock--paddingLarge euiCodeBlock--inline prismjs language-none"
>
<code
class="euiCodeBlock__code"
>
id!=000 and
</code>
</span>
</span>
</span>
</button>
</div>
</div>
<div
class="euiFormControlLayout__childrenWrapper"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ describe('SearchBar component', () => {
const wrapper = render(<SearchBar {...componentProps} />);

await waitFor(() => {
const elementImplicitQuery = wrapper.container.querySelector(
'.euiCodeBlock__code',
);
expect(elementImplicitQuery?.innerHTML).toEqual('id!=000 and ');
expect(wrapper.container).toMatchSnapshot();
});
});
Expand Down
32 changes: 0 additions & 32 deletions plugins/main/public/components/search-bar/query-language/wql.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1156,38 +1156,6 @@ export const WQL = {
);
}
},
prepend: implicitQueryAsQL ? (
<EuiPopover
button={
<EuiButtonEmpty
onClick={() =>
params.setQueryLanguageConfiguration(state => ({
...state,
isOpenPopoverImplicitFilter:
!state.isOpenPopoverImplicitFilter,
}))
}
iconType='filter'
>
<EuiCode>{implicitQueryAsQL}</EuiCode>
</EuiButtonEmpty>
}
isOpen={
params.queryLanguage.configuration.isOpenPopoverImplicitFilter
}
closePopover={() =>
params.setQueryLanguageConfiguration(state => ({
...state,
isOpenPopoverImplicitFilter: false,
}))
}
>
<EuiText>
Implicit query: <EuiCode>{implicitQueryAsQL}</EuiCode>
</EuiText>
<EuiText color='subdued'>This query is added to the input.</EuiText>
</EuiPopover>
) : null,
// Disable the focus trap in the EuiInputPopover.
// This causes when using the Search suggestion, the suggestion popover can be closed.
// If this is disabled, then the suggestion popover is open after a short time for this
Expand Down

0 comments on commit 2b875e8

Please sign in to comment.