Skip to content

Commit

Permalink
Fixed error when pinned agent in vulnerabilities (#6827)
Browse files Browse the repository at this point in the history
* Fixed error when pinned agent in vulnerabilities

* Added CHANGELOG

* Changed CHANGELOG
  • Loading branch information
jbiset authored Jul 16, 2024
1 parent ac2c9ee commit 6eaec17
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Removed the unexpected `delay` parameter on the server API requests [#6778](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6778)
- Fixed home KPI links with custom or index pattern whose title is different to the id [#6777](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6777)
- Fixed colors related to vulnerability severity levels on Vulnerability Detection dashboard [#6793](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6793)
- Fixed pinned agent error in vulnerabilities events tab [#6827](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6827)

## Wazuh v4.8.0 - OpenSearch Dashboards 2.10.0 - Revision 12

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
AUTHORIZED_AGENTS,
VULNERABILITY_IMPLICIT_CLUSTER_MODE_FILTER,
WAZUH_ALERTS_PATTERN,
} from '../../../../../common/constants';
import { AppState } from '../../../../react-services';
import { FilterHandler } from '../../../../utils/filter-handler';
Expand Down Expand Up @@ -113,7 +112,7 @@ export const restorePrevIndexFiltersAdapter = (
cleanedFilters.unshift(managerFilter);
const implicitPinnedAgent = getImplicitPinnedAgent(
previousFilters,
toIndexPattern ?? WAZUH_ALERTS_PATTERN,
toIndexPattern ?? AppState.getCurrentPattern(),
);
if (implicitPinnedAgent) {
const cleanedFiltersWithoutNormalAgents = cleanedFilters.filter(x => {
Expand Down Expand Up @@ -143,7 +142,7 @@ export const onUpdateAdapter = (
*/
const cleanedFilters = cleanFilters(
filters,
prevStoragePattern ?? WAZUH_ALERTS_PATTERN,
prevStoragePattern ?? AppState.getCurrentPattern(),
);
if (storagePreviousFilters) {
const previousFilters = JSON.parse(storagePreviousFilters);
Expand All @@ -152,7 +151,7 @@ export const onUpdateAdapter = (
);
const cleanedPreviousImplicitFilters = cleanFilters(
previousImplicitFilters,
prevStoragePattern ?? WAZUH_ALERTS_PATTERN,
prevStoragePattern ?? AppState.getCurrentPattern(),
);
/* Normal filters added to storagePreviousFilters are added to keep them between dashboard and inventory tab */
const newFilters = filters.filter(
Expand Down

0 comments on commit 6eaec17

Please sign in to comment.