Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add saved queries button to search bar #6833

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Upgraded versions of `follow-redirects` and `es5-ext` [#6626](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6626)
- Changed agent log collector socket API response controller component [#6660](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6660)
- Improve margins and paddings in the Events, Inventory and Control tabs [#6708](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6708)
- Refactored the search bar to correctly handle fixed and user-added filters [#6716](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6716) [#6755](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6755)
- Refactored the search bar to correctly handle fixed and user-added filters [#6716](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6716) [#6755](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6755) [#6833](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6833)
- Generate URL with predefined filters [#6745](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6745)
- Migrated AngularJS routing to ReactJS [#6689](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6689) [#6775](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6775) [#6790](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6790
- Improvement of the filter management system by implementing new standard modules [#6534](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6772)
Expand Down
10 changes: 10 additions & 0 deletions plugins/main/public/components/common/search-bar/search-bar.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
.wz-search-bar-no-padding .globalQueryBar:not(:empty) {
padding: 0px !important;
}

.wz-search-bar {
> .euiFlexGroup {
&:first-child {
#GlobalFilterGroup {
display: none;
}
}
}
}
14 changes: 6 additions & 8 deletions plugins/main/public/components/common/search-bar/search-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {
SearchBarProps,
Filter,
} from '../../../../../../src/plugins/data/public';
import useSearchBar from './use-search-bar';

export interface WzSearchBarProps extends SearchBarProps {
fixedFilters?: Filter[];
Expand Down Expand Up @@ -49,9 +48,7 @@ export const WzSearchBar = ({
>
{preQueryBar ? <EuiFlexItem>{preQueryBar}</EuiFlexItem> : null}
<EuiFlexItem grow={!preQueryBar}>
<SearchBar
{...restProps}
showFilterBar={false} />
<SearchBar {...restProps} />
</EuiFlexItem>
</EuiFlexGroup>
) : null}
Expand All @@ -68,10 +65,11 @@ export const WzSearchBar = ({
{fixedFilters?.map((filter, idx) => (
<EuiFlexItem grow={false} key={idx}>
<EuiBadge className='globalFilterItem' color='hollow'>
{`${filter.meta.key}: ${typeof filter.meta.value === 'function'
? filter.meta.value()
: filter.meta.value
}`}
{`${filter.meta.key}: ${
typeof filter.meta.value === 'function'
? filter.meta.value()
: filter.meta.value
}`}
</EuiBadge>
</EuiFlexItem>
))}
Expand Down
Loading