[8.6] [Infrastructure UI] Navigate to node detail page without refresh (#145742) (#145841)

# Backport

This will backport the following commits from `main` to `8.6`:
- [[Infrastructure UI] Navigate to node detail page without refresh
(#145742)](https://github.com/elastic/kibana/pull/145742)

<!--- Backport version: 8.9.7 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)

<!--BACKPORT [{"author":{"name":"Marco Antonio
Ghiani","email":"marcoantonio.ghiani01@gmail.com"},"sourceCommit":{"committedDate":"2022-11-21T11:19:31Z","message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55","branchLabelMapping":{"^v8.7.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Feature:Metrics
UI","Team:Infra Monitoring
UI","release_note:skip","backport:all-open","v8.7.0"],"number":145742,"url":"https://github.com/elastic/kibana/pull/145742","mergeCommit":{"message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55"}},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[{"branch":"main","label":"v8.7.0","labelRegex":"^v8.7.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/145742","number":145742,"mergeCommit":{"message":"[Infrastructure
UI] Navigate to node detail page without refresh (#145742)\n\nCloses
[#110219](https://github.com/elastic/kibana/issues/110219)\r\n\r\n##
Summary\r\n\r\nThis change fixes the forced page refresh when opening
the node detail\r\nfrom the inventory page.\r\n\r\nThis happened due to
the property `href` rendering a native anchor tag\r\nwhich interpreted
the navigation to the detail view as a completely new\r\npage,
refreshing the whole Kibana view.\r\n\r\nSpreading the properties
returned by
the\r\n[useLinkProps](2b2843fc27/x-pack/plugins/observability/public/hooks/use_link_props.ts)\r\nassure
the button receives the `onClick` handler and properly navigate\r\nto
the detail without forcing a refresh.\r\n\r\n## Testing\r\n\r\nNavigate
to `Inventory`-> `Click any available node` -> `\"Open as page\"\r\non
top-right corner of the
popover`\r\n\r\n\r\n\r\n\r\nhttps://user-images.githubusercontent.com/34506779/202741947-d809327b-4e1c-4e38-a0ac-cab768d299c2.mov\r\n\r\nCo-authored-by:
Marco Antonio Ghiani
<marcoantonio.ghiani@elastic.co>","sha":"12b010ce22f6221dfb43adfa83e7e49ecce89a55"}}]}]
BACKPORT-->

Co-authored-by: Marco Antonio Ghiani <marcoantonio.ghiani01@gmail.com>
This commit is contained in:
Kibana Machine 2022-11-21 07:27:14 -05:00 committed by GitHub
parent 9a7e9368eb
commit 8d29d1d65a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"