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

[Backport 4.4-2.4-wzd] Fixed Inventory checks table filters by stats (#4999) #5005

Merged
merged 3 commits into from
Dec 20, 2022
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 @@ -49,6 +49,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- 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 a bug that caused the flyouts to close when clicking inside them [#4638](https://github.com/wazuh/wazuh-kibana-app/pull/4638)
- Fixed Inventory checks table filters by stats [#4999](https://github.com/wazuh/wazuh-kibana-app/pull/4999)
- Fixed agent graph in opensearch dashboard [#4942] (https://github.com/wazuh/wazuh-kibana-app/pull/4942)
- Fixed commands in the deploy new agent section(most of the commands are missing '-1') [#4962](https://github.com/wazuh/wazuh-kibana-app/pull/4962)
- Fixed agent installation command for macOS in the deploy new agent section. [#4968](https://github.com/wazuh/wazuh-kibana-app/pull/4968)
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