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

The selected filter is not applied when redirecting to the events tab in the file integrity monitoring module #6847

Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -22,7 +22,7 @@ All notable changes to the Wazuh app project will be documented in this file.

### Changed

- Removed embedded discover [#6120](https:/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https:/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https:/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https:/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https:/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https:/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https:/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https:/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https:/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https:/wazuh/wazuh-dashboard-plugins/pull/6297) [#6291](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6459](https:/wazuh/wazuh-dashboard-plugins/pull/6459) [#6434](https:/wazuh/wazuh-dashboard-plugins/pull/6434) [#6504](https:/wazuh/wazuh-dashboard-plugins/pull/6504) [#6649](https:/wazuh/wazuh-dashboard-plugins/pull/6649) [#6506](https:/wazuh/wazuh-dashboard-plugins/pull/6506) [#6537](https:/wazuh/wazuh-dashboard-plugins/pull/6537) [#6528](https:/wazuh/wazuh-dashboard-plugins/pull/6528) [#6675](https:/wazuh/wazuh-dashboard-plugins/pull/6675) [#6674](https:/wazuh/wazuh-dashboard-plugins/pull/6674) [#6558](https:/wazuh/wazuh-dashboard-plugins/pull/6558) [#6685](https:/wazuh/wazuh-dashboard-plugins/pull/6685) [#6691](https:/wazuh/wazuh-dashboard-plugins/pull/6691) [#6712](https:/wazuh/wazuh-dashboard-plugins/pull/6712) [#6734](https:/wazuh/wazuh-dashboard-plugins/pull/6734) [#6746](https:/wazuh/wazuh-dashboard-plugins/pull/6746) [#6752](https:/wazuh/wazuh-dashboard-plugins/pull/6752) [#6753](https:/wazuh/wazuh-dashboard-plugins/pull/6753) [#6756](https:/wazuh/wazuh-dashboard-plugins/pull/6756) [#6771](https:/wazuh/wazuh-dashboard-plugins/pull/6771) [#6792](https:/wazuh/wazuh-dashboard-plugins/pull/6792)
- Removed embedded discover [#6120](https:/wazuh/wazuh-dashboard-plugins/pull/6120) [#6235](https:/wazuh/wazuh-dashboard-plugins/pull/6235) [#6254](https:/wazuh/wazuh-dashboard-plugins/pull/6254) [#6285](https:/wazuh/wazuh-dashboard-plugins/pull/6285) [#6288](https:/wazuh/wazuh-dashboard-plugins/pull/6288) [#6290](https:/wazuh/wazuh-dashboard-plugins/pull/6290) [#6289](https:/wazuh/wazuh-dashboard-plugins/pull/6289) [#6286](https:/wazuh/wazuh-dashboard-plugins/pull/6286) [#6275](https:/wazuh/wazuh-dashboard-plugins/pull/6275) [#6287](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6297](https:/wazuh/wazuh-dashboard-plugins/pull/6297) [#6291](https:/wazuh/wazuh-dashboard-plugins/pull/6287) [#6459](https:/wazuh/wazuh-dashboard-plugins/pull/6459) [#6434](https:/wazuh/wazuh-dashboard-plugins/pull/6434) [#6504](https:/wazuh/wazuh-dashboard-plugins/pull/6504) [#6649](https:/wazuh/wazuh-dashboard-plugins/pull/6649) [#6506](https:/wazuh/wazuh-dashboard-plugins/pull/6506) [#6537](https:/wazuh/wazuh-dashboard-plugins/pull/6537) [#6528](https:/wazuh/wazuh-dashboard-plugins/pull/6528) [#6675](https:/wazuh/wazuh-dashboard-plugins/pull/6675) [#6674](https:/wazuh/wazuh-dashboard-plugins/pull/6674) [#6558](https:/wazuh/wazuh-dashboard-plugins/pull/6558) [#6685](https:/wazuh/wazuh-dashboard-plugins/pull/6685) [#6691](https:/wazuh/wazuh-dashboard-plugins/pull/6691) [#6712](https:/wazuh/wazuh-dashboard-plugins/pull/6712) [#6734](https:/wazuh/wazuh-dashboard-plugins/pull/6734) [#6746](https:/wazuh/wazuh-dashboard-plugins/pull/6746) [#6752](https:/wazuh/wazuh-dashboard-plugins/pull/6752) [#6753](https:/wazuh/wazuh-dashboard-plugins/pull/6753) [#6756](https:/wazuh/wazuh-dashboard-plugins/pull/6756) [#6771](https:/wazuh/wazuh-dashboard-plugins/pull/6771) [#6792](https:/wazuh/wazuh-dashboard-plugins/pull/6792) [#6847](https:/wazuh/wazuh-dashboard-plugins/pull/6847)
- Allow editing groups for an agent from Endpoints Summary [#6250](https:/wazuh/wazuh-dashboard-plugins/pull/6250)
- Change how the configuration is managed in the backend side [#6337](https:/wazuh/wazuh-dashboard-plugins/pull/6337) [#6519](https:/wazuh/wazuh-dashboard-plugins/pull/6519) [#6573](https:/wazuh/wazuh-dashboard-plugins/pull/6573)
- Change the view of API is down and check connection to Server APIs application [#6337](https:/wazuh/wazuh-dashboard-plugins/pull/6337)
Expand Down
66 changes: 41 additions & 25 deletions plugins/main/public/components/agents/fim/inventory/fileDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,32 +210,15 @@ export class FileDetails extends Component {
];
}

viewInEvents = ev => {
viewInEvents = async ev => {
const { file } = this.props.currentFile;
if (this.props.view === 'extern') {
NavigationService.getInstance().navigateToModule(ev, 'overview', {
agentId: this.props?.agent?.id,
tab: 'fim',
tabView: 'events',
filters: { 'syscheck.path': file },
});
} else {
NavigationService.getInstance().navigateToModule(
ev,
'overview',
{
agentId: this.props?.agent?.id,
tab: 'fim',
tabView: 'events',
filters: { 'syscheck.path': file },
},
() => this.openEventCurrentWindow(),
);
const { agent } = this.props;
const agentId = agent?.id;

if (!this.indexPattern) {
this.indexPattern = await getIndexPattern();
}
};

openEventCurrentWindow() {
const { file } = this.props.currentFile;
const filters = [
{
...buildPhraseFilter(
Expand All @@ -247,9 +230,42 @@ export class FileDetails extends Component {
},
];

if (this.props.view === 'extern') {
this.applyFiltersAndNavigate(ev, filters, 'overview', {
agentId,
tab: 'fim',
tabView: 'events',
filters: { 'syscheck.path': file },
});
} else {
this.applyFiltersAndNavigate(
ev,
filters,
'overview',
{ agentId, tab: 'fim', tabView: 'events' },
this.openEventCurrentWindow,
);
}
};

applyFiltersAndNavigate = async (ev, filters, module, params, callback) => {
try {
const { filterManager } = getDataPlugin().query;
filterManager.addFilters(filters);
await NavigationService.getInstance().navigateToModule(
ev,
module,
params,
callback,
);
} catch (error) {
ErrorHandler.handleError(error);
}
};

openEventCurrentWindow = () => {
this.props.onSelectedTabChanged('events');
this.checkFilterManager(filters);
}
};

async checkFilterManager(filters) {
try {
Expand Down
Loading