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
Changes from 1 commit
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
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