Skip to content

Commit

Permalink
[Backport 4.5-7.10]Remove unnecessary dashboard queries (#5453) (#5504)
Browse files Browse the repository at this point in the history
Remove unnecessary dashboard queries (#5453)

* change ng-show to ng-if

* Add verification that it is the welcome

* Add changelog

* Update changelog

(cherry picked from commit 7d409b0)

Co-authored-by: Álex Ruiz <alejandro.ruiz.becerra@wazuh.com>
  • Loading branch information
yenienserrano and AlexRuiz7 authored May 29, 2023
1 parent d421c9d commit c53b2cb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ All notable changes to the Wazuh app project will be documented in this file.
### Removed

- Removed deprecated request and code in agent's view [#5451](https://github.com/wazuh/wazuh-kibana-app/pull/5451)
- Removed unnecessary dashboard queries caused by the deploy agent view. [#5453](https://github.com/wazuh/wazuh-kibana-app/pull/5453)

## Wazuh v4.4.3 - Kibana 7.10.2, 7.16.x, 7.17.x - Revision 01

Expand Down
5 changes: 2 additions & 3 deletions public/controllers/agent/agents-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export class AgentsPreviewController {
this.wazuhConfig = new WazuhConfig();
this.errorInit = false;
this.$window = $window;
this.addingNewAgent = false;
}

/**
Expand Down Expand Up @@ -100,9 +101,7 @@ export class AgentsPreviewController {
updateSummary: (summary) => {
this.summary = summary;
if (this.summary.total === 0) {
if (this.addingNewAgent === undefined) {
this.addNewAgent(true);
}
this.addNewAgent(true);
this.hasAgents = false;
} else {
this.hasAgents = true;
Expand Down
4 changes: 2 additions & 2 deletions public/controllers/overview/overview.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export class OverviewController {
}
};
setTimeout(() => { this.$location.search('agentId', store.getState().appStateReducers.currentAgentData.id ? String(store.getState().appStateReducers.currentAgentData.id) : null) }, 1);

this.visualizeProps["isAgent"] = agentList ? agentList[0] : false;
this.$rootScope.$applyAsync();
}catch(error){
Expand Down Expand Up @@ -283,7 +283,7 @@ export class OverviewController {
timefilter.setRefreshInterval(this.commonData.getRefreshInterval());
}

if (typeof this.agentsCount === 'undefined') {
if (typeof this.agentsCount === 'undefined' && newTab === 'welcome') {
await this.getSummary();
}

Expand Down
4 changes: 2 additions & 2 deletions public/templates/visualize/dashboards.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div ng-controller="agentsPreviewController as actrl">
<div ng-init="actrl.addNewAgent(false)" ng-show="actrl.addingNewAgent">
<div ng-init="actrl.addNewAgent(false)" ng-if="actrl.addingNewAgent">
<react-component name="RegisterAgent" props="actrl.registerAgentsProps"></react-component>
</div>
<div ng-show="!actrl.addingNewAgent">
<div ng-if="!actrl.addingNewAgent">
<div ng-controller="overviewController as octrl">
<!-- Navigation section -->
<div ng-show="octrl.tab && octrl.tab !== 'welcome'">
Expand Down

0 comments on commit c53b2cb

Please sign in to comment.