-
Notifications
You must be signed in to change notification settings - Fork 894
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
[Chore] Visualize link fix #2395
Merged
joshuarrrr
merged 4 commits into
opensearch-project:main
from
BSFishy:visualize_link_fix
Oct 4, 2022
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
1cc7931
Fix links in visualize plugin
BSFishy 6858690
Merge branch 'opensearch-project:main' into visualize_link_fix
BSFishy 7ec7c5c
Fix links to other apps
BSFishy 7a29f5c
Merge branch 'visualize_link_fix' of github.com:BSFishy/OpenSearch-Da…
BSFishy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BSFishy I really like the direction you've gone with this, but unfortunately it's not sufficient to hardcode the
#
prefix to theeditUrl
. The reason that works for thewizard
plugin is that we define#/
as thealiasPath
here: https://github.com/opensearch-project/OpenSearch-Dashboards/blob/main/src/plugins/wizard/public/plugin.ts#L117 . This may cause regressions for aliased visualizations with otheraliasPaths
.My suspicion is that we may need to adjust the way
editUrl
is fetched for aliased visualizations upstream of this component so that it correctly accounts for thealiasPath
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just did a bit of digging, and I think this should work fine. The reason that it works with the
wizard
plugin is because it defines its own application, causing it to callgetUrlForApp
. Otherwise, it will follow the same functionality that was done bynavigateToUrl
. In that function, a call was made tohistory.push
, which is implemented in thehistory
package. In that package, they simply prepend a#
to the beginning of the path:https://github.com/remix-run/history/blob/3e9dab413f4eda8d6bce565388c5ddb7aeff9f7e/packages/history/index.ts#L693
I can still have it get the url upstream of this component, though, like the
DashboardListing
component does, however in that component, thegetViewUrl
function is a property, which I think would be a breaking change.OpenSearch-Dashboards/src/plugins/dashboard/public/application/listing/dashboard_listing.js
Lines 173 to 177 in 48fe60b
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, thanks for digging into the
history
implementation, that makes sense.