Skip to content

Commit

Permalink
[Infrastructure UI] Navigate to node detail page without refresh (#14…
Browse files Browse the repository at this point in the history
…5742)

Closes [#110219](#110219)

## Summary

This change fixes the forced page refresh when opening the node detail
from the inventory page.

This happened due to the property `href` rendering a native anchor tag
which interpreted the navigation to the detail view as a completely new
page, refreshing the whole Kibana view.

Spreading the properties returned by the
[useLinkProps](https://github.com/tonyghiani/kibana/blob/2b2843fc2704539b92425f7a7424274b6f2ea495/x-pack/plugins/observability/public/hooks/use_link_props.ts)
assure the button receives the `onClick` handler and properly navigate
to the detail without forcing a refresh.

## Testing

Navigate to `Inventory`-> `Click any available node` -> `"Open as page"
on top-right corner of the popover`




https://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani@elastic.co>
  • Loading branch information
tonyghiani and Marco Antonio Ghiani authored Nov 21, 2022
1 parent 98b171d commit 12b010c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ export const NodeContextPopover = ({
size="xs"
iconSide={'left'}
iconType={'popout'}
href={nodeDetailMenuItemLinkProps.href}
flush="both"
{...nodeDetailMenuItemLinkProps}
>
<FormattedMessage
id="xpack.infra.infra.nodeDetails.openAsPage"
Expand Down

0 comments on commit 12b010c

Please sign in to comment.