Skip to content

Commit

Permalink
Pass through remaining location arguments when updating the url query…
Browse files Browse the repository at this point in the history
… params (#1149) (#1150)

* pass remaining state when updating url



* updated release notes



* updated state passing



---------


(cherry picked from commit b364f19)

Signed-off-by: Amardeepsingh Siglani <amardeep7194@gmail.com>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 2385147 commit e99e01c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
10 changes: 7 additions & 3 deletions public/pages/Main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,9 +212,13 @@ export default class Main extends Component<MainProps, MainState> {
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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))

0 comments on commit e99e01c

Please sign in to comment.