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

Fixed error when pinned agent in vulnerabilities #6827

Merged
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
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
Loading