Skip to content

Commit

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

* Encode searchId as it tends to be decoded after adds into url

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

* Changeset file for PR opensearch-project#8530 created/updated

* Changeset file for PR opensearch-project#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
2 people authored and LDrago27 committed Oct 11, 2024
1 parent 0609ecf commit 4458935
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 4458935

Please sign in to comment.