-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[Drilldowns] improve action.getHref() for drilldowns #63228
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
Conversation
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
|
@elasticmachine merge upstream |
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.
Please see comment below, currently on Cmd + Click it navigates the current tab.
Otherwise LGTM, checked on Mac/Chrome.
| menuPanelItem.onClick = () => { | ||
| action.execute(actionContext); | ||
| menuPanelItem.onClick = event => { | ||
| if (event.target instanceof HTMLAnchorElement) { |
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.
Maybe this check could be the same as on line 135. I'm thinking of he case where tag might be <a> but action.getHref is not defined.
| if (event.target instanceof HTMLAnchorElement) { | |
| if (action.getHref) { |
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've actually checked this locally, current behavior is that if you Cmd + Click it does two things: (1) navigates in current tab; (2) opens a new tab. Whereas it should just open a new tab.
The above change actually fixes it—not sure what is happening there but event.target does not seem to be <a>.
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.
Oh.. thanks! used "wrong" target. So it depended on where you clicked and not on what element handled the event. Should be good now
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
getHref on Action interfaces in uiActions plugin is now async. getHref is now used only to support right click behaviour. execute() takes control on regular click.
getHref on Action interfaces in uiActions plugin is now async. getHref is now used only to support right click behaviour. execute() takes control on regular click.
Summary
getHrefasyncto be able to useurlGeneratorinsideDev Docs
getHrefonActioninterfaces in uiActions plugin is now async.getHrefis now used only to support right click behaviour.execute()takes control on regular click.Checklist
Delete any items that are not applicable to this PR.
For maintainers