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

Bugfix/2887 null pointer in filter wrong type #2961

Merged
merged 7 commits into from
Feb 19, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fix Security events table is empty when switching the pinned agents [#2956](https://github.com/wazuh/wazuh-kibana-app/pull/2956)
- Fix disabled switch visual edit button when json content is empty [#2957](https://github.com/wazuh/wazuh-kibana-app/issues/2957)
- Fixed main and `More` menus for unsupported agents [#2959](https://github.com/wazuh/wazuh-kibana-app/pull/2959)
- Fixed forcing a non numeric filter value in a number type field [#2961](https://github.com/wazuh/wazuh-kibana-app/pull/2961)
- Fixed wrong number of alerts in Security Events [#2964](https://github.com/wazuh/wazuh-kibana-app/pull/2964)
- Fixed search with strange characters of agent in Management groups [#2970](https://github.com/wazuh/wazuh-kibana-app/pull/2970)
- Fix the statusCode error message [#2971](https://github.com/wazuh/wazuh-kibana-app/pull/2971)
Expand Down
16 changes: 14 additions & 2 deletions public/kibana-integrations/kibana-discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import discoverTemplate from '../templates/discover/discover.html';
import store from '../redux/store';
import { updateVis } from '../redux/actions/visualizationsActions';
import { getAngularModule, getCore, getDiscoverModule, getPlugins } from '../kibana-services';
import { getAngularModule, getCore, getDiscoverModule, getPlugins, getToasts } from '../kibana-services';
import {
getRequestInspectorStats,
getResponseInspectorStats,
Expand Down Expand Up @@ -297,7 +297,19 @@ function discoverController(
filterManager.getUpdates$(),
{
next: () => {
$scope.state.filters = filterManager.getAppFilters();
//Patch empty fields
const filters = filterManager.getAppFilters();
if(filters.filter(item=>item.meta.params.query==='').length){
getToasts().add({
color: 'warning',
title: 'Invalid field value',
text: 'The filter field contains invalid value',
toastLifeTimeMs: 10000,
});
filterManager.setFilters(filters.filter(item=>item.meta.params.query));
}
//end of patch empty fields
$scope.state.filters = filters;
$scope.updateDataSource();
},
},
Expand Down