mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 11:05:39 -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.
|
* 2.0.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import React, { useEffect } from 'react';
|
import React, { useEffect, useLayoutEffect } from 'react';
|
||||||
import { useParams, Redirect, Switch } from 'react-router-dom';
|
import { useParams, Redirect, Switch } from 'react-router-dom';
|
||||||
|
|
||||||
import { useValues, useActions } from 'kea';
|
import { useValues, useActions } from 'kea';
|
||||||
|
@ -48,9 +48,16 @@ export const EngineView: React.FC = () => {
|
||||||
}>();
|
}>();
|
||||||
const { renderHeaderActions } = useValues(KibanaLogic);
|
const { renderHeaderActions } = useValues(KibanaLogic);
|
||||||
|
|
||||||
|
useLayoutEffect(() => {
|
||||||
|
renderHeaderActions(EngineHeaderDocsAction);
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
renderHeaderActions();
|
||||||
|
};
|
||||||
|
}, []);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchEngine({ engineName });
|
fetchEngine({ engineName });
|
||||||
renderHeaderActions(EngineHeaderDocsAction);
|
|
||||||
}, [engineName]);
|
}, [engineName]);
|
||||||
|
|
||||||
if (fetchEngineApiStatus === Status.ERROR) {
|
if (fetchEngineApiStatus === Status.ERROR) {
|
||||||
|
|
|
@ -100,7 +100,9 @@ export const renderApp = (
|
||||||
productAccess,
|
productAccess,
|
||||||
productFeatures,
|
productFeatures,
|
||||||
renderHeaderActions: (HeaderActions) =>
|
renderHeaderActions: (HeaderActions) =>
|
||||||
params.setHeaderActionMenu((el) => renderHeaderActions(HeaderActions, store, el)),
|
params.setHeaderActionMenu(
|
||||||
|
HeaderActions ? renderHeaderActions.bind(null, HeaderActions, store) : undefined
|
||||||
|
),
|
||||||
security,
|
security,
|
||||||
setBreadcrumbs: chrome.setBreadcrumbs,
|
setBreadcrumbs: chrome.setBreadcrumbs,
|
||||||
setChromeIsVisible: chrome.setIsVisible,
|
setChromeIsVisible: chrome.setIsVisible,
|
||||||
|
|
|
@ -45,7 +45,7 @@ interface KibanaLogicProps {
|
||||||
navigateToUrl: RequiredFieldsOnly<ApplicationStart['navigateToUrl']>;
|
navigateToUrl: RequiredFieldsOnly<ApplicationStart['navigateToUrl']>;
|
||||||
productAccess: ProductAccess;
|
productAccess: ProductAccess;
|
||||||
productFeatures: ProductFeatures;
|
productFeatures: ProductFeatures;
|
||||||
renderHeaderActions(HeaderActions: FC): void;
|
renderHeaderActions(HeaderActions?: FC): void;
|
||||||
security: SecurityPluginStart;
|
security: SecurityPluginStart;
|
||||||
setBreadcrumbs(crumbs: ChromeBreadcrumb[]): void;
|
setBreadcrumbs(crumbs: ChromeBreadcrumb[]): void;
|
||||||
setChromeIsVisible(isVisible: boolean): void;
|
setChromeIsVisible(isVisible: boolean): void;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue