Skip to content

Commit

Permalink
Fixes report generation when have a pinned agent (#6873)
Browse files Browse the repository at this point in the history
* Add conditional type of meta filter

* Add changelog

* fix(agent-inventory): reports PDF data source missing cluster/manager filter

---------

Co-authored-by: Antonio David Gutiérrez <antonio.gutierrez@wazuh.com>
  • Loading branch information
yenienserrano and Desvelao authored Jul 29, 2024
1 parent 3f1d8cb commit b4df0b3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Refactored the search bar to correctly handle fixed and user-added filters [#6716](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6716) [#6755](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6755) [#6833](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6833)
- Generate URL with predefined filters [#6745](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6745)
- Migrated AngularJS routing to ReactJS [#6689](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6689) [#6775](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6775) [#6790](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6790)
- Improvement of the filter management system by implementing new standard modules [#6534](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6772)
- Improvement of the filter management system by implementing new standard modules [#6534](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6772) [#6873](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6873)
- Changed permalink field in the Events tab table in Virustotal to show an external link [#6839](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6839)

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ export class PatternDataSourceFilterManager
value: Array.isArray(value) ? value.join(', ') : value,
params: value,
negate,
type: 'phrases',
type: Array.isArray(value) ? 'phrases' : 'phrase',
index: indexPatternId,
controlledBy,
},
Expand Down
16 changes: 15 additions & 1 deletion plugins/main/public/components/common/modules/main-agent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
AlertsDataSource,
AlertsDataSourceRepository,
PatternDataSource,
tFilter,
tParsedIndexPattern,
useDataSource,
} from '../data-source';
Expand Down Expand Up @@ -224,14 +225,27 @@ export default compose(
}),
)(MainModuleAgent);

export class AgentInventoryDataSource extends AlertsDataSource {
constructor(id: string, title: string) {
super(id, title);
}

getFixedFilters(): tFilter[] {
return [
...super.getFixedFiltersClusterManager(),
...super.getFixedFilters(),
];
}
}

const GenerateSyscollectorReportButton = ({ agent }) => {
const {
dataSource,
fetchFilters,
isLoading: isDataSourceLoading,
} = useDataSource<tParsedIndexPattern, PatternDataSource>({
repository: new AlertsDataSourceRepository(), // this makes only works with alerts index pattern
DataSource: AlertsDataSource,
DataSource: AgentInventoryDataSource,
});

const action = useAsyncAction(async () => {
Expand Down

0 comments on commit b4df0b3

Please sign in to comment.