-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
fix(Dashboard): Support "Edit chart" click on a new window #28054
Conversation
/testenv up |
@geido Ephemeral environment spinning up at http://52.37.25.121:8080. Credentials are |
@@ -590,7 +591,12 @@ const SliceHeaderControls = (props: SliceHeaderControlsPropsWithRouter) => { | |||
case MenuKeys.ExploreChart: | |||
// eslint-disable-next-line no-unused-expressions | |||
props.logExploreChart?.(props.slice.slice_id); | |||
window.open(props.exploreUrl); | |||
if (domEvent.metaKey || domEvent.ctrlKey) { |
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.
A few questions here:
- Are we sure this works for mac and PC browsers as expected? Seems like it should, but ¯\_(ツ)_/¯
- Do we need tests to prevent this regressing again?
- Is there a reason we can't just use an HTML link here? I feel like we had that solved at one point.
- Is it not amazing that this particular link has been the subject of like 20 PRs and Issues?
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.
- Yes it should
- Let me see what kind of tests I can add here
- We now enable dropdown navigation for accessibility by controlling onClick handlers
- Tests should hopefully fix this
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 will add the unit tests in a follow-up PR to unblock this bug fix
Ephemeral environment shutdown and build artifacts deleted. |
(cherry picked from commit 89da4f8)
(cherry picked from commit 89da4f8)
SUMMARY
This PR #26138 removed the link from the "Edit chart" menu item on dashboards to enhance accessibility but it caused the chart to open in a new window. The goal of this PR is to support opening the chart in the same window by default while still allowing for opening a chart in a separate window with
cmd + click
.It also removes an
onBlur
handler that was causing the interruption of some menu item actions by closing the dropdown abruptly.BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N.A.
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION