From fc1840a131da58c9f4ee446b7742cf9a7c8fb35d Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 14 Oct 2022 13:42:24 +0300 Subject: [PATCH 1/4] [Lens][Visualize] Disable cursor sync on dashboard level option --- docs/user/dashboard/dashboard.asciidoc | 2 ++ .../heatmap_function.test.ts.snap | 1 + .../expression_functions/heatmap_function.ts | 1 + .../common/types/expression_functions.ts | 1 + .../common/types/expression_renderers.ts | 1 + .../components/heatmap_component.test.tsx | 1 + .../public/components/heatmap_component.tsx | 3 ++- .../expression_renderers/heatmap_renderer.tsx | 1 + .../layered_xy_vis.test.ts | 1 + .../expression_functions/layered_xy_vis_fn.ts | 1 + .../expression_functions/xy_vis.test.ts | 2 ++ .../common/expression_functions/xy_vis_fn.ts | 1 + .../common/types/expression_renderers.ts | 1 + .../public/components/xy_chart.test.tsx | 1 + .../public/components/xy_chart.tsx | 4 +++- .../xy_chart_renderer.tsx | 1 + .../public/helpers/interval.test.ts | 7 +++++- .../embeddable/dashboard_container.tsx | 3 +++ .../dashboard_container_factory.tsx | 1 + .../lib/diff_dashboard_state.test.ts | 3 +++ .../state/dashboard_state_slice.ts | 4 ++++ .../application/top_nav/dashboard_top_nav.tsx | 5 +++++ .../public/application/top_nav/options.tsx | 22 +++++++++++++++++++ .../top_nav/show_options_popover.tsx | 6 +++++ .../top_nav/show_share_modal.test.tsx | 1 + .../dashboard/public/dashboard_constants.ts | 1 + src/plugins/dashboard/public/types.ts | 2 ++ src/plugins/embeddable/common/types.ts | 5 +++++ .../embeddables/diff_embeddable_input.test.ts | 2 ++ .../lib/embeddables/diff_embeddable_input.ts | 2 ++ .../embeddable/public/store/input_slice.ts | 3 +++ .../expressions/common/execution/execution.ts | 1 + .../expressions/common/execution/types.ts | 5 +++++ .../common/expression_renderers/types.ts | 2 ++ .../common/service/expressions_services.ts | 2 ++ src/plugins/expressions/public/loader.ts | 3 +++ .../use_expression_renderer.ts | 1 + src/plugins/expressions/public/render.ts | 5 +++++ src/plugins/expressions/public/types/index.ts | 1 + .../public/__stories__/render.tsx | 1 + .../components/timelion_vis_component.tsx | 4 +++- .../timelion/public/timelion_vis_fn.ts | 3 +++ .../timelion/public/timelion_vis_renderer.tsx | 3 ++- .../components/timeseries_visualization.tsx | 3 +++ .../application/components/vis_types/index.ts | 1 + .../components/vis_types/timeseries/vis.js | 2 ++ .../visualizations/views/timeseries/index.js | 3 ++- .../vis_types/timeseries/public/metrics_fn.ts | 4 ++++ .../public/timeseries_vis_renderer.tsx | 10 ++++++++- .../embeddable/visualize_embeddable.tsx | 8 +++++++ .../renderers/__stories__/render.tsx | 1 + .../canvas/public/lib/create_handlers.ts | 1 + .../lens/public/embeddable/embeddable.tsx | 1 + .../public/embeddable/expression_wrapper.tsx | 3 +++ 54 files changed, 151 insertions(+), 7 deletions(-) diff --git a/docs/user/dashboard/dashboard.asciidoc b/docs/user/dashboard/dashboard.asciidoc index e0e469c0d7d11..c59d2a612f2da 100644 --- a/docs/user/dashboard/dashboard.asciidoc +++ b/docs/user/dashboard/dashboard.asciidoc @@ -337,6 +337,8 @@ Apply a set of design options to the entire dashboard. * *Sync color pallettes across panels* — Applies the same color palette to all panels on the dashboard. +* *Sync cursor across panels* — When you hover your cursor over a *Lens*, *TSVB*, aggregation-based, or *Timelion* XY chart and a heatmap chart, the cursor on all other related dashboard charts automatically appear. + * *Sync tooltips across panels* — When you hover your cursor over a *Lens*, *TSVB*, aggregation-based, or *Timelion* XY chart, the tooltips on all other related dashboard charts automatically appear. [float] diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap index 8e84b2c8e22a8..8a05891f2886b 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap @@ -102,6 +102,7 @@ Object { "type": "datatable", }, "syncTooltips": false, + "syncCursor": true, }, } `; diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts index 76ea0f30ac26b..548d4ec0ab49e 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/heatmap_function.ts @@ -231,6 +231,7 @@ export const heatmapFunction = (): HeatmapExpressionFunctionDefinition => ({ handlers.getExecutionContext?.()?.description, }, syncTooltips: handlers?.isSyncTooltipsEnabled?.() ?? false, + syncCursor: handlers?.isSyncCursorEnabled?.() ?? true, }, }; }, diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts index c3db9e34394a3..5aa1507f30b03 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_functions.ts @@ -93,6 +93,7 @@ export interface HeatmapExpressionProps { data: Datatable; args: HeatmapArguments; syncTooltips: boolean; + syncCursor: boolean; } export interface HeatmapRender { diff --git a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts index c8763903a3927..b59a8ee2c5166 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_heatmap/common/types/expression_renderers.ts @@ -39,5 +39,6 @@ export type HeatmapRenderProps = HeatmapExpressionProps & { uiState: PersistedState; interactive: boolean; syncTooltips: boolean; + syncCursor: boolean; renderComplete: IInterpreterRenderHandlers['done']; }; diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx index fa4b58dd89deb..4720e9025d63d 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.test.tsx @@ -125,6 +125,7 @@ describe('HeatmapComponent', function () { formatFactory: formatService.deserialize, interactive: true, syncTooltips: false, + syncCursor: true, renderComplete: jest.fn(), }; }); diff --git a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx index 64d7e4d03a46d..399d653e0b4b6 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/components/heatmap_component.tsx @@ -146,6 +146,7 @@ export const HeatmapComponent: FC = memo( uiState, interactive, syncTooltips, + syncCursor, renderComplete, }) => { const chartRef = useRef(null); @@ -576,7 +577,7 @@ export const HeatmapComponent: FC = memo( noResults={ } - onPointerUpdate={handleCursorUpdate} + onPointerUpdate={syncCursor ? handleCursorUpdate : undefined} externalPointerEvents={{ tooltip: { visible: syncTooltips }, }} diff --git a/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx b/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx index 744d5d49f9376..4b813fb93416f 100644 --- a/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx +++ b/src/plugins/chart_expressions/expression_heatmap/public/expression_renderers/heatmap_renderer.tsx @@ -90,6 +90,7 @@ export const heatmapRenderer: ( interactive={isInteractive()} chartsActiveCursorService={plugins.charts.activeCursor} syncTooltips={config.syncTooltips} + syncCursor={config.syncCursor} /> , diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis.test.ts index 4664902d13876..9f662678d6dea 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis.test.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis.test.ts @@ -28,6 +28,7 @@ describe('layeredXyVis', () => { args: { ...rest, layers: [sampleExtendedLayer] }, syncColors: false, syncTooltips: false, + syncCursor: true, }, }); }); diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis_fn.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis_fn.ts index 8dcc58cda01a8..2dfc5a8df2763 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis_fn.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/layered_xy_vis_fn.ts @@ -63,6 +63,7 @@ export const layeredXyVisFn: LayeredXyVisFn['fn'] = async (data, args, handlers) }, syncColors: handlers?.isSyncColorsEnabled?.() ?? false, syncTooltips: handlers?.isSyncTooltipsEnabled?.() ?? false, + syncCursor: handlers?.isSyncCursorEnabled?.() ?? true, }, }; }; diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts index 67c7ab8d1e294..c7b1016f6c0b6 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis.test.ts @@ -40,6 +40,7 @@ describe('xyVis', () => { }, syncColors: false, syncTooltips: false, + syncCursor: true, }, }); }); @@ -348,6 +349,7 @@ describe('xyVis', () => { }, syncColors: false, syncTooltips: false, + syncCursor: true, }, }); }); diff --git a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts index e29f1e5ffff3c..c6b9bf0d4d888 100644 --- a/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts +++ b/src/plugins/chart_expressions/expression_xy/common/expression_functions/xy_vis_fn.ts @@ -138,6 +138,7 @@ export const xyVisFn: XyVisFn['fn'] = async (data, args, handlers) => { }, syncColors: handlers?.isSyncColorsEnabled?.() ?? false, syncTooltips: handlers?.isSyncTooltipsEnabled?.() ?? false, + syncCursor: handlers?.isSyncCursorEnabled?.() ?? true, }, }; }; diff --git a/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts b/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts index de387b4113373..619008ef23304 100644 --- a/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts +++ b/src/plugins/chart_expressions/expression_xy/common/types/expression_renderers.ts @@ -17,6 +17,7 @@ import { XYProps } from './expression_functions'; export interface XYChartProps { args: XYProps; syncTooltips: boolean; + syncCursor: boolean; syncColors: boolean; } diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx index e7b109b65abcc..b6777d36c1d9e 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.test.tsx @@ -117,6 +117,7 @@ describe('XYChart component', () => { onSelectRange, syncColors: false, syncTooltips: false, + syncCursor: true, useLegacyTimeAxis: false, eventAnnotationService: eventAnnotationServiceMock, renderComplete: jest.fn(), diff --git a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx index 45eca06c670b0..675d737ee4f23 100644 --- a/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/components/xy_chart.tsx @@ -125,6 +125,7 @@ export type XYChartRenderProps = XYChartProps & { renderMode: RenderMode; syncColors: boolean; syncTooltips: boolean; + syncCursor: boolean; eventAnnotationService: EventAnnotationServiceType; renderComplete: () => void; uiState?: PersistedState; @@ -199,6 +200,7 @@ export function XYChart({ interactive = true, syncColors, syncTooltips, + syncCursor, useLegacyTimeAxis, renderComplete, uiState, @@ -753,7 +755,7 @@ export function XYChart({ /> } onRenderChange={onRenderChange} - onPointerUpdate={handleCursorUpdate} + onPointerUpdate={syncCursor ? handleCursorUpdate : undefined} externalPointerEvents={{ tooltip: { visible: syncTooltips, placement: Placement.Right }, }} diff --git a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx index 5606bad9050c7..9e28b8f3ff6c1 100644 --- a/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx +++ b/src/plugins/chart_expressions/expression_xy/public/expression_renderers/xy_chart_renderer.tsx @@ -228,6 +228,7 @@ export const getXyChartRenderer = ({ renderMode={handlers.getRenderMode()} syncColors={config.syncColors} syncTooltips={config.syncTooltips} + syncCursor={config.syncCursor} uiState={handlers.uiState as PersistedState} renderComplete={renderComplete} /> diff --git a/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts index 71d12db8ffb91..db424238bcffb 100644 --- a/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts +++ b/src/plugins/chart_expressions/expression_xy/public/helpers/interval.test.ts @@ -18,7 +18,12 @@ describe('calculateMinInterval', () => { beforeEach(() => { const { layers, ...restArgs } = sampleArgs().args; - xyProps = { args: { ...restArgs, layers }, syncColors: false, syncTooltips: false }; + xyProps = { + args: { ...restArgs, layers }, + syncColors: false, + syncTooltips: false, + syncCursor: true, + }; layer = xyProps.args.layers[0] as DataLayerConfig; layer.xScaleType = 'time'; }); diff --git a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx index d4ee045a8d9a8..a5f6ab4197bd9 100644 --- a/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx +++ b/src/plugins/dashboard/public/application/embeddable/dashboard_container.tsx @@ -68,6 +68,7 @@ export interface InheritedChildInput extends IndexSignature { id: string; searchSessionId?: string; syncColors?: boolean; + syncCursor?: boolean; syncTooltips?: boolean; executionContext?: KibanaExecutionContext; } @@ -351,6 +352,7 @@ export class DashboardContainer extends Container): DashboardState => { useMargins: true, syncColors: false, syncTooltips: false, + syncCursor: true, }, panels: { panel_1: { @@ -99,6 +100,7 @@ describe('Dashboard state diff function', () => { useMargins: false, syncColors: false, syncTooltips: false, + syncCursor: true, }, }) ).toEqual(['options']); @@ -111,6 +113,7 @@ describe('Dashboard state diff function', () => { useMargins: true, syncColors: undefined, syncTooltips: undefined, + syncCursor: undefined, } as unknown as DashboardOptions, }) ).toEqual([]); diff --git a/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts index 669bde5c3eb65..61a9c75dac410 100644 --- a/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts +++ b/src/plugins/dashboard/public/application/state/dashboard_state_slice.ts @@ -61,6 +61,9 @@ export const dashboardStateSlice = createSlice({ setSyncColors: (state, action: PayloadAction) => { state.options.syncColors = action.payload; }, + setSyncCursor: (state, action: PayloadAction) => { + state.options.syncCursor = action.payload; + }, setSyncTooltips: (state, action: PayloadAction) => { state.options.syncTooltips = action.payload; }, @@ -128,6 +131,7 @@ export const { setTimeRange, setSyncColors, setSyncTooltips, + setSyncCursor, setUseMargins, setViewMode, setFilters, diff --git a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx index 97630c48dc784..31896f6fc2adf 100644 --- a/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx +++ b/src/plugins/dashboard/public/application/top_nav/dashboard_top_nav.tsx @@ -39,6 +39,7 @@ import { setStateFromSaveModal, setSyncColors, setSyncTooltips, + setSyncCursor, setUseMargins, setViewMode, useDashboardDispatch, @@ -402,6 +403,10 @@ export function DashboardTopNav({ onSyncColorsChange: (isChecked: boolean) => { dispatchDashboardStateChange(setSyncColors(isChecked)); }, + syncCursor: currentState.options.syncCursor ?? true, + onSyncCursorChange: (isChecked: boolean) => { + dispatchDashboardStateChange(setSyncCursor(isChecked)); + }, syncTooltips: Boolean(currentState.options.syncTooltips), onSyncTooltipsChange: (isChecked: boolean) => { dispatchDashboardStateChange(setSyncTooltips(isChecked)); diff --git a/src/plugins/dashboard/public/application/top_nav/options.tsx b/src/plugins/dashboard/public/application/top_nav/options.tsx index 3b20da4c7c1a3..f877e4bfb5b08 100644 --- a/src/plugins/dashboard/public/application/top_nav/options.tsx +++ b/src/plugins/dashboard/public/application/top_nav/options.tsx @@ -18,6 +18,8 @@ interface Props { onHidePanelTitlesChange: (hideTitles: boolean) => void; syncColors: boolean; onSyncColorsChange: (syncColors: boolean) => void; + syncCursor: boolean; + onSyncCursorChange: (syncCursor: boolean) => void; syncTooltips: boolean; onSyncTooltipsChange: (syncTooltips: boolean) => void; } @@ -26,6 +28,7 @@ interface State { useMargins: boolean; hidePanelTitles: boolean; syncColors: boolean; + syncCursor: boolean; syncTooltips: boolean; } @@ -34,6 +37,7 @@ export class OptionsMenu extends Component { useMargins: this.props.useMargins, hidePanelTitles: this.props.hidePanelTitles, syncColors: this.props.syncColors, + syncCursor: this.props.syncCursor, syncTooltips: this.props.syncTooltips, }; @@ -59,6 +63,12 @@ export class OptionsMenu extends Component { this.setState({ syncColors: isChecked }); }; + handleSyncCursorChange = (evt: any) => { + const isChecked = evt.target.checked; + this.props.onSyncCursorChange(isChecked); + this.setState({ syncCursor: isChecked }); + }; + handleSyncTooltipsChange = (evt: any) => { const isChecked = evt.target.checked; this.props.onSyncTooltipsChange(isChecked); @@ -101,12 +111,24 @@ export class OptionsMenu extends Component { /> + + + + diff --git a/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx b/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx index 253c14f531fdf..0025fb00fa80f 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_options_popover.tsx @@ -31,6 +31,8 @@ export interface ShowOptionsPopoverProps { onUseMarginsChange: (useMargins: boolean) => void; syncColors: boolean; onSyncColorsChange: (syncColors: boolean) => void; + syncCursor: boolean; + onSyncCursorChange: (syncCursor: boolean) => void; syncTooltips: boolean; onSyncTooltipsChange: (syncTooltips: boolean) => void; hidePanelTitles: boolean; @@ -45,6 +47,8 @@ export function showOptionsPopover({ onHidePanelTitlesChange, syncColors, onSyncColorsChange, + syncCursor, + onSyncCursorChange, syncTooltips, onSyncTooltipsChange, }: ShowOptionsPopoverProps) { @@ -78,6 +82,8 @@ export function showOptionsPopover({ onHidePanelTitlesChange={onHidePanelTitlesChange} syncColors={syncColors} onSyncColorsChange={onSyncColorsChange} + syncCursor={syncCursor} + onSyncCursorChange={onSyncCursorChange} syncTooltips={syncTooltips} onSyncTooltipsChange={onSyncTooltipsChange} /> diff --git a/src/plugins/dashboard/public/application/top_nav/show_share_modal.test.tsx b/src/plugins/dashboard/public/application/top_nav/show_share_modal.test.tsx index 7e76ef1789a38..5f6dc325ce97a 100644 --- a/src/plugins/dashboard/public/application/top_nav/show_share_modal.test.tsx +++ b/src/plugins/dashboard/public/application/top_nav/show_share_modal.test.tsx @@ -109,6 +109,7 @@ describe('ShowShareModal', () => { hidePanelTitles: true, useMargins: true, syncColors: true, + syncCursor: true, syncTooltips: true, }, filters: [ diff --git a/src/plugins/dashboard/public/dashboard_constants.ts b/src/plugins/dashboard/public/dashboard_constants.ts index 9bbe97681032d..c4856f8e2e34a 100644 --- a/src/plugins/dashboard/public/dashboard_constants.ts +++ b/src/plugins/dashboard/public/dashboard_constants.ts @@ -46,6 +46,7 @@ export const defaultDashboardState: DashboardState = { options: { useMargins: true, syncColors: false, + syncCursor: true, syncTooltips: false, hidePanelTitles: false, }, diff --git a/src/plugins/dashboard/public/types.ts b/src/plugins/dashboard/public/types.ts index 6b24317338ab3..a9de47f63235b 100644 --- a/src/plugins/dashboard/public/types.ts +++ b/src/plugins/dashboard/public/types.ts @@ -71,6 +71,7 @@ export interface DashboardContainerInput extends ContainerInput { useMargins: boolean; syncColors?: boolean; syncTooltips?: boolean; + syncCursor?: boolean; viewMode: ViewMode; filters: Filter[]; title: string; @@ -118,6 +119,7 @@ export type DashboardOptions = { hidePanelTitles: boolean; useMargins: boolean; syncColors: boolean; + syncCursor: boolean; syncTooltips: boolean; }; diff --git a/src/plugins/embeddable/common/types.ts b/src/plugins/embeddable/common/types.ts index c37b3ee2b720c..fd4a94419613a 100644 --- a/src/plugins/embeddable/common/types.ts +++ b/src/plugins/embeddable/common/types.ts @@ -58,6 +58,11 @@ export type EmbeddableInput = { */ syncColors?: boolean; + /** + * Flag whether cursor should be synced with other panels on hover + */ + syncCursor?: boolean; + /** * Flag whether tooltips should be synced with other panels on hover */ diff --git a/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.test.ts b/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.test.ts index 1dfd056bc75c0..41a68fc0f2444 100644 --- a/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.test.ts +++ b/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.test.ts @@ -21,6 +21,7 @@ const getGenericEmbeddableState = (state?: Partial): Embeddable enhancements: undefined, syncColors: false, syncTooltips: false, + syncCursor: true, viewMode: ViewMode.VIEW, title: 'So Very Generic', id: 'soVeryGeneric', @@ -46,6 +47,7 @@ test('Omitting generic embeddable input omits all generic input keys', () => { 'enhancements', 'syncColors', 'syncTooltips', + 'syncCursor', 'viewMode', 'title', 'id', diff --git a/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.ts b/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.ts index a66294d08bdc4..8602e174205d7 100644 --- a/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.ts +++ b/src/plugins/embeddable/public/lib/embeddables/diff_embeddable_input.ts @@ -20,6 +20,7 @@ const allGenericInputKeys: Readonly> = [ 'disableTriggers', 'enhancements', 'syncColors', + 'syncCursor', 'syncTooltips', 'viewMode', 'title', @@ -32,6 +33,7 @@ const genericInputKeysToCompare = [ 'disableTriggers', 'enhancements', 'syncColors', + 'syncCursor', 'syncTooltips', 'title', 'id', diff --git a/src/plugins/embeddable/public/store/input_slice.ts b/src/plugins/embeddable/public/store/input_slice.ts index da4bc6618ae11..48c9ccb98b6ba 100644 --- a/src/plugins/embeddable/public/store/input_slice.ts +++ b/src/plugins/embeddable/public/store/input_slice.ts @@ -40,6 +40,9 @@ export const input = createSlice({ setSyncColors(state, action: PayloadAction) { state.syncColors = action.payload; }, + setSyncCursor(state, action: PayloadAction) { + state.syncCursor = action.payload; + }, setSyncTooltips(state, action: PayloadAction) { state.syncTooltips = action.payload; }, diff --git a/src/plugins/expressions/common/execution/execution.ts b/src/plugins/expressions/common/execution/execution.ts index 68cebaa65569b..30016f36d77d6 100644 --- a/src/plugins/expressions/common/execution/execution.ts +++ b/src/plugins/expressions/common/execution/execution.ts @@ -225,6 +225,7 @@ export class Execution< inspectorAdapters.tables[name] = datatable; }, isSyncColorsEnabled: () => execution.params.syncColors!, + isSyncCursorEnabled: () => execution.params.syncCursor!, isSyncTooltipsEnabled: () => execution.params.syncTooltips!, ...execution.executor.context, getExecutionContext: () => execution.params.executionContext, diff --git a/src/plugins/expressions/common/execution/types.ts b/src/plugins/expressions/common/execution/types.ts index debe34e223e08..dddc503285942 100644 --- a/src/plugins/expressions/common/execution/types.ts +++ b/src/plugins/expressions/common/execution/types.ts @@ -65,6 +65,11 @@ export interface ExecutionContext< */ isSyncColorsEnabled?: () => boolean; + /** + * Returns the state (true|false) of the sync cursor across panels switch. + */ + isSyncCursorEnabled?: () => boolean; + /** * Returns the state (true|false) of the sync tooltips across panels switch. */ diff --git a/src/plugins/expressions/common/expression_renderers/types.ts b/src/plugins/expressions/common/expression_renderers/types.ts index 04c3c48cc383c..8f5fc21e205c7 100644 --- a/src/plugins/expressions/common/expression_renderers/types.ts +++ b/src/plugins/expressions/common/expression_renderers/types.ts @@ -93,6 +93,8 @@ export interface IInterpreterRenderHandlers { isSyncColorsEnabled(): boolean; + isSyncCursorEnabled(): boolean; + isSyncTooltipsEnabled(): boolean; /** * This uiState interface is actually `PersistedState` from the visualizations plugin, diff --git a/src/plugins/expressions/common/service/expressions_services.ts b/src/plugins/expressions/common/service/expressions_services.ts index 530bce8066716..097b0823a98f0 100644 --- a/src/plugins/expressions/common/service/expressions_services.ts +++ b/src/plugins/expressions/common/service/expressions_services.ts @@ -152,6 +152,8 @@ export interface ExpressionExecutionParams { syncColors?: boolean; + syncCursor?: boolean; + syncTooltips?: boolean; inspectorAdapters?: Adapters; diff --git a/src/plugins/expressions/public/loader.ts b/src/plugins/expressions/public/loader.ts index c8b0cf6845b86..5b1ae822e1a2c 100644 --- a/src/plugins/expressions/public/loader.ts +++ b/src/plugins/expressions/public/loader.ts @@ -114,6 +114,7 @@ export class ExpressionLoader { renderMode: params?.renderMode, syncColors: params?.syncColors, syncTooltips: params?.syncTooltips, + syncCursor: params?.syncCursor, hasCompatibleActions: params?.hasCompatibleActions, executionContext: params?.executionContext, }); @@ -199,6 +200,7 @@ export class ExpressionLoader { searchSessionId: params.searchSessionId, debug: params.debug, syncColors: params.syncColors, + syncCursor: params?.syncCursor, syncTooltips: params.syncTooltips, executionContext: params.executionContext, }); @@ -238,6 +240,7 @@ export class ExpressionLoader { this.params.searchSessionId = params.searchSessionId; } this.params.syncColors = params.syncColors; + this.params.syncCursor = params.syncCursor; this.params.syncTooltips = params.syncTooltips; this.params.debug = Boolean(params.debug); this.params.partial = Boolean(params.partial); diff --git a/src/plugins/expressions/public/react_expression_renderer/use_expression_renderer.ts b/src/plugins/expressions/public/react_expression_renderer/use_expression_renderer.ts index bb2c716313a1c..865a3ef21fb6f 100644 --- a/src/plugins/expressions/public/react_expression_renderer/use_expression_renderer.ts +++ b/src/plugins/expressions/public/react_expression_renderer/use_expression_renderer.ts @@ -116,6 +116,7 @@ export function useExpressionRenderer( debouncedLoaderParams.renderMode, debouncedLoaderParams.syncColors, debouncedLoaderParams.syncTooltips, + debouncedLoaderParams.syncCursor, ]); useEffect(() => { diff --git a/src/plugins/expressions/public/render.ts b/src/plugins/expressions/public/render.ts index 048f73ef66fa5..fd550b2888316 100644 --- a/src/plugins/expressions/public/render.ts +++ b/src/plugins/expressions/public/render.ts @@ -30,6 +30,7 @@ export interface ExpressionRenderHandlerParams { onRenderError?: RenderErrorHandlerFnType; renderMode?: RenderMode; syncColors?: boolean; + syncCursor?: boolean; syncTooltips?: boolean; interactive?: boolean; hasCompatibleActions?: (event: ExpressionRendererEvent) => Promise; @@ -59,6 +60,7 @@ export class ExpressionRenderHandler { renderMode, syncColors, syncTooltips, + syncCursor, interactive, hasCompatibleActions = async () => false, executionContext, @@ -106,6 +108,9 @@ export class ExpressionRenderHandler { isSyncTooltipsEnabled: () => { return syncTooltips || false; }, + isSyncCursorEnabled: () => { + return syncCursor || true; + }, isInteractive: () => { return interactive ?? true; }, diff --git a/src/plugins/expressions/public/types/index.ts b/src/plugins/expressions/public/types/index.ts index b035daf4deefc..c47eb4592fa4f 100644 --- a/src/plugins/expressions/public/types/index.ts +++ b/src/plugins/expressions/public/types/index.ts @@ -50,6 +50,7 @@ export interface IExpressionLoaderParams { searchSessionId?: string; renderMode?: RenderMode; syncColors?: boolean; + syncCursor?: boolean; syncTooltips?: boolean; hasCompatibleActions?: ExpressionRenderHandlerParams['hasCompatibleActions']; executionContext?: KibanaExecutionContext; diff --git a/src/plugins/presentation_util/public/__stories__/render.tsx b/src/plugins/presentation_util/public/__stories__/render.tsx index b96dfcbc0fbe9..ca9f968842270 100644 --- a/src/plugins/presentation_util/public/__stories__/render.tsx +++ b/src/plugins/presentation_util/public/__stories__/render.tsx @@ -16,6 +16,7 @@ import { export const defaultHandlers: IInterpreterRenderHandlers = { getRenderMode: () => 'view', isSyncColorsEnabled: () => false, + isSyncCursorEnabled: () => true, isSyncTooltipsEnabled: () => false, isInteractive: () => true, getExecutionContext: () => undefined, diff --git a/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx b/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx index 9e99b2e96d78d..9d59cf105af66 100644 --- a/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx +++ b/src/plugins/vis_types/timelion/public/components/timelion_vis_component.tsx @@ -59,6 +59,7 @@ interface TimelionVisComponentProps { renderComplete: IInterpreterRenderHandlers['done']; ariaLabel?: string; syncTooltips?: boolean; + syncCursor?: boolean; } const DefaultYAxis = () => ( @@ -104,6 +105,7 @@ export const TimelionVisComponent = ({ onBrushEvent, ariaLabel, syncTooltips, + syncCursor, }: TimelionVisComponentProps) => { const kibana = useKibana(); const chartRef = useRef(null); @@ -203,7 +205,7 @@ export const TimelionVisComponent = ({ showLegendExtra={true} legendPosition={legend.legendPosition} onRenderChange={onRenderChange} - onPointerUpdate={handleCursorUpdate} + onPointerUpdate={syncCursor ? handleCursorUpdate : undefined} externalPointerEvents={{ tooltip: { visible: syncTooltips, placement: Placement.Right }, }} diff --git a/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts index 3a268e61690a1..c072f40e42ca9 100644 --- a/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts +++ b/src/plugins/vis_types/timelion/public/timelion_vis_fn.ts @@ -22,6 +22,7 @@ export interface TimelionRenderValue { visType: 'timelion'; visParams: TimelionVisParams; syncTooltips: boolean; + syncCursor: boolean; } export interface TimelionVisParams { @@ -75,6 +76,7 @@ export const getTimelionVisualizationConfig = ( variables, abortSignal: expressionAbortSignal, isSyncTooltipsEnabled, + isSyncCursorEnabled, } ) { const { getTimelionRequestHandler } = await import('./async_services'); @@ -114,6 +116,7 @@ export const getTimelionVisualizationConfig = ( visType: TIMELION_VIS_NAME, visData, syncTooltips: isSyncTooltipsEnabled?.() ?? false, + syncCursor: isSyncTooltipsEnabled?.() ?? true, }, }; }, diff --git a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx index ab60f7683dc2d..40541a00c4fcb 100644 --- a/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx +++ b/src/plugins/vis_types/timelion/public/timelion_vis_renderer.tsx @@ -43,7 +43,7 @@ export const getTimelionVisRenderer: ( name: 'timelion_vis', displayName: 'Timelion visualization', reuseDomNode: true, - render: (domNode, { visData, visParams, syncTooltips }, handlers) => { + render: (domNode, { visData, visParams, syncTooltips, syncCursor }, handlers) => { handlers.onDestroy(() => { unmountComponentAtNode(domNode); }); @@ -99,6 +99,7 @@ export const getTimelionVisRenderer: ( renderComplete={renderComplete} onBrushEvent={onBrushEvent} syncTooltips={syncTooltips} + syncCursor={syncCursor} /> )} diff --git a/src/plugins/vis_types/timeseries/public/application/components/timeseries_visualization.tsx b/src/plugins/vis_types/timeseries/public/application/components/timeseries_visualization.tsx index ca374d667463d..bb3d8122c9609 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/timeseries_visualization.tsx +++ b/src/plugins/vis_types/timeseries/public/application/components/timeseries_visualization.tsx @@ -37,6 +37,7 @@ interface TimeseriesVisualizationProps { visData: TimeseriesVisData; uiState: PersistedState; syncColors: boolean; + syncCursor: boolean; syncTooltips: boolean; initialRender: () => void; } @@ -48,6 +49,7 @@ function TimeseriesVisualization({ uiState, getConfig, syncColors, + syncCursor, syncTooltips, initialRender, }: TimeseriesVisualizationProps) { @@ -194,6 +196,7 @@ function TimeseriesVisualization({ onUiState={handleUiState} syncColors={syncColors} syncTooltips={syncTooltips} + syncCursor={syncCursor} palettesService={palettesService} indexPattern={indexPattern} fieldFormatMap={indexPattern?.fieldFormatMap} diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/index.ts b/src/plugins/vis_types/timeseries/public/application/components/vis_types/index.ts index b7fee33728314..65f8dfa763093 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/index.ts +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/index.ts @@ -64,6 +64,7 @@ export interface TimeseriesVisProps { getConfig: IUiSettingsClient['get']; syncColors: boolean; syncTooltips: boolean; + syncCursor: boolean; palettesService: PaletteRegistry; indexPattern?: FetchedIndexPattern['indexPattern']; /** @deprecated please use indexPattern.fieldFormatMap instead **/ diff --git a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/vis.js b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/vis.js index 25d64816614a9..411bb9e41b5e4 100644 --- a/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/vis.js +++ b/src/plugins/vis_types/timeseries/public/application/components/vis_types/timeseries/vis.js @@ -163,6 +163,7 @@ class TimeseriesVisualization extends Component { onFilterClick, syncColors, syncTooltips, + syncCursor, palettesService, fieldFormatMap, getConfig, @@ -275,6 +276,7 @@ class TimeseriesVisualization extends Component { annotations={this.prepareAnnotations()} syncColors={syncColors} syncTooltips={syncTooltips} + syncCursor={syncCursor} palettesService={palettesService} interval={interval} initialRender={initialRender} diff --git a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/index.js b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/index.js index e075cac92641c..1ca0f6d50efcc 100644 --- a/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/index.js +++ b/src/plugins/vis_types/timeseries/public/application/visualizations/views/timeseries/index.js @@ -73,6 +73,7 @@ export const TimeSeries = ({ annotations, syncColors, syncTooltips, + syncCursor, palettesService, interval, isLastBucketDropped, @@ -179,7 +180,7 @@ export const TimeSeries = ({ onBrushEnd={onBrushEndListener} onElementClick={(args) => handleElementClick(args)} animateData={false} - onPointerUpdate={handleCursorUpdate} + onPointerUpdate={syncCursor ? handleCursorUpdate : undefined} pointerUpdateDebounce={0} theme={[ { diff --git a/src/plugins/vis_types/timeseries/public/metrics_fn.ts b/src/plugins/vis_types/timeseries/public/metrics_fn.ts index e6e2814b6e08b..fe9406895cd6e 100644 --- a/src/plugins/vis_types/timeseries/public/metrics_fn.ts +++ b/src/plugins/vis_types/timeseries/public/metrics_fn.ts @@ -26,6 +26,7 @@ export interface TimeseriesRenderValue { visData: TimeseriesVisData | {}; visParams: TimeseriesVisParams; syncColors: boolean; + syncCursor: boolean; syncTooltips: boolean; canNavigateToLens?: boolean; } @@ -63,6 +64,7 @@ export const createMetricsFn = (): TimeseriesExpressionFunctionDefinition => ({ getSearchSessionId, isSyncColorsEnabled, isSyncTooltipsEnabled, + isSyncCursorEnabled, getExecutionContext, inspectorAdapters, abortSignal: expressionAbortSignal, @@ -73,6 +75,7 @@ export const createMetricsFn = (): TimeseriesExpressionFunctionDefinition => ({ const uiState = JSON.parse(args.uiState); const syncColors = isSyncColorsEnabled?.() ?? false; const syncTooltips = isSyncTooltipsEnabled?.() ?? false; + const syncCursor = isSyncCursorEnabled?.() ?? true; const response = await metricsRequestHandler({ input, @@ -92,6 +95,7 @@ export const createMetricsFn = (): TimeseriesExpressionFunctionDefinition => ({ visData: response, syncColors, syncTooltips, + syncCursor, canNavigateToLens: variables.canNavigateToLens as boolean, }, }; diff --git a/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx b/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx index 4d64e46356c0d..065259ce8882c 100644 --- a/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx +++ b/src/plugins/vis_types/timeseries/public/timeseries_vis_renderer.tsx @@ -62,7 +62,14 @@ export const getTimeseriesVisRenderer: (deps: { handlers.onDestroy(() => { unmountComponentAtNode(domNode); }); - const { visParams: model, visData, syncColors, syncTooltips, canNavigateToLens } = config; + const { + visParams: model, + visData, + syncColors, + syncTooltips, + syncCursor, + canNavigateToLens, + } = config; const showNoResult = !checkIfDataExists(visData, model); const renderComplete = () => { @@ -106,6 +113,7 @@ export const getTimeseriesVisRenderer: (deps: { visData={visData as TimeseriesVisData} syncColors={syncColors} syncTooltips={syncTooltips} + syncCursor={syncCursor} uiState={handlers.uiState! as PersistedState} initialRender={renderComplete} /> diff --git a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx index 26746f8d23200..ef9e8d53a4f11 100644 --- a/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx +++ b/src/plugins/visualizations/public/embeddable/visualize_embeddable.tsx @@ -110,6 +110,7 @@ export class VisualizeEmbeddable private searchSessionId?: string; private syncColors?: boolean; private syncTooltips?: boolean; + private syncCursor?: boolean; private embeddableTitle?: string; private visCustomizations?: Pick; private subscriptions: Subscription[] = []; @@ -154,6 +155,7 @@ export class VisualizeEmbeddable this.timefilter = timefilter; this.syncColors = this.input.syncColors; this.syncTooltips = this.input.syncTooltips; + this.syncCursor = this.input.syncCursor; this.searchSessionId = this.input.searchSessionId; this.query = this.input.query; this.embeddableTitle = this.getTitle(); @@ -322,6 +324,11 @@ export class VisualizeEmbeddable dirty = true; } + if (this.syncCursor !== this.input.syncCursor) { + this.syncCursor = this.input.syncCursor; + dirty = true; + } + if (this.embeddableTitle !== this.getTitle()) { this.embeddableTitle = this.getTitle(); dirty = true; @@ -574,6 +581,7 @@ export class VisualizeEmbeddable searchSessionId: this.input.searchSessionId, syncColors: this.input.syncColors, syncTooltips: this.input.syncTooltips, + syncCursor: this.input.syncCursor, uiState: this.vis.uiState, interactive: !this.input.disableTriggers, inspectorAdapters: this.inspectorAdapters, diff --git a/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx b/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx index b34a7c02eb4b1..e53dce0a46886 100644 --- a/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx +++ b/x-pack/plugins/canvas/canvas_plugin_src/renderers/__stories__/render.tsx @@ -15,6 +15,7 @@ export const defaultHandlers: RendererHandlers = { getFilter: () => 'filter', getRenderMode: () => 'view', isSyncColorsEnabled: () => false, + isSyncCursorEnabled: () => true, isSyncTooltipsEnabled: () => false, isInteractive: () => true, onComplete: (fn) => undefined, diff --git a/x-pack/plugins/canvas/public/lib/create_handlers.ts b/x-pack/plugins/canvas/public/lib/create_handlers.ts index dbd542f18b537..374bdaff99721 100644 --- a/x-pack/plugins/canvas/public/lib/create_handlers.ts +++ b/x-pack/plugins/canvas/public/lib/create_handlers.ts @@ -28,6 +28,7 @@ export const createBaseHandlers = (): IInterpreterRenderHandlers => ({ getRenderMode: () => 'view', isSyncColorsEnabled: () => false, isSyncTooltipsEnabled: () => false, + isSyncCursorEnabled: () => true, isInteractive: () => true, getExecutionContext: () => undefined, }); diff --git a/x-pack/plugins/lens/public/embeddable/embeddable.tsx b/x-pack/plugins/lens/public/embeddable/embeddable.tsx index 77164cfa1e1fa..103c75844f816 100644 --- a/x-pack/plugins/lens/public/embeddable/embeddable.tsx +++ b/x-pack/plugins/lens/public/embeddable/embeddable.tsx @@ -677,6 +677,7 @@ export class Embeddable renderMode={input.renderMode} syncColors={input.syncColors} syncTooltips={input.syncTooltips} + syncCursor={input.syncCursor} hasCompatibleActions={this.hasCompatibleActions} className={input.className} style={input.style} diff --git a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx index 6e2627e0e1cf6..3f10fba310b0c 100644 --- a/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx +++ b/x-pack/plugins/lens/public/embeddable/expression_wrapper.tsx @@ -39,6 +39,7 @@ export interface ExpressionWrapperProps { renderMode?: RenderMode; syncColors?: boolean; syncTooltips?: boolean; + syncCursor?: boolean; hasCompatibleActions?: ReactExpressionRendererProps['hasCompatibleActions']; style?: React.CSSProperties; className?: string; @@ -113,6 +114,7 @@ export function ExpressionWrapper({ renderMode, syncColors, syncTooltips, + syncCursor, hasCompatibleActions, style, className, @@ -143,6 +145,7 @@ export function ExpressionWrapper({ renderMode={renderMode} syncColors={syncColors} syncTooltips={syncTooltips} + syncCursor={syncCursor} executionContext={executionContext} renderError={(errorMessage, error) => { onRuntimeError(); From 3da16f3bd0ffdeb82c5b8276f7801cee02dc3503 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 14 Oct 2022 14:05:59 +0300 Subject: [PATCH 2/4] Increase XY limits as it fails for 1B :) --- packages/kbn-optimizer/limits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/kbn-optimizer/limits.yml b/packages/kbn-optimizer/limits.yml index 07d813b5f6dc8..ecfefeb3df818 100644 --- a/packages/kbn-optimizer/limits.yml +++ b/packages/kbn-optimizer/limits.yml @@ -49,7 +49,7 @@ pageLoadAssetSize: expressions: 140958 expressionShape: 34008 expressionTagcloud: 27505 - expressionXY: 38000 + expressionXY: 38500 features: 21723 fieldFormats: 65209 files: 22673 From a1d007284b6abf301ede681c3fafd2d72e53b465 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Fri, 14 Oct 2022 15:01:21 +0300 Subject: [PATCH 3/4] Fix jest tests --- .../__snapshots__/heatmap_function.test.ts.snap | 2 +- .../public/application/lib/diff_dashboard_state.test.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap index 8a05891f2886b..96b70e33021f4 100644 --- a/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap +++ b/src/plugins/chart_expressions/expression_heatmap/common/expression_functions/__snapshots__/heatmap_function.test.ts.snap @@ -101,8 +101,8 @@ Object { ], "type": "datatable", }, - "syncTooltips": false, "syncCursor": true, + "syncTooltips": false, }, } `; diff --git a/src/plugins/dashboard/public/application/lib/diff_dashboard_state.test.ts b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.test.ts index 6192259f33914..9bcdbd1bed9aa 100644 --- a/src/plugins/dashboard/public/application/lib/diff_dashboard_state.test.ts +++ b/src/plugins/dashboard/public/application/lib/diff_dashboard_state.test.ts @@ -113,7 +113,7 @@ describe('Dashboard state diff function', () => { useMargins: true, syncColors: undefined, syncTooltips: undefined, - syncCursor: undefined, + syncCursor: true, } as unknown as DashboardOptions, }) ).toEqual([]); From ef877853fb4626efbf5bdc96f03007628a806fe3 Mon Sep 17 00:00:00 2001 From: Stratoula Kalafateli Date: Mon, 17 Oct 2022 09:10:27 +0300 Subject: [PATCH 4/4] Apply PR nit --- .../public/application/top_nav/options.tsx | 76 +++++++++++-------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/src/plugins/dashboard/public/application/top_nav/options.tsx b/src/plugins/dashboard/public/application/top_nav/options.tsx index f877e4bfb5b08..65a41c7099af0 100644 --- a/src/plugins/dashboard/public/application/top_nav/options.tsx +++ b/src/plugins/dashboard/public/application/top_nav/options.tsx @@ -99,39 +99,49 @@ export class OptionsMenu extends Component { data-test-subj="dashboardPanelTitlesCheckbox" /> - - - - - - - - - - - + + <> + + + + + + + + + + );