Skip to content

Commit

Permalink
The selected filter is not applied when redirecting to the events tab…
Browse files Browse the repository at this point in the history
… in the file integrity monitoring module (#6847)

* fix the selected filter is not applied when redirecting to the events tab in the file integrity monitoring module

* update changelog
  • Loading branch information
chantal-kelm authored Jul 24, 2024
1 parent d988e4a commit f868722
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 26 deletions.
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) [#6845](https:/wazuh/wazuh-dashboard-plugins/pull/6845) [#6857](https:/wazuh/wazuh-dashboard-plugins/pull/6857)
- 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) [#6845](https:/wazuh/wazuh-dashboard-plugins/pull/6845) [#6857](https:/wazuh/wazuh-dashboard-plugins/pull/6857) [#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

0 comments on commit f868722

Please sign in to comment.