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 Switchtab exception in dashboards #6019

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
30 changes: 14 additions & 16 deletions plugins/main/public/controllers/overview/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,27 @@ export class OverviewController {
this.visFactoryService = VisFactoryHandler;
this.rawVisualizations = new RawVisualizations();
this.wzReq = (...args) => WzRequest.apiReq(...args);
// Tab names
this.tabNames = TabNames;

this.tabView = this.commonData.checkTabViewLocation();
this.tab = this.commonData.checkTabLocation();

// This object represents the number of visualizations per tab; used to show a progress bar
this.tabVisualizations.assign('overview');

this.currentOverviewSectionProps = {
switchTab: (tab, force) => this.switchTab(tab, force),
currentTab: this.tab
};
}

/**
* On controller loads
*/
async $onInit() {
this.rawVisualizations.setType('');
this.wodlesConfiguration = false;

this.TabDescription = WAZUH_MODULES;
this.$rootScope.reportStatus = false;

Expand All @@ -82,16 +95,6 @@ export class OverviewController {

this.wzMonitoringEnabled = false;

// Tab names
this.tabNames = TabNames;

this.tabView = this.commonData.checkTabViewLocation();
this.tab = this.commonData.checkTabLocation();

// This object represents the number of visualizations per tab; used to show a progress bar
this.tabVisualizations.assign('overview');

this.wodlesConfiguration = null;

this.init();

Expand All @@ -109,11 +112,6 @@ export class OverviewController {
switchTab: tab => this.switchTab(tab),
};

this.currentOverviewSectionProps = {
switchTab: (tab, force) => this.switchTab(tab, force),
currentTab: this.tab,
};

this.agentsSelectionProps = {
tab: this.tab,
initialFilter: this.initialFilter,
Expand Down
2 changes: 0 additions & 2 deletions plugins/main/public/kibana-integrations/kibana-discover.js
Original file line number Diff line number Diff line change
Expand Up @@ -722,7 +722,6 @@ function discoverController(
// WAZUH query from search bar
discoverPendingUpdates.removeAll();
discoverPendingUpdates.addItem($scope.state.query, filterManager.filters);
$scope.fetch();
/////
$fetchObservable.next();
}
Expand Down Expand Up @@ -1118,7 +1117,6 @@ function discoverController(
evt.stopPropagation();
if ($scope.tabView === 'discover') {
$scope.rows = false;
$scope.fetch();
}
$scope.handleRefresh({
query: $scope.state.query
Expand Down
Loading