mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Lens] Fix missing embeddable panel titles (#203355)
## Summary When using the new Custom Lens embeddable component, the titles are hidden by default due to to a regression introduced in https://github.com/elastic/kibana/pull/186642. This PR should fix the correct title handling of the header visibility by hiding or showing the wrapping Panel title depending on the `hidePanelTitles` props of the `LensRenderer` component fix https://github.com/elastic/kibana/issues/203354
This commit is contained in:
parent
101e797e9d
commit
6e57a23d18
1 changed files with 4 additions and 2 deletions
|
@ -59,6 +59,7 @@ export function LensRenderer({
|
|||
filters,
|
||||
timeRange,
|
||||
disabledActions,
|
||||
hidePanelTitles,
|
||||
...props
|
||||
}: LensRendererProps) {
|
||||
// Use the settings interface to store panel settings
|
||||
|
@ -71,6 +72,7 @@ export function LensRenderer({
|
|||
}, []);
|
||||
const disabledActionIds$ = useObservableVariable(disabledActions);
|
||||
const viewMode$ = useObservableVariable(viewMode);
|
||||
const hidePanelTitles$ = useObservableVariable(hidePanelTitles);
|
||||
|
||||
// Lens API will be set once, but when set trigger a reflow to adopt the latest attributes
|
||||
const [lensApi, setLensApi] = useState<LensApi | undefined>(undefined);
|
||||
|
@ -112,7 +114,6 @@ export function LensRenderer({
|
|||
const panelProps: PanelProps = useMemo(() => {
|
||||
return {
|
||||
hideInspector: !showInspector,
|
||||
hideHeader: showPanelChrome,
|
||||
showNotifications: false,
|
||||
showShadow: false,
|
||||
showBadges: false,
|
||||
|
@ -124,7 +125,7 @@ export function LensRenderer({
|
|||
return (extraActions ?? []).concat(actions || []);
|
||||
},
|
||||
};
|
||||
}, [showInspector, showPanelChrome, withDefaultActions, extraActions, lensApi]);
|
||||
}, [showInspector, withDefaultActions, extraActions, lensApi]);
|
||||
|
||||
return (
|
||||
<ReactEmbeddableRenderer<LensSerializedState, LensRuntimeState, LensApi>
|
||||
|
@ -147,6 +148,7 @@ export function LensRenderer({
|
|||
...initialStateRef.current,
|
||||
attributes: props.attributes,
|
||||
}),
|
||||
hidePanelTitle: hidePanelTitles$,
|
||||
})}
|
||||
onApiAvailable={setLensApi}
|
||||
hidePanelChrome={!showPanelChrome}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue