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 pinned agent is not persisted on refreshing page #6790

Merged
merged 3 commits into from
Jun 25, 2024
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
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ All notable changes to the Wazuh app project will be documented in this file.
- Improve margins and paddings in the Events, Inventory and Control tabs [#6708](https:/wazuh/wazuh-dashboard-plugins/pull/6708)
- Refactored the search bar to correctly handle fixed and user-added filters [#6716](https:/wazuh/wazuh-dashboard-plugins/pull/6716) [#6755](https:/wazuh/wazuh-dashboard-plugins/pull/6755)
- Generate URL with predefined filters [#6745](https:/wazuh/wazuh-dashboard-plugins/pull/6745)
- Migrated AngularJS routing to ReactJS [#6689](https:/wazuh/wazuh-dashboard-plugins/pull/6689)
- Migrated AngularJS routing to ReactJS [#6689](https:/wazuh/wazuh-dashboard-plugins/pull/6689) [#6790](https:/wazuh/wazuh-dashboard-plugins/pull/6790)
- Improvement of the filter management system by implementing new standard modules [#6534](https:/wazuh/wazuh-dashboard-plugins/pull/6534) [#6772](https:/wazuh/wazuh-dashboard-plugins/pull/6772)

### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ export class PinnedAgentManager {
const includesAgentViewURL = this.navigationService
.getPathname()
.includes(this.AGENT_VIEW_URL);
this.navigationService
.getParams()
.set(
includesAgentViewURL
? PinnedAgentManager.AGENT_ID_VIEW_KEY
: PinnedAgentManager.AGENT_ID_URL_VIEW_KEY,
String(agentData?.id),
);
this.navigationService.renewURL(this.navigationService.getParams());

const urlSearchParams = this.navigationService.getParams();

urlSearchParams.set(
includesAgentViewURL
? PinnedAgentManager.AGENT_ID_VIEW_KEY
: PinnedAgentManager.AGENT_ID_URL_VIEW_KEY,
String(agentData?.id),
);
this.navigationService.renewURL(urlSearchParams);
}

unPinAgent(): void {
Expand Down
Loading