From 119ed16c2d9fb1efcdcf3456cb58bb7aa4432237 Mon Sep 17 00:00:00 2001 From: Antonio <34042064+Desvelao@users.noreply.github.com> Date: Fri, 31 Mar 2023 09:21:52 +0200 Subject: [PATCH] Fix the search in the agent inventory data tables (#5196) * fix: change the search in the agents inventory tables - Replace search by q API parameter * changelog: add pull request entry * fix(agent-inventory): change the search bar placeholder to `Search` * fix(changelog): fix entry * fix: replace string * fix(changelog): moved entry to Fixed --------- Co-authored-by: Nicolas Agustin Guevara Pihen <42900763+Tostti@users.noreply.github.com> (cherry picked from commit 4fadc4e0f6311f86b0f4adfdc0d0b00bc72337fe) --- CHANGELOG.md | 10 ++++++++++ .../components/syscollector-table.tsx | 20 ++++++++++++++----- 2 files changed, 25 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7260768469..079dfd9d67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ All notable changes to the Wazuh app project will be documented in this file. +## Wazuh v4.4.1 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 00 + +### Fixed + +- Fixed the search in the agent inventory data tables [#5196](https://github.com/wazuh/wazuh-kibana-app/pull/5196) +- Fixed `Top 5 users` table overflow in `FIM::Dashboard` [#5334](https://github.com/wazuh/wazuh-kibana-app/pull/5334) +- Fixed a visual error in the 'About' section. [#5337](https://github.com/wazuh/wazuh-kibana-app/pull/5337) +- Fixed the `Anomaly and malware detection` link. [#5329](https://github.com/wazuh/wazuh-kibana-app/pull/5329) +- Fixed the problem that did not allow closing the time picker when the button was clicked again in `Agents` and `Management/Statistics`. [#5341](https://github.com/wazuh/wazuh-kibana-app/pull/5341) + ## Wazuh v4.4.0 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 06 ### Added diff --git a/public/components/agents/syscollector/components/syscollector-table.tsx b/public/components/agents/syscollector/components/syscollector-table.tsx index d430d837a2..4df55316fd 100644 --- a/public/components/agents/syscollector/components/syscollector-table.tsx +++ b/public/components/agents/syscollector/components/syscollector-table.tsx @@ -6,7 +6,11 @@ import { AppState } from '../../../../react-services/app-state'; export function SyscollectorTable({ tableParams }) { - const [params, setParams] = useState({ limit: 10, offset: 0, }); + const [params, setParams] = useState<{ limit: number, offset: number, select:string, q?: string}>({ + limit: 10, + offset: 0, + select: tableParams.columns.map(({id}) => id).join(",") + }); const [pageIndex, setPageIndex] = useState(0); const [searchBarValue, setSearchBarValue] = useState(""); const [pageSize, setPageSize] = useState(10); @@ -67,7 +71,13 @@ export function SyscollectorTable({ tableParams }) { setSearchBarValue(value); timerDelaySearch && clearTimeout(timerDelaySearch); const timeoutId = setTimeout(() => { - const newParams = { ...params, search: value }; + const { q, ...rest} = params; + const newParams = { + ...rest, + ...(value ? { + q: tableParams.columns.map(({id}) => `${id}~${value}`).join(",") + }: {}) + }; setParams(newParams); setPageIndex(0); }, 400) @@ -85,7 +95,7 @@ export function SyscollectorTable({ tableParams }) { await AppState.downloadCsv( tableParams.path, tableParams.exportFormatted, - !!params.search ? [{ name: 'search', value: params.search }] : [] + !!params.q ? [{ name: 'q', value: params.q }] : [] ) } @@ -101,11 +111,11 @@ export function SyscollectorTable({ tableParams }) {