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

Fix/events table #3086

Merged
merged 4 commits into from
Mar 19, 2021
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Fix rule filter is no applied when you click on a rule id in other module.[#3057](https://github.com/wazuh/wazuh-kibana-app/pull/3057)
- Fixed bug changing master node configuration [#3062](https://github.com/wazuh/wazuh-kibana-app/pull/3062)
- Improved validation and prevention for caching bundles in client side [#3063](https://github.com/wazuh/wazuh-kibana-app/pull/3063)
- Fix some errors in Events table, action buttons style and urls disappeared [#3086](https://github.com/wazuh/wazuh-kibana-app/pull/3086)
- Rollback of invalid rule configuration file [#3084](https://github.com/wazuh/wazuh-kibana-app/pull/3084)

### Changed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ export const EventsEnhanceDiscoverCell = {
},
currentTechnique: content
}), {
contentRegex: /(\w+)/g
contentRegex: /(\w+)/g,
element: 'span'
})
}

Expand Down
18 changes: 9 additions & 9 deletions public/components/common/modules/events.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,10 @@ export class Events extends Component {
this.fetchWatch = scope.$watchCollection('fetchStatus',
(fetchStatus) => {
if (scope.fetchStatus === 'complete') {
setTimeout(() => {
setTimeout(() => {
ModulesHelper.cleanAvailableFields();


}, 1000);
// Check the discover table is in the DOM and enhance the initial table cells
this.intervalCheckExistsDiscoverTable = setInterval(() => {
Expand Down Expand Up @@ -116,8 +116,8 @@ export class Events extends Component {
}
})
});
const discoverTableTHead = document.querySelector('.kbn-table thead tr');
this.discoverTableColumnsObserver.observe(discoverTableTHead, { childList: true });
const discoverTableElement = document.querySelector('.kbn-table').parentElement.parentElement.parentElement;;
this.discoverTableColumnsObserver.observe(discoverTableElement, { childList: true });
}

enhanceDiscoverTableCurrentRows = (discoverRowsData, options, addObserverDetails = false) => {
Expand All @@ -134,7 +134,7 @@ export class Events extends Component {
enhanceDiscoverEventsCell(header.textContent, cell.textContent, discoverRowsData[rowIndex], cell, options);
};
});
// Add observer to row details
// Add observer to row details
if (addObserverDetails){
const rowDetails = row.nextElementSibling;
this.enhanceDiscoverTableRowDetailsAddObserver(rowDetails, discoverRowsData, options);
Expand All @@ -153,7 +153,7 @@ export class Events extends Component {
this.checkUnknownFields(rowDetailField);
const fieldName = rowDetailField.childNodes[0].childNodes[1].textContent || "";
const fieldCell = rowDetailField.parentNode.childNodes && rowDetailField.parentNode.childNodes[2].childNodes[0];
if(!fieldCell){ return };
if(!fieldCell){ return };
enhanceDiscoverEventsCell(fieldName, (fieldCell || {}).textContent || '', discoverRowsData[rowIndex], fieldCell, options);
});
};
Expand All @@ -167,13 +167,13 @@ export class Events extends Component {
}

refreshKnownFields = async () => {
if (!this.state.hasRefreshedKnownFields) {
if (!this.state.hasRefreshedKnownFields) {
try {
this.setState({ hasRefreshedKnownFields: true, isRefreshing: true });
await PatternHandler.refreshIndexPattern();

this.setState({ isRefreshing: false });
this.reloadToast()
this.reloadToast()

} catch (err) {
this.setState({ isRefreshing: false });
Expand Down