-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
BrowseDashboards: Add subpath to URLs on Browse Dashboards page #84992
BrowseDashboards: Add subpath to URLs on Browse Dashboards page #84992
Conversation
Hi @butkovv - I believe that this problem is there (unfortunately it's fairly common - we need a better way to solve this), but I'm having trouble reproducing and would appreciate some tips for reproducing:
A screen recording would help. I've tried to follow reproduction in #74275 but wasn't able to reproduce |
Hmm. I can reproduce this in 10.1.5, but not in 10.2.0. We've made a lot of improvements to how folders and breadcrumbs work during this period, so it's hard to know what exactly fixed it. |
Yeah, sorry about that, kinda mislead by mentioning that issue because I thought it wasn't also fixed yet. There's another issue related to when you open a dashboard that is in nested directory while serving Grafana from subpath. See the attached video for reproduction on Grafana v11.0.0-pre. Screen.recording.2024-03-22.17.42.08.mov |
Ahhh. I think the issue here is actually because you're serving it from the subpath of See how I get But the leading subpath is missing here: I've been talking with @ashharrison90 about this, and I think we might want to solve this in another way. I'll leave this PR open in the meantime, but I will investigate another approach. |
Okay - spent some time digging into this, and I think merging this one is the best approach so far. I'll give this a proper test tomorrow with the aim of merging it for Grafana 11 👍 |
This PR must be merged before a backport PR will be created. |
a4f5927
to
e66b4f8
Compare
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.
Thank you for your patience on this 👍
For context:
- we often have this issue as most of us don't develop, or use grafana, with the subpath option
- we've been talking about more automatic subprefixing for URLs, but turns out we already have then (when using react-router-dom Links with basename, which this does with)
- BUT, it appears there's a bug or incomaptibility with react-router where it doesn't prefix the subpath if your subpath is the same as a route (such as your
dashboards
) - SO, the easiest thing to do here is just to prefix the subpath manually here, like they are in search results and dashboards
I also pushed up a minor change to use the already imported config
object from @grafana/runtime
- they're both the same object. And added a very brief comment explaining this.
Again, thanks for your patience and contribution 👍
* BrowseDashboards: Add subpath to URLs on Browse Dashboards page * comment * use existing config * comment --------- Co-authored-by: joshhunt <josh@trtr.co> (cherry picked from commit b039995)
…page (#85354) BrowseDashboards: Add subpath to URLs on Browse Dashboards page (#84992) * BrowseDashboards: Add subpath to URLs on Browse Dashboards page * comment * use existing config * comment --------- Co-authored-by: joshhunt <josh@trtr.co> (cherry picked from commit b039995) Co-authored-by: butkovv <52626407+butkovv@users.noreply.github.com>
Fixes #74275