Skip to content

Commit

Permalink
Encode searchId as it tends to be decoded after adds into url (#8530)
Browse files Browse the repository at this point in the history
* Encode searchId as it tends to be decoded after adds into url

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>

* Changeset file for PR #8530 created/updated

* Changeset file for PR #8530 created/updated

---------

Signed-off-by: Yuanqi(Ella) Zhu <[email protected]>
Co-authored-by: opensearch-changeset-bot[bot] <154024398+opensearch-changeset-bot[bot]@users.noreply.github.com>
  • Loading branch information
zhyuanqi and opensearch-changeset-bot[bot] authored Oct 9, 2024
1 parent 0609ecf commit 9eae148
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/8530.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fix:
- Encode searchId as it tends to be decoded after adds into url. ([#8530](https://github.com/opensearch-project/OpenSearch-Dashboards/pull/8530))
1 change: 1 addition & 0 deletions src/plugins/visualizations/public/wizard/new_vis_modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ class NewVisModal extends React.Component<TypeSelectionProps, TypeSelectionState
}

params = [`type=${encodeURIComponent(visType.name)}`];
searchId = encodeURIComponent(searchId || '');

if (searchType) {
params.push(`${searchType === 'search' ? 'savedSearchId' : 'indexPattern'}=${searchId}`);
Expand Down

0 comments on commit 9eae148

Please sign in to comment.