Skip to content

Commit

Permalink
Remove duplicated buttons in SCA inventory (#5010)
Browse files Browse the repository at this point in the history
* fix: remove unused buttons in sca inventory

* changelog: add pull request entry to the changelog

(cherry picked from commit 442c45a)
  • Loading branch information
Desvelao committed Dec 20, 2022
1 parent 2e57377 commit 262ef0e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 45 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fixed a bug where the Wazuh logo was used instead of the custom one [#4539](https://github.com/wazuh/wazuh-kibana-app/pull/4539)
- Fixed rendering problems of the `Agent Overview` section in low resolutions [#4516](https://github.com/wazuh/wazuh-kibana-app/pull/4516)
- Fixed issue when logging out from Wazuh when SAML is enabled [#4595](https://github.com/wazuh/wazuh-kibana-app/issues/4595)
- Fixed server errors with code 500 when the Wazuh API is not reachable / up. [#4710](https://github.com/wazuh/wazuh-kibana-app/pull/4710) [#4728](https://github.com/wazuh/wazuh-kibana-app/pull/4728) [#4998](https://github.com/wazuh/wazuh-kibana-app/pull/4998)
- Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653)
- Fixed server errors with code 500 when the Wazuh API is not reachable / up. [#4710](https://github.com/wazuh/wazuh-kibana-app/pull/4710) [#4728](https://github.com/wazuh/wazuh-kibana-app/pull/4728) [#4971](https://github.com/wazuh/wazuh-kibana-app/pull/4971)
- Fixed pagination to SCA table [#4653](https://github.com/wazuh/wazuh-kibana-app/issues/4653) [#5010](https://github.com/wazuh/wazuh-kibana-app/pull/5010)
- 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 commands in the deploy new agent section(most of the commands are missing '-1') [#4962](https://github.com/wazuh/wazuh-kibana-app/pull/4962)
Expand Down
43 changes: 0 additions & 43 deletions public/components/agents/sca/inventory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ import {
} from '@elastic/eui';
import { WzRequest } from '../../../react-services/wz-request';
import { formatUIDate } from '../../../react-services/time-service';
import exportCsv from '../../../react-services/wz-csv';
import { getToasts } from '../../../kibana-services';
import _ from 'lodash';
import {
Expand Down Expand Up @@ -325,32 +324,6 @@ export class Inventory extends Component<InventoryProps, InventoryState> {
});
};

/**
*
*/
async downloadCsv() {
try {
this.showToast('success', 'Your download should begin automatically...', 3000);
await exportCsv(
'/sca/' + this.props.agent.id + '/checks/' + this.state.lookingPolicy.policy_id,
[],
this.state.lookingPolicy.policy_id
);
} catch (error) {
const options: UIErrorLog = {
context: `${Inventory.name}.downloadCsv`,
level: UI_LOGGER_LEVELS.ERROR as UILogLevel,
severity: UI_ERROR_SEVERITIES.BUSINESS as UIErrorSeverity,
error: {
error: error,
message: error.message || error,
title: error.name,
},
};
getErrorOrchestrator().handleError(options);
}
}

buttonStat(text, field, value) {
return <button onClick={() => this.setState({ filters: [{ field, value }] })}>{text}</button>;
}
Expand Down Expand Up @@ -503,22 +476,6 @@ export class Inventory extends Component<InventoryProps, InventoryState> {
</h2>
</EuiTitle>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
iconType="importAction"
onClick={async () => await this.downloadCsv()}
>
Export formatted
</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty
iconType="refresh"
onClick={() => this.loadScaPolicy(this.state.lookingPolicy.policy_id)}
>
Refresh
</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="m" />
<EuiFlexGroup>
Expand Down

0 comments on commit 262ef0e

Please sign in to comment.