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 error navigating back to agent #6224

Merged
merged 2 commits into from
Dec 15, 2023
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 @@ -14,6 +14,7 @@ All notable changes to the Wazuh app project will be documented in this file.

- Fixed Agents preview page load when there are no registered agents [#6185](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6185)
- Fixed the endpoint to get Wazuh server auth configuration [#6206](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6206) [#6213](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6213)
- Fixed error navigating back to agent in some scenarios [#6224](https://github.com/wazuh/wazuh-dashboard-plugins/pull/6224)

## Wazuh v4.7.1 - OpenSearch Dashboards 2.8.0 - Revision 01

Expand Down
21 changes: 15 additions & 6 deletions plugins/main/public/controllers/agent/components/agents-preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {
agentStatusColorByAgentStatus,
agentStatusLabelByAgentStatus,
} from '../../../../common/services/wz_agent_status';
import { AppNavigate } from '../../../react-services/app-navigate.js';

export const AgentsPreview = compose(
withErrorBoundary,
Expand Down Expand Up @@ -319,10 +320,13 @@ export const AgentsPreview = compose(
content='View agent details'
>
<EuiLink
onClick={() =>
this.showAgent(
this.state.lastRegisteredAgent,
)
onClick={ev => {
ev.stopPropagation();
AppNavigate.navigateToModule(ev, 'agents', {
tab: 'welcome',
agent: this.state.lastRegisteredAgent?.id,
});
}
}
>
{this.state.lastRegisteredAgent?.name || '-'}
Expand All @@ -349,8 +353,13 @@ export const AgentsPreview = compose(
content='View agent details'
>
<EuiLink
onClick={() =>
this.showAgent(this.state.agentMostActive)
onClick={ev => {
ev.stopPropagation();
AppNavigate.navigateToModule(ev, 'agents', {
tab: 'welcome',
agent: this.state.agentMostActive?.id,
});
}
}
>
{this.state.agentMostActive?.name || '-'}
Expand Down
Loading