From 6e8c94263c5faeb0d02b2b38786d4026b20fb137 Mon Sep 17 00:00:00 2001 From: Maximiliano Ibarra <6089438+Machi3mfl@users.noreply.github.com> Date: Mon, 19 Dec 2022 05:01:51 -0300 Subject: [PATCH] Fixed Inventory checks table filters by stats (#4999) * Fixed checks table filters by stats * Updated CHANGELOG * Fixed no applicable filter --- CHANGELOG.md | 1 + public/components/agents/sca/inventory.tsx | 3 ++- .../components/agents/sca/inventory/checks-table.tsx | 12 +++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb4c1bbe9c..a679713f67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ All notable changes to the Wazuh app project will be documented in this file. - Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) - Fixed WAZUH_PROTOCOL param suggestion [#4849](https://github.com/wazuh/wazuh-kibana-app/pull/4849) - Raspbian OS, Ubuntu, Amazon Linux and Amazon Linux 2 commands in the wizard deploy agent now change when a different architecture is selected [#4876](https://github.com/wazuh/wazuh-kibana-app/pull/4876) [#4880](https://github.com/wazuh/wazuh-kibana-app/pull/4880) +- Fixed Inventory checks table filters by stats [#4999](https://github.com/wazuh/wazuh-kibana-app/pull/4999) - Fixed vulnerabilities default last scan date formatter [#4975](https://github.com/wazuh/wazuh-kibana-app/pull/4975) ## Wazuh v4.3.10 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 4311 diff --git a/public/components/agents/sca/inventory.tsx b/public/components/agents/sca/inventory.tsx index d5de1ed4ef..45db9d3725 100644 --- a/public/components/agents/sca/inventory.tsx +++ b/public/components/agents/sca/inventory.tsx @@ -544,7 +544,7 @@ export class Inventory extends Component { { diff --git a/public/components/agents/sca/inventory/checks-table.tsx b/public/components/agents/sca/inventory/checks-table.tsx index d31d614e99..190d638382 100644 --- a/public/components/agents/sca/inventory/checks-table.tsx +++ b/public/components/agents/sca/inventory/checks-table.tsx @@ -8,6 +8,7 @@ import { getFilterValues } from './lib'; type Props = { agent: { [key: string]: any }; lookingPolicy: { [key: string]: any }; + filters: any[]; }; type State = { @@ -24,12 +25,12 @@ export class InventoryPolicyChecksTable extends Component { columnsChecks: any; constructor(props) { super(props); - const { agent, lookingPolicy } = this.props; + const { agent, lookingPolicy, filters } = this.props; this.state = { agent, lookingPolicy, itemIdToExpandedRowMap: {}, - filters: [], + filters: filters || [], pageTableChecks: { pageIndex: 0 }, }; this.suggestions = [ @@ -208,7 +209,12 @@ export class InventoryPolicyChecksTable extends Component { async componentDidMount() {} - async componentDidUpdate(prevProps, prevState) {} + async componentDidUpdate(prevProps) { + const { filters } = this.props + if (filters !== prevProps.filters) { + this.setState({ filters: filters }); + } + } componentWillUnmount() { this._isMount = false;