Skip to content

Commit

Permalink
Remove processes state column in macOS agents (#7122)
Browse files Browse the repository at this point in the history
* Refactor process column mapping to use a dedicated function for improved readability and maintainability

* Update CHANGELOG to document removal of processes state column in macOS agents (#7122)

* Refactor process column mapping to use `mapColumns` for consistency across OS implementations and enhance code clarity

* Remove unused 'State' column from inventory snapshot for better clarity in agent rendering tests
  • Loading branch information
guidomodarelli authored Oct 24, 2024
1 parent 9157e9a commit e74b7ed
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 31 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Removed agent RBAC filters from dashboard queries [#6945](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6945)
- Removed GET /elastic/statistics API endpoint [#7001](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7001)
- Removed VirusTotal application in favor of Malware Detection [#7038](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7038)
- Removed processes state column in macOS agents [#7122](https://github.com/wazuh/wazuh-dashboard-plugins/pull/7122)

## Wazuh v4.9.1 - OpenSearch Dashboards 2.13.0 - Revision 04

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2085,31 +2085,6 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
</span>
</button>
</th>
<th
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_state_6"
role="columnheader"
scope="col"
style="width:15%"
>
<button
class="euiTableHeaderButton"
data-test-subj="tableHeaderSortButton"
type="button"
>
<span
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
>
State
</span>
</span>
</button>
</th>
</tr>
</thead>
<tbody>
Expand All @@ -2118,7 +2093,7 @@ exports[`Inventory component A Apple agent should be well rendered. 1`] = `
>
<td
class="euiTableRowCell euiTableRowCell--isMobileFullWidth"
colspan="7"
colspan="6"
>
<div
class="euiTableCellContent euiTableCellContent--alignCenter"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { KeyEquivalence } from "../../../../../common/csv-key-equivalence";
import { KeyEquivalence } from '../../../../../common/csv-key-equivalence';

const mapColumns = ({ field, ...rest }: { field: string; name?: string }) => ({
...rest,
field,
name: rest.name || KeyEquivalence[field] || field,
});

const windowsColumns = [
{ field: 'name', searchable: true, sortable: true, width: '10%' },
Expand All @@ -8,7 +14,8 @@ const windowsColumns = [
{ field: 'priority', searchable: true, sortable: true },
{ field: 'nlwp', searchable: true, sortable: true },
{ field: 'cmd', searchable: true, sortable: true, width: '30%' },
].map(({field, ...rest}) => ({...rest, field, name: rest.name || KeyEquivalence[field] || field}));
].map(mapColumns);

const linuxColumns = [
{ field: 'name', searchable: true, sortable: true, width: '10%' },
{ field: 'euser', searchable: true, sortable: true },
Expand All @@ -22,16 +29,16 @@ const linuxColumns = [
{ field: 'session', searchable: true, sortable: true },
{ field: 'nice', searchable: true, sortable: true },
{ field: 'state', searchable: true, sortable: true, width: '15%' },
].map(({field, ...rest}) => ({...rest, field, name: rest.name || KeyEquivalence[field] || field}));
].map(mapColumns);

const macColumns = [
{ field: 'name', searchable: true, sortable: true, width: '10%' },
{ field: 'euser', searchable: true, sortable: true },
{ field: 'pid', searchable: true, sortable: true },
{ field: 'ppid', searchable: true, sortable: true },
{ field: 'vm_size', searchable: true, sortable: true },
{ field: 'nice', searchable: true, sortable: true },
{ field: 'state', searchable: true, sortable: true, width: '15%' },
].map(({field, ...rest}) => ({...rest, field, name: rest.name || KeyEquivalence[field] || field}));
].map(mapColumns);

export const processColumns = {
windows: windowsColumns,
Expand Down

0 comments on commit e74b7ed

Please sign in to comment.