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

Fixes report generation when have a pinned agent #6873

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
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:/wazuh/wazuh-dashboard-plugins/pull/6716) [#6755](https:/wazuh/wazuh-dashboard-plugins/pull/6755) [#6833](https:/wazuh/wazuh-dashboard-plugins/pull/6833)
- Generate URL with predefined filters [#6745](https:/wazuh/wazuh-dashboard-plugins/pull/6745)
- Migrated AngularJS routing to ReactJS [#6689](https:/wazuh/wazuh-dashboard-plugins/pull/6689) [#6775](https:/wazuh/wazuh-dashboard-plugins/pull/6775) [#6790](https:/wazuh/wazuh-dashboard-plugins/pull/6790)
- Improvement of the filter management system by implementing new standard modules [#6534](https:/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https:/wazuh/wazuh-dashboard-plugins/pull/6772)
- Improvement of the filter management system by implementing new standard modules [#6534](https:/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https:/wazuh/wazuh-dashboard-plugins/pull/6772) [#6873](https:/wazuh/wazuh-dashboard-plugins/pull/6873)
- Changed permalink field in the Events tab table in Virustotal to show an external link [#6839](https:/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
Loading