mirror of
https://github.com/elastic/kibana.git
synced 2025-06-27 18:51:07 -04:00
[Search Application] Fix doc link in navigation toolbar (#158203)
- Fix the way of using setActionMenu. According their doc and source
code we need to call it twice, for moun and unmount.
- Fix redirection issue and using reactDom in rendering of action items
<img width="926" alt="image"
src="1e531299
-e055-4af1-8ec7-92511e1a6e81">
This commit is contained in:
parent
8e0123e984
commit
1b0a1ec30c
3 changed files with 13 additions and 4 deletions
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import React, { useEffect } from 'react';
|
||||
import React, { useEffect, useLayoutEffect } from 'react';
|
||||
import { useParams, Redirect, Switch } from 'react-router-dom';
|
||||
|
||||
import { useValues, useActions } from 'kea';
|
||||
|
@ -48,9 +48,16 @@ export const EngineView: React.FC = () => {
|
|||
}>();
|
||||
const { renderHeaderActions } = useValues(KibanaLogic);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
renderHeaderActions(EngineHeaderDocsAction);
|
||||
|
||||
return () => {
|
||||
renderHeaderActions();
|
||||
};
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
fetchEngine({ engineName });
|
||||
renderHeaderActions(EngineHeaderDocsAction);
|
||||
}, [engineName]);
|
||||
|
||||
if (fetchEngineApiStatus === Status.ERROR) {
|
||||
|
|
|
@ -100,7 +100,9 @@ export const renderApp = (
|
|||
productAccess,
|
||||
productFeatures,
|
||||
renderHeaderActions: (HeaderActions) =>
|
||||
params.setHeaderActionMenu((el) => renderHeaderActions(HeaderActions, store, el)),
|
||||
params.setHeaderActionMenu(
|
||||
HeaderActions ? renderHeaderActions.bind(null, HeaderActions, store) : undefined
|
||||
),
|
||||
security,
|
||||
setBreadcrumbs: chrome.setBreadcrumbs,
|
||||
setChromeIsVisible: chrome.setIsVisible,
|
||||
|
|
|
@ -45,7 +45,7 @@ interface KibanaLogicProps {
|
|||
navigateToUrl: RequiredFieldsOnly<ApplicationStart['navigateToUrl']>;
|
||||
productAccess: ProductAccess;
|
||||
productFeatures: ProductFeatures;
|
||||
renderHeaderActions(HeaderActions: FC): void;
|
||||
renderHeaderActions(HeaderActions?: FC): void;
|
||||
security: SecurityPluginStart;
|
||||
setBreadcrumbs(crumbs: ChromeBreadcrumb[]): void;
|
||||
setChromeIsVisible(isVisible: boolean): void;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue