Skip to content

Commit

Permalink
[Lens] Fixes partition legend visibility (#130090) (#130169)
Browse files Browse the repository at this point in the history
(cherry picked from commit 405a9cf)

Co-authored-by: Stratoula Kalafateli <[email protected]>
  • Loading branch information
kibanamachine and stratoula authored Apr 13, 2022
1 parent bb00a98 commit 4cae03e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,8 @@ const PartitionVisComponent = (props: PartitionVisComponentProps) => {

useEffect(() => {
const legendShow = showLegendDefault();
const showLegendDef = shouldShowLegend(visType, visParams.legendDisplay, bucketColumns);
if (showLegendDef !== legendShow) {
setShowLegend(legendShow);
props.uiState?.set('vis.legendOpen', legendShow);
}
}, [showLegendDefault, props.uiState, visParams.legendDisplay, visType, bucketColumns]);
setShowLegend(legendShow);
}, [showLegendDefault]);

const onRenderChange = useCallback<RenderChangeListener>(
(isRendered) => {
Expand Down
4 changes: 2 additions & 2 deletions src/plugins/vis_types/pie/public/editor/components/pie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ const PieOptions = (props: PieOptionsProps) => {
);

useEffect(() => {
setLegendVisibility(legendUiStateValue);
}, [legendUiStateValue]);
setLegendVisibility(legendUiStateValue ?? stateParams.legendDisplay === LegendDisplay.SHOW);
}, [legendUiStateValue, stateParams.legendDisplay]);

useEffect(() => {
const fetchPalettes = async () => {
Expand Down

0 comments on commit 4cae03e

Please sign in to comment.