Skip to content

Commit

Permalink
Fixed Inventory checks table filters by stats (#4999)
Browse files Browse the repository at this point in the history
* Fixed checks table filters by stats

* Updated CHANGELOG

* Fixed no applicable filter
  • Loading branch information
Machi3mfl authored Dec 19, 2022
1 parent ec10fc7 commit 6e8c942
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion public/components/agents/sca/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ export class Inventory extends Component<InventoryProps, InventoryState> {
<EuiStat
title={this.buttonStat(
this.state.lookingPolicy.invalid,
'result',
'status',
'not applicable'
)}
description="Not applicable"
Expand Down Expand Up @@ -578,6 +578,7 @@ export class Inventory extends Component<InventoryProps, InventoryState> {
<EuiFlexItem>
<InventoryPolicyChecksTable
agent={this.props.agent}
filters={this.state.filters}
lookingPolicy={this.state.lookingPolicy}
/>
</EuiFlexItem>
Expand Down
12 changes: 9 additions & 3 deletions public/components/agents/sca/inventory/checks-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { getFilterValues } from './lib';
type Props = {
agent: { [key: string]: any };
lookingPolicy: { [key: string]: any };
filters: any[];
};

type State = {
Expand All @@ -24,12 +25,12 @@ export class InventoryPolicyChecksTable extends Component<Props, State> {
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 = [
Expand Down Expand Up @@ -208,7 +209,12 @@ export class InventoryPolicyChecksTable extends Component<Props, State> {

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;
Expand Down

0 comments on commit 6e8c942

Please sign in to comment.