Closed asteriscos closed 1 month ago
https://github.com/wazuh/wazuh-dashboard-plugins/pull/6674
https://github.com/wazuh/wazuh-dashboard-plugins/assets/6089438/ed472a58-a6e7-4da9-b577-4074572a0e14
https://github.com/wazuh/wazuh-dashboard-plugins/assets/6089438/b7756ab9-a9d6-479a-9387-7ffd0ebff7a7
<EuiButtonEmpty
iconType='popout'
aria-label='popout'
href={getCore().application.getUrlForApp(threatHunting.id, {
path: `#/overview/?tab=general&tabView=panels&addRuleFilter=1001`
})}
target='blank'
>
View alerts of this Rule
</EuiButtonEmpty>
plugins/wazuh/public/services/common-data.js
, globally check the URL query, search the addRuleFilter and add directly to the filter manager the filterconst regex = new RegExp('addRuleFilter=' + '[^&]*');
const match = this.$window.location.href.match(regex);
if (match && match[0]) {
const id = match[0].split('=')[1];
let filter = filterHandler.ruleIdQuery(id);
filter.$state.isImplicit = false;
filters.push(filter);
this.$window.location.href = this.$window.location.href.replace(
regex,
'',
);
}
addRuleFilter
param.Encapsulate the getCore().application.getUrlForApp method and create a function that creates the redirect URL with all the necessary params like:
For instance:
// redirect manager or something
redirector.redirectToApp({
tab: 'general',
tabView: 'panels',
applicationId: 'threat-hunting',
filters: [{ key: 'rule.id', value: '1001' }]
})
Then this service construct the URL with the params like:
When the URL is refreshed using enter or F5 the a_ content is cleaned
For instance:
getCore().application.getUrlForApp(threatHunting.id, {
path: `#/overview/?tab=general&tabView=panels&filters='ruleId=1001&ruleMitreId=T100`
})
Then, when the data source is loaded the data source filter manager gets the query params, creates the filters and add on it.
Currently, to display the implicit filters, the search bar component native to OpenSearch is manipulated and the close buttons for the filter badges are removed. This practice sometimes results in incorrect functionality because we are interfering with the behavior of a component outside our control.
To achieve a stable behavior for displaying implicit filters, the following alternatives are proposed.
All options have the same technical solution but with different visual proposals.
without the close button
This option, visually, is identical to how it is currently displayed, but technically the solution is different. We would be hiding the implicit filters from the native search bar and adding them as components of our application outside the bar in the DOM.
without the close button and with another background color
Tooltip
to display the infoPopover
to display the infoDue to the scope and size of the proposed solution, we decided to create another issue to continue the development: https://github.com/wazuh/wazuh-dashboard-plugins/issues/6711
Description
After testing all main features integrated we detected some odd behaviors that need fixing.
Tasks