From e99e01ce92583de10dbcc8e0fafebb7e350c87b5 Mon Sep 17 00:00:00 2001 From: "opensearch-trigger-bot[bot]" <98922864+opensearch-trigger-bot[bot]@users.noreply.github.com> Date: Tue, 10 Sep 2024 00:30:21 +0530 Subject: [PATCH] Pass through remaining location arguments when updating the url query params (#1149) (#1150) * pass remaining state when updating url * updated release notes * updated state passing --------- (cherry picked from commit b364f1922a805dac775c799cc71125780c0974b3) Signed-off-by: Amardeepsingh Siglani Signed-off-by: github-actions[bot] Co-authored-by: github-actions[bot] --- public/pages/Main/Main.tsx | 10 +++++++--- ...rity-analytics-dashboards.release-notes-2.17.0.0.md | 2 ++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/pages/Main/Main.tsx b/public/pages/Main/Main.tsx index 463aa64f..e3a548dc 100644 --- a/public/pages/Main/Main.tsx +++ b/public/pages/Main/Main.tsx @@ -212,9 +212,13 @@ export default class Main extends Component { if (pathnameChanged || this.state.selectedDataSource.id !== prevState.selectedDataSource.id) { const searchParams = new URLSearchParams(this.props.location.search); searchParams.set('dataSourceId', this.state.selectedDataSource.id); - this.props.history.replace({ - search: searchParams.toString(), - }); + this.props.history.replace( + { + ...this.props.location, + search: searchParams.toString(), + }, + this.props.location.state + ); } if (pathnameChanged) { diff --git a/release-notes/opensearch-security-analytics-dashboards.release-notes-2.17.0.0.md b/release-notes/opensearch-security-analytics-dashboards.release-notes-2.17.0.0.md index a69a531a..3de47ba8 100644 --- a/release-notes/opensearch-security-analytics-dashboards.release-notes-2.17.0.0.md +++ b/release-notes/opensearch-security-analytics-dashboards.release-notes-2.17.0.0.md @@ -22,6 +22,8 @@ Compatible with OpenSearch Dashboards 2.17.0 * Bug fixes PageHeader and SideNav ([#1123](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1123)) * Added check for multi data source support when rendering threat alerts card in all use case workspace ([#1132](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1132)) * Made import more specific to avoid importing incorrect modules ([#1136](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1136)) +* remove import causing error ([#1144](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1144)) +* Passthrough URL state and other params when updating search query ([#1148](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1148)) ### Documentation * Added v2.17 release notes. ([#1141](https://github.com/opensearch-project/security-analytics-dashboards-plugin/pull/1141)) \ No newline at end of file