Skip to content

Commit

Permalink
[8.12] [Search] Fix endpoints header persisting beyond search pages (#…
Browse files Browse the repository at this point in the history
…174627) (#174633)

# Backport

This will backport the following commits from `main` to `8.12`:
- [[Search] Fix endpoints header persisting beyond search pages
(#174627)](#174627)

<!--- Backport version: 9.4.3 -->

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

<!--BACKPORT [{"author":{"name":"Sander
Philipse","email":"94373878+sphilipse@users.noreply.github.com"},"sourceCommit":{"committedDate":"2024-01-10T16:07:05Z","message":"[Search]
Fix endpoints header persisting beyond search pages (#174627)\n\n##
Summary\r\n\r\nUnmounting the header action was failing in some cases
and throwing\r\nconsole errors in all cases. This caused the header
component to persist\r\nonto pages where it shouldn't be. Instead of
explicitly unmounting,\r\nwhich should be done by the parent component
of our non-root element, we\r\nrender an empty element on unmount, which
removes the header action in\r\nall unmount
cases.","sha":"143c521b3f4fc46cef96ad32c738fcf73c0c3ff4","branchLabelMapping":{"^v8.13.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:EnterpriseSearch","v8.12.0","v8.13.0"],"title":"[Search]
Fix endpoints header persisting beyond search
pages","number":174627,"url":"#174627
Fix endpoints header persisting beyond search pages (#174627)\n\n##
Summary\r\n\r\nUnmounting the header action was failing in some cases
and throwing\r\nconsole errors in all cases. This caused the header
component to persist\r\nonto pages where it shouldn't be. Instead of
explicitly unmounting,\r\nwhich should be done by the parent component
of our non-root element, we\r\nrender an empty element on unmount, which
removes the header action in\r\nall unmount
cases.","sha":"143c521b3f4fc46cef96ad32c738fcf73c0c3ff4"}},"sourceBranch":"main","suggestedTargetBranches":["8.12"],"targetPullRequestStates":[{"branch":"8.12","label":"v8.12.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"main","label":"v8.13.0","branchLabelMappingKey":"^v8.13.0$","isSourceBranch":true,"state":"MERGED","url":"#174627
Fix endpoints header persisting beyond search pages (#174627)\n\n##
Summary\r\n\r\nUnmounting the header action was failing in some cases
and throwing\r\nconsole errors in all cases. This caused the header
component to persist\r\nonto pages where it shouldn't be. Instead of
explicitly unmounting,\r\nwhich should be done by the parent component
of our non-root element, we\r\nrender an empty element on unmount, which
removes the header action in\r\nall unmount
cases.","sha":"143c521b3f4fc46cef96ad32c738fcf73c0c3ff4"}}]}]
BACKPORT-->

Co-authored-by: Sander Philipse <94373878+sphilipse@users.noreply.github.com>
  • Loading branch information
kibanamachine and sphilipse committed Jan 10, 2024
1 parent c469bfd commit 3848d3c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -199,5 +199,5 @@ export const renderHeaderActions = (
</I18nProvider>,
kibanaHeaderEl
);
return () => ReactDOM.unmountComponentAtNode(kibanaHeaderEl);
return () => ReactDOM.render(<></>, kibanaHeaderEl);
};
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export const EnterpriseSearchPageTemplateWrapper: React.FC<PageTemplateProps> =
renderHeaderActions(EndpointsHeaderAction);
}
return () => {
renderHeaderActions();
renderHeaderActions(undefined);
};
}, []);
return (
Expand Down

0 comments on commit 3848d3c

Please sign in to comment.